Boost levels for fields with same name


(Guilherme Maranhao) #1

Hi everybody,

I have the following mapping:

{
    object_1: {
          properties: {
               field_name: {
                   type: "text",
                   index_options: "offsets",
                   analyzer: "my_analyzer"
               }
          }
    },
    object_2: {
          properties: {
               field_name: {
                   type: "text",
                   index_options: "offsets",
                   analyzer: "my_analyzer"
               }
          }
    }
}

My query is defined as:

query: {
{
     query_string: {
             query: "search_term",
              fields: [
                   object_1.field_name^4,
                   object_2.field_name^2
               ]
     }
}

The fact that both objects contain a field with the same name "field_name", will the boost setting work properly? Documents that contain "search_term" on object_1.field_name will have the same score that documents that contain "search_term" on object_2.field_name or will elasticsearch apply the boost differently?

Thanks, Guilherme


(system) #2

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