Precedence of wildcard field boosts, for simple query string query

Hi,

we are using the simple query string query and want to set different boost depending on the field names. We have a lot of fields that end with e postfix such as "_txt" and want the boost some fields such as "title_de_xyz_txt", title_en_xyz_txt" while all fields that match just "_txt" should contribute 0 to the final score. We saw that the wildcard field boost with "*_txt" would overwrite the field boost of the more specific field boost, but after some experimenting we realized this might not always be the case. We didn't find any documentation on wildcard precedence, can anyone tell us what is the precedence of conflicting field boost in the query string query?

I attached some test examples with the ecommerce sample dataset to illustrate the behavior:

   GET /kibana_sample_data_ecommerce/_search
    {
      "query" : {
        "simple_query_string": {
          "query": "Eddie",
          "fields": [ "*full_name^0", "*full_name^100" ]
        }
      }
    }

-> Leads to score ^100

     GET /kibana_sample_data_ecommerce/_search
    {
      "query" : {
        "simple_query_string": {
          "query": "Eddie",
          "fields": [ "*_name^0", "*full_name^100" ]
        }
      }
    }

-> Leads to score 0

 GET /kibana_sample_data_ecommerce/_search
    {
      "query" : {
        "simple_query_string": {
          "query": "Eddie",
          "fields": [ "*full_name^0", "*_name^100" ]
        }
      }
    }

-> Leads to score ^100

GET /kibana_sample_data_ecommerce/_search
    {
      "query" : {
        "simple_query_string": {
          "query": "Eddie",
          "fields": [ "*full_name^0", "*l_name^100" ]
        }
      }
    }

-> Leads to score 0

So first it seems that the shorter wildcard expression always winns, but this is not the case when the expression is longer than 5 characters. Then it seems the expression with the lowest boost wins? Does anyone know where this is implemented or documented?

I figured out that multiple field definitions with wildcards matching the same fields lead to multiplication of their boost factors. I wrote a Stack Overflow question regarding this behavior to maybe get some more exposure:

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.