Updating boost values dynamically


(invaderZYM) #1

Sorry for the noob question, but I seem to have a disconnect when it
comes to mapping and boost values. Currently I use field level
boosting in my mapping file like so

    "option.Antibody Products" : {
      "type" : "multi_field",
      "fields" : {
        "option.Antibody Products" : {
          "include_in_all" : true,
          "boost" : 4.0,
          "type" : "string"
        },
        "stored" : {
          "include_in_all" : false,
          "store" : "yes",
          "analyzer" : "lowercase_whitespace",
          "type" : "string"
        }
      }

and for that I have to manually go in and update the boost value in
the mapping file. Is there a way I can update this value when I index
the document? I've checked http://www.elasticsearch.org/guide/reference/mapping/boost-field.html
but it seems to be updating the boost value of the document and not
the individual fields.

Thanks for any and all help


(Shay Banon) #2

You can provide a custom boost value within the json, shown here (check at
the end of the string section):
http://www.elasticsearch.org/guide/reference/mapping/core-types.html. Note
though, it will not work with multi field mapping sadly...

On Tue, Oct 25, 2011 at 10:03 PM, invaderZYM zspliff@gmail.com wrote:

Sorry for the noob question, but I seem to have a disconnect when it
comes to mapping and boost values. Currently I use field level
boosting in my mapping file like so

   "option.Antibody Products" : {
     "type" : "multi_field",
     "fields" : {
       "option.Antibody Products" : {
         "include_in_all" : true,
         "boost" : 4.0,
         "type" : "string"
       },
       "stored" : {
         "include_in_all" : false,
         "store" : "yes",
         "analyzer" : "lowercase_whitespace",
         "type" : "string"
       }
     }

and for that I have to manually go in and update the boost value in
the mapping file. Is there a way I can update this value when I index
the document? I've checked
http://www.elasticsearch.org/guide/reference/mapping/boost-field.html
but it seems to be updating the boost value of the document and not
the individual fields.

Thanks for any and all help


(system) #3