# Scoring on a multi\_field

**URL:** <https://discuss.elastic.co/t/scoring-on-a-multi-field/13776>\
**Category:** Elasticsearch\
**Created:** [September 26, 2013, 8:48pm UTC](https://discuss.elastic.co/t/scoring-on-a-multi-field/13776 "2013-09-26T20:48:27Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Alan\_Jurgensen](https://avatars.discourse-cdn.com/v4/letter/a/b487fb/32.png) [@Alan\_Jurgensen](https://discuss.elastic.co/u/Alan_Jurgensen)\
**Post date:** [September 26, 2013, 8:48pm UTC](https://discuss.elastic.co/t/scoring-on-a-multi-field/13776/1 "2013-09-26T20:48:27Z")

</div>

I have a multi\_field where I stash the name several ways: asis, standard,  
phonetic, nicknames

am trying to use multi-match to search the name with specific boosts per  
name type.  
However my search score seems to only use the highest scoring sub-fields  
score.  
Want to get them summed....

Is there any way I can get them summed for my final score? Something akin  
to: score\_mode=sum ...

Here's full context of index and search attempts:  
[https://gist.github.com/jurgynet/6720252](https://gist.github.com/jurgynet/6720252)

AJ

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![Alexander\_Ott](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/alexander_ott/32/105905_2.png) [@Alexander\_Ott](https://discuss.elastic.co/u/Alexander_Ott)\
**Post date:** [February 11, 2014, 9:15am UTC](https://discuss.elastic.co/t/scoring-on-a-multi-field/13776/2 "2014-02-11T09:15:44Z")

</div>

Hallo,

i have the same problem if i send a query like this

"query" : {

```
    "query_string" : {
    "query" : "someText",
    "fields": ["field1", "field2", "field3"]

```

}

The explain will always show _"description": "max of:"_

"\_explanation": {  
"value": 20,  
"description": "max of:",  
"details": [  
{  
"value": 3,  
"description": "weight(\_field1:someText in 18415)  
[PerFieldSimilarity], result of:",  
"details": [  
{  
"value": 3,  
"description": "fieldWeight in 18415, product  
of:",  
"details": [  
{  
"value": 3,  
"description": "tf(freq=3.0), with freq  
of:",  
"details": [  
{  
"value": 3,  
"description": "termFreq=3.0"  
}  
]  
},  
{  
"value": 1,  
"description": "idf(docFreq=36,  
maxDocs=84821)"  
},  
{  
"value": 1,  
"description": "fieldNorm(doc=18415)"  
}  
]  
}  
]  
},  
{  
"value": 20,  
"description": "weight(field2:someText in 18415)  
[PerFieldSimilarity], result of:",  
"details": [  
{  
"value": 20,  
"description": "fieldWeight in 18415, product  
of:",  
"details": [  
{  
"value": 2,  
"description": "tf(freq=2.0), with freq  
of:",  
"details": [  
{  
"value": 2,  
"description": "termFreq=2.0"  
}  
]  
},  
{  
"value": 1,  
"description": "idf(docFreq=10,  
maxDocs=84821)"  
},  
{  
"value": 10,  
"description": "fieldNorm(doc=18415)"  
}  
]  
}  
]  
},  
{  
"value": 4,  
"description": "weight(field3:someText in 18415)  
[PerFieldSimilarity], result of:",  
"details": [  
{  
"value": 4,  
"description": "fieldWeight in 18415, product  
of:",  
"details": [  
{  
"value": 1,  
"description": "tf(freq=1.0), with freq  
of:",  
"details": [  
{  
"value": 1,  
"description": "termFreq=1.0"  
}  
]  
},  
{  
"value": 1,  
"description": "idf(docFreq=12,  
maxDocs=84821)"  
},  
{  
"value": 4,  
"description": "fieldNorm(doc=18415)"  
}  
]  
}  
]  
}  
]  
}

Is it possible to use "sum of" for final score instead of "max of" ?

Greetings,  
Alex

Am Donnerstag, 26. September 2013 22:48:27 UTC+2 schrieb Alan Jurgensen:

> I have a multi\_field where I stash the name several ways: asis, standard,  
> phonetic, nicknames
> 
> am trying to use multi-match to search the name with specific boosts per  
> name type.  
> However my search score seems to only use the highest scoring sub-fields  
> score.  
> Want to get them summed....
> 
> Is there any way I can get them summed for my final score? Something akin  
> to: score\_mode=sum ...
> 
> Here's full context of index and search attempts:  
> [Elastic search name testing: standard, asis, phonetic, nickname · GitHub](https://gist.github.com/jurgynet/6720252)
> 
> AJ

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/de64eb8f-33ea-4d5e-9ffa-34aa40d9a928%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/de64eb8f-33ea-4d5e-9ffa-34aa40d9a928%40googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![Ivan](https://avatars.discourse-cdn.com/v4/letter/i/df788c/32.png) [@Ivan](https://discuss.elastic.co/u/Ivan)\
**Post date:** [February 11, 2014, 5:12pm UTC](https://discuss.elastic.co/t/scoring-on-a-multi-field/13776/3 "2014-02-11T17:12:38Z")

</div>

Try setting use\_dis\_max to false in your query.

> **[Elasticsearch Platform — Find real-time answers at scale](https://www.elastic.co)**
>
> Power insights and outcomes with the Elasticsearch Platform and AI. See into your data and find answers that matter with enterprise solutions designed to help you build, observe, and protect. Try Elasticsearch free today.

Cheers,

Ivan

On Tue, Feb 11, 2014 at 1:15 AM, Alexander Ott  
[alexander.ott.85@gmail.com](mailto:alexander.ott.85@gmail.com)wrote:

> Hallo,
> 
> i have the same problem if i send a query like this
> 
> "query" : {
> 
> ```
> "query_string" : {
> "query" : "someText",
> "fields": ["field1", "field2", "field3"]
> 
> ```
> 
> }
> 
> The explain will always show _"description": "max of:"_
> 
> "\_explanation": {  
> "value": 20,  
> "description": "max of:",  
> "details": [  
> {  
> "value": 3,  
> "description": "weight(\_field1:someText in 18415)  
> [PerFieldSimilarity], result of:",  
> "details": [  
> {  
> "value": 3,  
> "description": "fieldWeight in 18415, product  
> of:",  
> "details": [  
> {  
> "value": 3,  
> "description": "tf(freq=3.0), with freq  
> of:",  
> "details": [  
> {  
> "value": 3,  
> "description": "termFreq=3.0"  
> }  
> ]  
> },  
> {  
> "value": 1,  
> "description": "idf(docFreq=36,  
> maxDocs=84821)"  
> },  
> {  
> "value": 1,  
> "description": "fieldNorm(doc=18415)"  
> }  
> ]  
> }  
> ]  
> },  
> {  
> "value": 20,  
> "description": "weight(field2:someText in 18415)  
> [PerFieldSimilarity], result of:",  
> "details": [  
> {  
> "value": 20,  
> "description": "fieldWeight in 18415, product  
> of:",  
> "details": [  
> {  
> "value": 2,  
> "description": "tf(freq=2.0), with freq  
> of:",  
> "details": [  
> {  
> "value": 2,  
> "description": "termFreq=2.0"  
> }  
> ]  
> },  
> {  
> "value": 1,  
> "description": "idf(docFreq=10,  
> maxDocs=84821)"  
> },  
> {  
> "value": 10,  
> "description": "fieldNorm(doc=18415)"  
> }  
> ]  
> }  
> ]  
> },  
> {  
> "value": 4,  
> "description": "weight(field3:someText in 18415)  
> [PerFieldSimilarity], result of:",  
> "details": [  
> {  
> "value": 4,  
> "description": "fieldWeight in 18415, product  
> of:",  
> "details": [  
> {  
> "value": 1,  
> "description": "tf(freq=1.0), with freq  
> of:",  
> "details": [  
> {  
> "value": 1,  
> "description": "termFreq=1.0"  
> }  
> ]  
> },  
> {  
> "value": 1,  
> "description": "idf(docFreq=12,  
> maxDocs=84821)"  
> },  
> {  
> "value": 4,  
> "description": "fieldNorm(doc=18415)"  
> }  
> ]  
> }  
> ]  
> }  
> ]  
> }
> 
> Is it possible to use "sum of" for final score instead of "max of" ?
> 
> Greetings,  
> Alex
> 
> Am Donnerstag, 26. September 2013 22:48:27 UTC+2 schrieb Alan Jurgensen:
> 
> > I have a multi\_field where I stash the name several ways: asis,  
> > standard, phonetic, nicknames
> > 
> > am trying to use multi-match to search the name with specific boosts per  
> > name type.  
> > However my search score seems to only use the highest scoring sub-fields  
> > score.  
> > Want to get them summed....
> > 
> > Is there any way I can get them summed for my final score? Something akin  
> > to: score\_mode=sum ...
> > 
> > Here's full context of index and search attempts:  
> > [Elastic search name testing: standard, asis, phonetic, nickname · GitHub](https://gist.github.com/jurgynet/6720252)
> > 
> > AJ
> 
> --  
> You received this message because you are subscribed to the Google Groups  
> "elasticsearch" group.  
> To unsubscribe from this group and stop receiving emails from it, send an  
> email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
> To view this discussion on the web visit  
> [https://groups.google.com/d/msgid/elasticsearch/de64eb8f-33ea-4d5e-9ffa-34aa40d9a928%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/de64eb8f-33ea-4d5e-9ffa-34aa40d9a928%40googlegroups.com)  
> .
> 
> For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/CALY%3DcQCVxsNepqwwNsdbvUzPRjJg10fFHK3u-sit4XZ\_X8AOgw%40mail.gmail.com](https://groups.google.com/d/msgid/elasticsearch/CALY%3DcQCVxsNepqwwNsdbvUzPRjJg10fFHK3u-sit4XZ_X8AOgw%40mail.gmail.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![Binh\_Ly](https://avatars.discourse-cdn.com/v4/letter/b/ce7236/32.png) [@Binh\_Ly](https://discuss.elastic.co/u/Binh_Ly)\
**Post date:** [February 11, 2014, 5:12pm UTC](https://discuss.elastic.co/t/scoring-on-a-multi-field/13776/4 "2014-02-11T17:12:48Z")

</div>

This will be addressed better in the future. For now, you can split/rewrite  
your multi\_match query into a bool query with multiple should clauses where  
each clause is targeting each field in your multi\_match (or query\_string)  
query. This still won't be quite a "sum", but at least it will "combine"  
all the should clauses to produce the final score (i.e. the more matches  
you have for each should clause, the higher the score will be).

In the future, the multi\_match query will provide a type where you can  
specify how the score is influenced based on field matches.

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/e47f9a0a-5f19-4fd6-9854-9c15cd67e177%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/e47f9a0a-5f19-4fd6-9854-9c15cd67e177%40googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<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, 1:51am UTC](https://discuss.elastic.co/t/scoring-on-a-multi-field/13776/5 "2017-07-06T01:51:00Z")

</div>


