Skip to content

Instantly share code, notes, and snippets.

@nik9000
Created August 13, 2013 21:02
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 nik9000/6225677 to your computer and use it in GitHub Desktop.
Save nik9000/6225677 to your computer and use it in GitHub Desktop.
Phrase queries from query strings ignore boosts
curl -XDELETE "http://localhost:9200/test?pretty"
curl -XPOST "http://localhost:9200/test?pretty" -d '{
"settings": {
"index": {
"number_of_shards": 1,
"number_of_replicas": 0
}
}
}'
curl -XGET 'http://localhost:9200/_cluster/health?pretty=true&wait_for_status=yellow'
curl -XPOST "http://localhost:9200/test/test?pretty" -d '{"important": "phrase match", "less_important": "junk"}'
curl -XPOST "http://localhost:9200/test/test?pretty" -d '{"important": "not good", "less_important": "phrase match"}'
curl -XPOST 'http://localhost:9200/test/_refresh?pretty'
curl -XGET "http://localhost:9200/test/test/_search?pretty" -d '{
"query": {
"query_string": {
"query": "\"phrase match\"",
"fields": [ "important^10.0", "less_important" ],
"auto_generate_phrase_queries": true
}
}
}'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment