Skip to content

Instantly share code, notes, and snippets.

curl -XPUT http://localhost:9200/twitter/foo/1 -d '{"message": "hello world"}'
curl -XPUT http://localhost:9200/twitter/bar/1 -d '{"message": "hello world"}'
# Use bool query with should clause, which ends up aggregating the scores if matching
# several clauses
curl -XGET 'http://localhost:9200/twitter/_search?pretty=1' -d '{
"query" : {
"bool" : {
"should" : [
{ "text" : { "message" : "hello"} },
curl -XPUT 'http://localhost:9200/test/' -d '{
"settings": {
"number_of_shards": 1,
"number_of_replicas": 0,
"analysis": {
"analyzer": {
"containsText" : {
"tokenizer": "whitespace",
"filter": ["asciifolding", "lowercase", "autocomplete"]