# Elasticsearch relevance

**URL:** <https://discuss.elastic.co/t/elasticsearch-relevance/20742>\
**Category:** Elasticsearch\
**Created:** [November 14, 2014, 2:24am UTC](https://discuss.elastic.co/t/elasticsearch-relevance/20742 "2014-11-14T02:24:53Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Fadel\_Chafai](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/fadel_chafai/32/1105_2.png) [@Fadel\_Chafai](https://discuss.elastic.co/u/Fadel_Chafai)\
**Post date:** [November 14, 2014, 2:24am UTC](https://discuss.elastic.co/t/elasticsearch-relevance/20742/1 "2014-11-14T02:24:53Z")

</div>

Hi,

with this simple query :

{  
"query": {  
"match": {  
"title": "world"  
}  
}  
}

i have two results :

1 - "title": "Goodbye World FRENCH", with "\_score": 2.7005801,  
2 - "title": "World War Z TRUEFRENCH", with "\_score": 2.6142232,

the second title (World War Z TRUEFRENCH) start with the word _World_ but  
it have not the higher score. i think if the title start with the searched  
world it must have more relevance ?

My analyze for the description filed:

"analyzer": {  
"custom\_french\_analyzer": {  
"tokenizer": "letter",  
"filter": ["asciifolding", "lowercase", "french\_stem", "elision",  
"stop"]  
},

Thanks,

--  
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/9a9de9a1-68c0-4d20-a6ee-cf0c7f5f4e61%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/9a9de9a1-68c0-4d20-a6ee-cf0c7f5f4e61%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![D\_Carpeneto](https://avatars.discourse-cdn.com/v4/letter/d/db5fbb/32.png) [@D\_Carpeneto](https://discuss.elastic.co/u/D_Carpeneto)\
**Post date:** [November 14, 2014, 11:00pm UTC](https://discuss.elastic.co/t/elasticsearch-relevance/20742/2 "2014-11-14T23:00:45Z")

</div>

I _think_ that the length of the field impacts the score (at least that was  
the case last time I used Lucene, which is what's underneath  
elasticsearch). The second entry is longer.

--  
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/40620a05-0e7a-4ad5-80e0-4ebb574bdf48%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/40620a05-0e7a-4ad5-80e0-4ebb574bdf48%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![vineeth\_mohan\_2](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/vineeth_mohan_2/32/747_2.png) [@vineeth\_mohan\_2](https://discuss.elastic.co/u/vineeth_mohan_2)\
**Post date:** [November 16, 2014, 2:49pm UTC](https://discuss.elastic.co/t/elasticsearch-relevance/20742/3 "2014-11-16T14:49:45Z")

</div>

Hello ,

The score is impacted by TF , IDF and the field length. -

> **[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.

You need to write a small script to compute this logic via function score  
query.

Thanks  
Vineeth

On Fri, Nov 14, 2014 at 7:54 AM, Fadel Chafai [fadelmohamed@gmail.com](mailto:fadelmohamed@gmail.com)  
wrote:

> Hi,
> 
> with this simple query :
> 
> {  
> "query": {  
> "match": {  
> "title": "world"  
> }  
> }  
> }
> 
> i have two results :
> 
> 1 - "title": "Goodbye World FRENCH", with "\_score": 2.7005801,  
> 2 - "title": "World War Z TRUEFRENCH", with "\_score": 2.6142232,
> 
> the second title (World War Z TRUEFRENCH) start with the word _World_ but  
> it have not the higher score. i think if the title start with the searched  
> world it must have more relevance ?
> 
> My analyze for the description filed:
> 
> "analyzer": {  
> "custom\_french\_analyzer": {  
> "tokenizer": "letter",  
> "filter": ["asciifolding", "lowercase", "french\_stem",  
> "elision", "stop"]  
> },
> 
> Thanks,
> 
> --  
> 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/9a9de9a1-68c0-4d20-a6ee-cf0c7f5f4e61%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/9a9de9a1-68c0-4d20-a6ee-cf0c7f5f4e61%40googlegroups.com)  
> [https://groups.google.com/d/msgid/elasticsearch/9a9de9a1-68c0-4d20-a6ee-cf0c7f5f4e61%40googlegroups.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/9a9de9a1-68c0-4d20-a6ee-cf0c7f5f4e61%40googlegroups.com?utm_medium=email&utm_source=footer)  
> .  
> For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

--  
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/CAGdPd5%3DmXLdO9Ka%3DWOz1jFMQsCr9tBCZiKYBocvtL01xN5NZUA%40mail.gmail.com](https://groups.google.com/d/msgid/elasticsearch/CAGdPd5%3DmXLdO9Ka%3DWOz1jFMQsCr9tBCZiKYBocvtL01xN5NZUA%40mail.gmail.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![Fadel\_Chafai\_2](https://avatars.discourse-cdn.com/v4/letter/f/22d042/32.png) [@Fadel\_Chafai\_2](https://discuss.elastic.co/u/Fadel_Chafai_2)\
**Post date:** [November 16, 2014, 2:53pm UTC](https://discuss.elastic.co/t/elasticsearch-relevance/20742/4 "2014-11-16T14:53:23Z")

</div>

thank you for your response

On Sun, Nov 16, 2014 at 2:49 PM, vineeth mohan [vm.vineethmohan@gmail.com](mailto:vm.vineethmohan@gmail.com)  
wrote:

> Hello ,
> 
> The score is impacted by TF , IDF and the field length. -  
> [Elasticsearch Platform — Find real-time answers at scale | Elastic](http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/modules-advanced-scripting.html)  
> You need to write a small script to compute this logic via function score  
> query.
> 
> Thanks  
> Vineeth
> 
> On Fri, Nov 14, 2014 at 7:54 AM, Fadel Chafai [fadelmohamed@gmail.com](mailto:fadelmohamed@gmail.com)  
> wrote:
> 
> > Hi,
> > 
> > with this simple query :
> > 
> > {  
> > "query": {  
> > "match": {  
> > "title": "world"  
> > }  
> > }  
> > }
> > 
> > i have two results :
> > 
> > 1 - "title": "Goodbye World FRENCH", with "\_score": 2.7005801,  
> > 2 - "title": "World War Z TRUEFRENCH", with "\_score": 2.6142232,
> > 
> > the second title (World War Z TRUEFRENCH) start with the word _World_  
> > but it have not the higher score. i think if the title start with the  
> > searched world it must have more relevance ?
> > 
> > My analyze for the description filed:
> > 
> > "analyzer": {  
> > "custom\_french\_analyzer": {  
> > "tokenizer": "letter",  
> > "filter": ["asciifolding", "lowercase", "french\_stem",  
> > "elision", "stop"]  
> > },
> > 
> > Thanks,
> > 
> > --  
> > 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/9a9de9a1-68c0-4d20-a6ee-cf0c7f5f4e61%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/9a9de9a1-68c0-4d20-a6ee-cf0c7f5f4e61%40googlegroups.com)  
> > [https://groups.google.com/d/msgid/elasticsearch/9a9de9a1-68c0-4d20-a6ee-cf0c7f5f4e61%40googlegroups.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/9a9de9a1-68c0-4d20-a6ee-cf0c7f5f4e61%40googlegroups.com?utm_medium=email&utm_source=footer)  
> > .  
> > For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).
> 
> --  
> You received this message because you are subscribed to a topic in the  
> Google Groups "elasticsearch" group.  
> To unsubscribe from this topic, visit  
> [https://groups.google.com/d/topic/elasticsearch/yde90jdKEwQ/unsubscribe](https://groups.google.com/d/topic/elasticsearch/yde90jdKEwQ/unsubscribe).  
> To unsubscribe from this group and all its topics, 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/CAGdPd5%3DmXLdO9Ka%3DWOz1jFMQsCr9tBCZiKYBocvtL01xN5NZUA%40mail.gmail.com](https://groups.google.com/d/msgid/elasticsearch/CAGdPd5%3DmXLdO9Ka%3DWOz1jFMQsCr9tBCZiKYBocvtL01xN5NZUA%40mail.gmail.com)  
> [https://groups.google.com/d/msgid/elasticsearch/CAGdPd5%3DmXLdO9Ka%3DWOz1jFMQsCr9tBCZiKYBocvtL01xN5NZUA%40mail.gmail.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/CAGdPd5%3DmXLdO9Ka%3DWOz1jFMQsCr9tBCZiKYBocvtL01xN5NZUA%40mail.gmail.com?utm_medium=email&utm_source=footer)  
> .
> 
> For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

--

_ü_ _Before you print it, think about the environment!_

--  
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/CAAst4SSFie\_QSDsewqB9UDLZaE6%2BY82jwWy20ZZky\_UnDCe8Og%40mail.gmail.com](https://groups.google.com/d/msgid/elasticsearch/CAAst4SSFie_QSDsewqB9UDLZaE6%2BY82jwWy20ZZky_UnDCe8Og%40mail.gmail.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<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, 12:49am UTC](https://discuss.elastic.co/t/elasticsearch-relevance/20742/5 "2017-07-06T00:49:47Z")

</div>


