# Question about scoring

**URL:** <https://discuss.elastic.co/t/question-about-scoring/4466>\
**Category:** Elasticsearch\
**Created:** [May 24, 2011, 7:19am UTC](https://discuss.elastic.co/t/question-about-scoring/4466 "2011-05-24T07:19:37Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Alexandre\_Heimburger](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/alexandre_heimburger/32/2941_2.png) [@Alexandre\_Heimburger](https://discuss.elastic.co/u/Alexandre_Heimburger)\
**Post date:** [May 24, 2011, 7:19am UTC](https://discuss.elastic.co/t/question-about-scoring/4466/1 "2011-05-24T07:19:37Z")

</div>

Hi there,

I build an index containing documents from different types : user, space,  
content etc....The type is a field of the index.

_First question_

Is that possible to configure to index to get a better score if a query  
match an object of a given type ?

Example : if I search 'Doe' on document titles, the user 'John Doe' should  
have a better score that a blog entry named 'Jonh Doe was the first man to  
land on the moon'.

_Second question_

If the scoring 'by type' is not possible, do ES enable us to give a better  
score depending on the word distribution.

Example : if I search 'Doe' on document titles, the document 'John Doe'  
should be more pertinent than the document 'Jonh Doe was the first man to  
land on the moon' because for the first one, the search term represents 50%  
of the words.

Am I clear ?

Thanks for your help.

---

<div class="post-metadata">

**Author:** ![lecochien](https://avatars.discourse-cdn.com/v4/letter/l/48db29/32.png) [@lecochien](https://discuss.elastic.co/u/lecochien)\
**Post date:** [May 24, 2011, 10:02am UTC](https://discuss.elastic.co/t/question-about-scoring/4466/2 "2011-05-24T10:02:14Z")

</div>

Hi,  
of course you are clear.  
There is differents solutions to achieve what you want to do :  
If you want to boost your document on certains fields you can use the  
boost argument inside your term 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.

(there is an opened issue with an exemple [Query boost not applied to numeric fields · Issue #943 · elastic/elasticsearch · GitHub](https://github.com/elasticsearch/elasticsearch/issues/943))  
or add a little script who check fields for boosting result.  
[Elasticsearch Platform — Find real-time answers at scale | Elastic](http://www.elasticsearch.org/guide/reference/query-dsl/custom-score-query.html)

On 24 mai, 09:19, Alexandre Heimburger [alexheimbur...@gmail.com](mailto:alexheimbur...@gmail.com)  
wrote:

> Hi there,
> 
> I build an index containing documents from different types : user, space,  
> content etc....The type is a field of the index.
> 
> _First question_
> 
> Is that possible to configure to index to get a better score if a query  
> match an object of a given type ?
> 
> Example : if I search 'Doe' on document titles, the user 'John Doe' should  
> have a better score that a blog entry named 'Jonh Doe was the first man to  
> land on the moon'.
> 
> _Second question_
> 
> If the scoring 'by type' is not possible, do ES enable us to give a better  
> score depending on the word distribution.
> 
> Example : if I search 'Doe' on document titles, the document 'John Doe'  
> should be more pertinent than the document 'Jonh Doe was the first man to  
> land on the moon' because for the first one, the search term represents 50%  
> of the words.
> 
> Am I clear ?
> 
> Thanks for your help.

---

<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:** [May 24, 2011, 2:30pm UTC](https://discuss.elastic.co/t/question-about-scoring/4466/3 "2011-05-24T14:30:35Z")

</div>

Another option is to boost certain fields at indexing time. You can set boost in the mapping, or within the doc. See: [Elasticsearch Platform — Find real-time answers at scale | Elastic](http://www.elasticsearch.org/guide/reference/mapping/core-types.html).  
On Tuesday, May 24, 2011 at 1:02 PM, lecochien wrote:

> Hi,  
> of course you are clear.  
> There is differents solutions to achieve what you want to do :  
> If you want to boost your document on certains fields you can use the  
> boost argument inside your term query  
> [Elasticsearch Platform — Find real-time answers at scale | Elastic](http://www.elasticsearch.org/guide/reference/query-dsl/term-query.html)  
> (there is an opened issue with an exemple [Query boost not applied to numeric fields · Issue #943 · elastic/elasticsearch · GitHub](https://github.com/elasticsearch/elasticsearch/issues/943))  
> or add a little script who check fields for boosting result.  
> [Elasticsearch Platform — Find real-time answers at scale | Elastic](http://www.elasticsearch.org/guide/reference/query-dsl/custom-score-query.html)
> 
> On 24 mai, 09:19, Alexandre Heimburger [alexheimbur...@gmail.com](mailto:alexheimbur...@gmail.com)  
> wrote:
> 
> > Hi there,
> > 
> > I build an index containing documents from different types : user, space,  
> > content etc....The type is a field of the index.
> > 
> > _First question_
> > 
> > Is that possible to configure to index to get a better score if a query  
> > match an object of a given type ?
> > 
> > Example : if I search 'Doe' on document titles, the user 'John Doe' should  
> > have a better score that a blog entry named 'Jonh Doe was the first man to  
> > land on the moon'.
> > 
> > _Second question_
> > 
> > If the scoring 'by type' is not possible, do ES enable us to give a better  
> > score depending on the word distribution.
> > 
> > Example : if I search 'Doe' on document titles, the document 'John Doe'  
> > should be more pertinent than the document 'Jonh Doe was the first man to  
> > land on the moon' because for the first one, the search term represents 50%  
> > of the words.
> > 
> > Am I clear ?
> > 
> > Thanks for your help.

---

<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, 4:05am UTC](https://discuss.elastic.co/t/question-about-scoring/4466/4 "2017-07-06T04:05:28Z")

</div>


