Hi everybody,
I am wondering about the scoring of my query. I am using a function_score on the field weight
of my documents. If I search for the term wien
two documents are coming from two indices.
Here my query:
GET _all/_search
{
"query": {
"function_score" : {
"query" : {
"bool" : {
"should" : [
{
"bool" : {
"must" : [
{
"multi_match" : {
"query" : "wien",
"fields" : [
"city.name_de^1.0"
],
"type" : "best_fields",
"operator" : "OR",
"slop" : 0,
"fuzziness" : "0",
"prefix_length" : 0,
"max_expansions" : 50,
"lenient" : false,
"zero_terms_query" : "NONE",
"boost" : 1.0
}
}
],
"filter" : [
{
"term" : {
"_index" : {
"value" : "city",
"boost" : 1.0
}
}
},
{
"term" : {
"enabled" : {
"value" : true,
"boost" : 1.0
}
}
}
],
"should" : [
{
"bool" : {
"disable_coord" : false,
"adjust_pure_negative" : true,
"boost" : 1.0
}
},
{
"bool" : {
"disable_coord" : false,
"adjust_pure_negative" : true,
"boost" : 1.0
}
}
],
"disable_coord" : false,
"adjust_pure_negative" : true,
"boost" : 1.0
}
},
{
"bool" : {
"must" : [
{
"multi_match" : {
"query" : "wien",
"fields" : [
"servicename.name_de^1.0"
],
"type" : "best_fields",
"operator" : "OR",
"slop" : 0,
"fuzziness" : "0",
"prefix_length" : 0,
"max_expansions" : 50,
"lenient" : false,
"zero_terms_query" : "NONE",
"boost" : 1.0
}
}
],
"filter" : [
{
"term" : {
"_index" : {
"value" : "servicename",
"boost" : 1.0
}
}
},
{
"term" : {
"enabled" : {
"value" : true,
"boost" : 1.0
}
}
}
],
"should" : [
{
"bool" : {
"disable_coord" : false,
"adjust_pure_negative" : true,
"boost" : 1.0
}
}
],
"disable_coord" : false,
"adjust_pure_negative" : true,
"boost" : 1.0
}
}
],
"disable_coord" : false,
"adjust_pure_negative" : true,
"boost" : 1.0
}
},
"functions" : [
{
"filter" : {
"match_all" : {
"boost" : 1.0
}
},
"field_value_factor" : {
"field" : "weight",
"factor" : 1.0,
"modifier" : "none"
}
}
],
"score_mode" : "multiply",
"max_boost" : 3.4028235E38,
"boost" : 1.0
}
}
}