Skip to content

Instantly share code, notes, and snippets.

@imotov
Forked from kwloafman/stop-words-test.log
Created April 11, 2012 16:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save imotov/2360279 to your computer and use it in GitHub Desktop.
Save imotov/2360279 to your computer and use it in GitHub Desktop.
Stop Words in Quoted vs Unquoted Search
{"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."
}
} ]
}
}
#!/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