This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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"} }, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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"] |