Skip to content

Instantly share code, notes, and snippets.

@karussell
Created June 20, 2011 11:21
Show Gist options
  • Save karussell/1035458 to your computer and use it in GitHub Desktop.
Save karussell/1035458 to your computer and use it in GitHub Desktop.
ElasticSearch boost + match all 1019
curl -XDELETE 'http://localhost:9200/twitter/'
# mapping for article includes
# "properties" : { "_boost" : { "type" : "float", "name" : "_boost", "null_value" : 1.0}, ...
curl -XPUT 'http://localhost:9200/twitter/article/1' -d '{
"_boost" : 1.0
}'
curl -XPUT 'http://localhost:9200/twitter/article/2' -d '{
"_boost" : 10.0
}'
curl -XPUT 'http://localhost:9200/twitter/article/3' -d '{
"_boost" : 3.0
}'
curl -XPOST 'http://localhost:9200/twitter/_refresh'
curl -XPOST 'http://localhost:9200/twitter/_search?pretty=true' -d '{
"query":{"match_all": { "norms_field" : "_boost" }
}}'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment