# Index-time boost in multi-valued fields

**URL:** <https://discuss.elastic.co/t/index-time-boost-in-multi-valued-fields/7256>\
**Category:** Elasticsearch\
**Created:** [April 6, 2012, 7:37pm UTC](https://discuss.elastic.co/t/index-time-boost-in-multi-valued-fields/7256 "2012-04-06T19:37:22Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Matthew\_A\_Brown](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/matthew_a_brown/32/2699_2.png) [@Matthew\_A\_Brown](https://discuss.elastic.co/u/Matthew_A_Brown)\
**Post date:** [April 6, 2012, 7:37pm UTC](https://discuss.elastic.co/t/index-time-boost-in-multi-valued-fields/7256/1 "2012-04-06T19:37:22Z")

</div>

I came across some pretty crazy scoring behavior recently, where  
certain matches on a field boosted at index-time had enormously high  
field norms. After some illuminating discussion on the #lucene  
channel, I tracked it down to this little nugget:

"The boost is multiplied by Document.getBoost() of the document  
containing this field. If a document has multiple fields with the same  
name, all such values are multiplied together. This product is then  
used to compute the norm factor for the field."  
(source: [http://lucene.apache.org/core/old\_versioned\_docs/versions/3\_5\_0/api/core/org/apache/lucene/document/AbstractField.html#setBoost(float)](http://lucene.apache.org/core/old_versioned_docs/versions/3_5_0/api/core/org/apache/lucene/document/AbstractField.html#setBoost%28float%29))

So basically the index-time boost you specify is taken to the power of  
the number of values in the field!

Since the whole concept of multi-valued field is more or less just  
sugar in Lucene, might it make more sense for ES to take care of  
concatenating the values in multi-valued fields and passing them as a  
single value to Lucene? This would make the index-time boost behavior  
better and I don't really see a downside.

Just a thought!

Mat

---

<div class="post-metadata">

**Author:** ![kimchy](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kimchy/32/44952_2.png) [@kimchy](https://discuss.elastic.co/u/kimchy)\
**Post date:** [April 7, 2012, 3:27pm UTC](https://discuss.elastic.co/t/index-time-boost-in-multi-valued-fields/7256/2 "2012-04-07T15:27:31Z")

</div>

There are downsides to it, for example, if its stored explicitly, or when  
one does nested mappings, or faceting on the fields, or having them not  
analyzed. In any case, its not planned to automatically concatenate the  
values of multi valued fields into a single one.

On Fri, Apr 6, 2012 at 10:37 PM, Matthew A. Brown [mat.a.brown@gmail.com](mailto:mat.a.brown@gmail.com)wrote:

> I came across some pretty crazy scoring behavior recently, where  
> certain matches on a field boosted at index-time had enormously high  
> field norms. After some illuminating discussion on the #lucene  
> channel, I tracked it down to this little nugget:
> 
> "The boost is multiplied by Document.getBoost() of the document  
> containing this field. If a document has multiple fields with the same  
> name, all such values are multiplied together. This product is then  
> used to compute the norm factor for the field."  
> (source:  
> [AbstractField (Lucene 3.5.0 API)](http://lucene.apache.org/core/old_versioned_docs/versions/3_5_0/api/core/org/apache/lucene/document/AbstractField.html#setBoost%28float%29)  
> )
> 
> So basically the index-time boost you specify is taken to the power of  
> the number of values in the field!
> 
> Since the whole concept of multi-valued field is more or less just  
> sugar in Lucene, might it make more sense for ES to take care of  
> concatenating the values in multi-valued fields and passing them as a  
> single value to Lucene? This would make the index-time boost behavior  
> better and I don't really see a downside.
> 
> Just a thought!
> 
> Mat

---

<div class="post-metadata">

**Author:** ![Matthew\_Schulkind](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/matthew_schulkind/32/2840_2.png) [@Matthew\_Schulkind](https://discuss.elastic.co/u/Matthew_Schulkind)\
**Post date:** [June 21, 2012, 10:50pm UTC](https://discuss.elastic.co/t/index-time-boost-in-multi-valued-fields/7256/3 "2012-06-21T22:50:01Z")

</div>

Is there any way to work around this? I'd like to be able to set the boost  
for if one of the multiple values match, but not have it depend on the  
number of values for the field.

On Saturday, April 7, 2012 11:27:31 AM UTC-4, kimchy wrote:

> There are downsides to it, for example, if its stored explicitly, or when  
> one does nested mappings, or faceting on the fields, or having them not  
> analyzed. In any case, its not planned to automatically concatenate the  
> values of multi valued fields into a single one.
> 
> On Fri, Apr 6, 2012 at 10:37 PM, Matthew A. Brown [mat.a.brown@gmail.com](mailto:mat.a.brown@gmail.com)wrote:
> 
> > I came across some pretty crazy scoring behavior recently, where  
> > certain matches on a field boosted at index-time had enormously high  
> > field norms. After some illuminating discussion on the #lucene  
> > channel, I tracked it down to this little nugget:
> > 
> > "The boost is multiplied by Document.getBoost() of the document  
> > containing this field. If a document has multiple fields with the same  
> > name, all such values are multiplied together. This product is then  
> > used to compute the norm factor for the field."  
> > (source:  
> > [AbstractField (Lucene 3.5.0 API)](http://lucene.apache.org/core/old_versioned_docs/versions/3_5_0/api/core/org/apache/lucene/document/AbstractField.html#setBoost%28float%29)  
> > )
> > 
> > So basically the index-time boost you specify is taken to the power of  
> > the number of values in the field!
> > 
> > Since the whole concept of multi-valued field is more or less just  
> > sugar in Lucene, might it make more sense for ES to take care of  
> > concatenating the values in multi-valued fields and passing them as a  
> > single value to Lucene? This would make the index-time boost behavior  
> > better and I don't really see a downside.
> > 
> > Just a thought!
> > 
> > Mat

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [July 6, 2017, 3:23am UTC](https://discuss.elastic.co/t/index-time-boost-in-multi-valued-fields/7256/4 "2017-07-06T03:23:00Z")

</div>


