-
-
Save imotov/2360279 to your computer and use it in GitHub Desktop.
Stop Words in Quoted vs Unquoted Search
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
{"ok":true,"acknowledged":true} | |
{"ok":true,"acknowledged":true} | |
{"ok":true,"_index":"test","_type":"content","_id":"1","_version":1} | |
{"ok":true,"_index":"test","_type":"content","_id":"2","_version":1} | |
{"ok":true,"_shards":{"total":10,"successful":5,"failed":0}} | |
{ | |
"took" : 7, | |
"timed_out" : false, | |
"_shards" : { | |
"total" : 5, | |
"successful" : 5, | |
"failed" : 0 | |
}, | |
"hits" : { | |
"total" : 1, | |
"max_score" : 0.12358323, | |
"hits" : [ { | |
"_index" : "test", | |
"_type" : "content", | |
"_id" : "1", | |
"_score" : 0.12358323, "_source" : | |
{ | |
"content" : "Acme Airlines is the worst way to travel." | |
} | |
} ] | |
} | |
} | |
{ | |
"took" : 23, | |
"timed_out" : false, | |
"_shards" : { | |
"total" : 5, | |
"successful" : 5, | |
"failed" : 0 | |
}, | |
"hits" : { | |
"total" : 1, | |
"max_score" : 0.07135081, | |
"hits" : [ { | |
"_index" : "test", | |
"_type" : "content", | |
"_id" : "1", | |
"_score" : 0.07135081, "_source" : | |
{ | |
"content" : "Acme Airlines is the worst way to travel." | |
} | |
} ] | |
} | |
} |
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
#!/bin/bash | |
curl -XDELETE localhost:9200/test/ | |
echo | |
curl -XPUT localhost:9200/test/ | |
echo | |
curl -XPUT localhost:9200/test/content/1 -d ' | |
{ | |
"content" : "Acme Airlines is the worst way to travel." | |
}' | |
echo | |
curl -XPUT localhost:9200/test/content/2 -d ' | |
{ | |
"content" : "Acme Airlines is the best way to get there." | |
}' | |
echo | |
curl -XPOST localhost:9200/test/_refresh | |
echo | |
#curl -XGET 'localhost:9200/test/content/_mapping?pretty=true' | |
#echo | |
curl -XGET 'localhost:9200/test/content/_search?pretty=true' -d ' | |
{"from": 0, | |
"query": {"filtered": {"filter": {"bool": {"must_not": [{"or": [{"term": {"applied_content_labels": 2}}, | |
{"term": {"applied_content_labels": 3}}]}]}}, | |
"query": {"query_string": {"default_operator": "AND", | |
"fields": ["actor_name", | |
"actor_id", | |
"title", | |
"content"], | |
"query": "\"worst way to travel\""}}}}, | |
"size": 25 | |
}' | |
echo | |
curl -XGET 'localhost:9200/test/content/_search?pretty=true' -d ' | |
{"from": 0, | |
"query": {"filtered": {"filter": {"bool": {"must_not": [{"or": [{"term": {"applied_content_labels": 2}}, | |
{"term": {"applied_content_labels": 3}}]}]}}, | |
"query": {"query_string": {"default_operator": "AND", | |
"fields": ["actor_name", | |
"actor_id", | |
"title", | |
"content"], | |
"query": "worst way to travel"}}}}, | |
"size": 25 | |
}' | |
echo |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment