-
-
Save imotov/7ecedea4f6a5219efb89 to your computer and use it in GitHub Desktop.
Broken numeric boost
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/sh | |
curl -XDELETE localhost:9200/relevance | |
echo | |
curl -XPUT localhost:9200/relevance -d '{ | |
"settings" : { | |
"index" : { | |
"number_of_shards" : 1, | |
"number_of_replicas" : 0 | |
} | |
}, | |
"mappings" : { | |
"doc" : { | |
"properties" : { | |
"important_int": { | |
"type" : "integer", | |
"store": "yes", | |
"boost": 1.2 | |
}, | |
"unimportant_int": { | |
"type" : "integer", | |
"store": "yes" | |
} | |
} | |
} | |
} | |
}' | |
echo | |
curl -XPUT localhost:9200/relevance/doc/1 -d '{"important_int":5, "unimportant_int": 10}' | |
echo | |
curl -XPUT localhost:9200/relevance/doc/2 -d '{"important_int":10, "unimportant_int": 5}' | |
echo | |
curl -XPUT localhost:9200/relevance/doc/3 -d '{ "important_int":{"value":10,"_boost":10}, "unimportant_int": 5}' | |
echo | |
curl -XPOST localhost:9200/relevance/_refresh | |
echo | |
curl "localhost:9200/relevance/_search?q=important_int:5+unimportant_int:5&pretty=true&explain=false" | |
echo | |
curl "localhost:9200/relevance/_search?q=important_int:10+unimportant_int:10&pretty=true&explain=false" | |
echo |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment