Skip to content

Instantly share code, notes, and snippets.

@brusic
Created January 18, 2013 19:56
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 brusic/0cce882aee6990e172b1 to your computer and use it in GitHub Desktop.
Save brusic/0cce882aee6990e172b1 to your computer and use it in GitHub Desktop.
Boost issue
# note that the properties are empty
{
state: open,
settings: {
index.number_of_replicas: 0,
index.number_of_shards: 1,
index.version.created: 200051
},
mappings: {
test: {
_boost: {
null_value: 1,
name: Boost
},
properties: {
}
}
},
aliases: [
]
}
curl -XPOST localhost:9200/test -d '{
"settings" : {
"number_of_shards" : 1,
"number_of_replicas" : 0
},
"mappings" : {
"test" : {
"_boost": {"name": "Boost", "null_value": 1.0},
"properties" : {
"Boost" : { "type" : "float", "index": "not_analyzed" }
}
}
}
}'
curl -XPUT http://localhost:9200/test/test/1 -d '{
"Boost": "25.0"
}'
curl -XPUT http://localhost:9200/test/test/2 -d '{
"Boost": "0.5"
}'
curl -XPUT http://localhost:9200/test/test/3 -d '{
"Boost": "0.5"
}'
curl -XPUT http://localhost:9200/test/test/4 -d '{
"Boost": "14.1"
}'
{
"took" : 2,
"timed_out" : false,
"_shards" : {
"total" : 1,
"successful" : 1,
"failed" : 0
},
"hits" : {
"total" : 4,
"max_score" : null,
"hits" : [ {
"_index" : "test",
"_type" : "test",
"_id" : "1",
"_score" : null, "_source" : {
"Boost": "25.0"
},
"sort" : [ 0.0 ]
}, {
"_index" : "test",
"_type" : "test",
"_id" : "2",
"_score" : null, "_source" : {
"Boost": "0.5"
},
"sort" : [ 0.0 ]
}, {
"_index" : "test",
"_type" : "test",
"_id" : "3",
"_score" : null, "_source" : {
"Boost": "0.5"
},
"sort" : [ 0.0 ]
}, {
"_index" : "test",
"_type" : "test",
"_id" : "4",
"_score" : null, "_source" : {
"Boost": "14.1"
},
"sort" : [ 0.0 ]
} ]
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment