-
-
Save brusic/0cce882aee6990e172b1 to your computer and use it in GitHub Desktop.
Boost issue
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
# 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: [ | |
] | |
} |
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
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" | |
}' |
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
curl -XGET http://localhost:9200/test/test/_search?pretty=true -d ' | |
{ | |
"from" : 0, | |
"size" : 10, | |
"query" : { | |
"match_all" : { } | |
}, | |
"sort" : [ { | |
"Boost" : { | |
"order" : "desc" | |
} | |
} ] | |
} | |
' |
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
{ | |
"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