# Search score

**URL:** <https://discuss.elastic.co/t/search-score/8589>\
**Category:** Elasticsearch\
**Created:** [July 31, 2012, 9:51pm UTC](https://discuss.elastic.co/t/search-score/8589 "2012-07-31T21:51:37Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Honjoya](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/honjoya/32/2576_2.png) [@Honjoya](https://discuss.elastic.co/u/Honjoya)\
**Post date:** [July 31, 2012, 9:51pm UTC](https://discuss.elastic.co/t/search-score/8589/1 "2012-07-31T21:51:37Z")

</div>

Hi, i am beginner in elasticsearch, and have a doubt:  
i am doing one search but the result not is much relevent.

I search "notebook" , but the document with " Bag black for notebook" is  
not last item in result.... but this should be the last record because not  
it begins with the word "notebook"

somebody have a solutions?

Thanks

example:

[http://localhost:9200/teste/ofertas/\_search/](http://localhost:9200/teste/ofertas/_search/) -d

"{  
"query": {  
"term": {  
"name": "notebook"  
}  
}  
}"

my result:

{  
took: 4  
timed\_out: false  
\_shards: { total: 5successful: 5failed: 0}  
hits: {  
total: 6  
max\_score: 4.232868  
hits: [  
{  
\_index: teste  
\_type: ofertas  
\_id: 3  
\_score: 4.232868  
\_source: {  
name: Notebook ACER mod 1862  
}  
}  
{  
\_index: teste  
\_type: ofertas  
\_id: 2  
\_score: 3.5136628  
\_source: {  
nome: HP pavillion notebook  
}  
}  
{  
\_index: teste  
\_type: ofertas  
\_id: 1  
\_score: 3.2192051  
\_source: {  
name: Notebook dell inspirion  
}  
}  
{  
\_index: teste  
\_type: ofertas  
\_id: 6  
\_score: 3.2192051  
\_source: {  
name: Bag black for notebook  
}  
}  
{  
\_index: teste  
\_type: ofertas  
\_id: 4  
\_score: 2.5  
\_source: {  
name: Acer Notebook serie gammer  
}  
}  
{  
\_index: teste  
\_type: ofertas  
\_id: 5  
\_score: 2.4748738  
\_source: {  
name: Notebook dell inspiriom 1525 the better notebook  
}  
}  
]  
}  
}

---

<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:** [July 31, 2012, 10:20pm UTC](https://discuss.elastic.co/t/search-score/8589/2 "2012-07-31T22:20:42Z")

</div>

Elasticsearch is based on Lucene, so the concepts of scoring are the  
same. Review them for a better understanding.

Turn on "explain" to understand why the documents are scored in the  
way they are. The document for "Bag black for notebook" (6) scores  
higher than the one for "Acer Notebook serie gammer". (4) Why? My  
guess is term frequencies. Documents with fewer overall terms score  
higher when using TDIDF scoring. "For" is a stopword, so document 6  
only has 3 terms. Document 1 has the same score and number of terms.  
Word position has no relevance with standard queries.

Here are some definitions for terms in Lucene:

> **[Home](https://lucidworks.com/)**
>
> Lucidworks' Fusion platform uses industry-leading search technology to power search & discovery for the largest & most successful companies. Request a demo today.

Cheers,

Ivan

On Tue, Jul 31, 2012 at 2:51 PM, elasticSearchUserBeginner  
[ti.honjoya@gmail.com](mailto:ti.honjoya@gmail.com) wrote:

> Hi, i am beginner in elasticsearch, and have a doubt:  
> i am doing one search but the result not is much relevent.
> 
> I search "notebook" , but the document with " Bag black for notebook" is  
> not last item in result.... but this should be the last record because not  
> it begins with the word "notebook"
> 
> somebody have a solutions?
> 
> Thanks
> 
> example:
> 
> [http://localhost:9200/teste/ofertas/\_search/](http://localhost:9200/teste/ofertas/_search/) -d
> 
> "{  
> "query": {  
> "term": {  
> "name": "notebook"  
> }  
> }  
> }"
> 
> my result:
> 
> {  
> took: 4  
> timed\_out: false  
> \_shards: { total: 5successful: 5failed: 0}  
> hits: {  
> total: 6  
> max\_score: 4.232868  
> hits: [  
> {  
> \_index: teste  
> \_type: ofertas  
> \_id: 3  
> \_score: 4.232868  
> \_source: {  
> name: Notebook ACER mod 1862  
> }  
> }  
> {  
> \_index: teste  
> \_type: ofertas  
> \_id: 2  
> \_score: 3.5136628  
> \_source: {  
> nome: HP pavillion notebook  
> }  
> }  
> {  
> \_index: teste  
> \_type: ofertas  
> \_id: 1  
> \_score: 3.2192051  
> \_source: {  
> name: Notebook dell inspirion  
> }  
> }  
> {  
> \_index: teste  
> \_type: ofertas  
> \_id: 6  
> \_score: 3.2192051  
> \_source: {  
> name: Bag black for notebook  
> }  
> }  
> {  
> \_index: teste  
> \_type: ofertas  
> \_id: 4  
> \_score: 2.5  
> \_source: {  
> name: Acer Notebook serie gammer  
> }  
> }  
> {  
> \_index: teste  
> \_type: ofertas  
> \_id: 5  
> \_score: 2.4748738  
> \_source: {  
> name: Notebook dell inspiriom 1525 the better notebook  
> }  
> }  
> ]  
> }  
> }

---

<div class="post-metadata">

**Author:** ![Vinicius\_Carvalho](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/vinicius_carvalho/32/770_2.png) [@Vinicius\_Carvalho](https://discuss.elastic.co/u/Vinicius_Carvalho)\
**Post date:** [July 31, 2012, 10:22pm UTC](https://discuss.elastic.co/t/search-score/8589/3 "2012-07-31T22:22:17Z")

</div>

Does not work like that.

First, send some information on your mapping and indexing configuration  
(what analyzer you used for the fields)

Starting with a word does not mean that it will get a higher score (maybe  
if you use some sort of query with positional information, but I'm just  
guessing here). Have a look  
on [Apache Lucene - Scoring](http://lucene.apache.org/core/3_6_0/scoring.html) to have an idea how  
scoring works.

Regards

On Tuesday, July 31, 2012 5:51:37 PM UTC-4, elasticSearchUserBeginner wrote:

> Hi, i am beginner in elasticsearch, and have a doubt:  
> i am doing one search but the result not is much relevent.
> 
> I search "notebook" , but the document with " Bag black for notebook" is  
> not last item in result.... but this should be the last record because not  
> it begins with the word "notebook"
> 
> somebody have a solutions?
> 
> Thanks
> 
> example:
> 
> [http://localhost:9200/teste/ofertas/\_search/](http://localhost:9200/teste/ofertas/_search/) -d
> 
> "{  
> "query": {  
> "term": {  
> "name": "notebook"  
> }  
> }  
> }"
> 
> my result:
> 
> {  
> took: 4  
> timed\_out: false  
> \_shards: { total: 5successful: 5failed: 0}  
> hits: {  
> total: 6  
> max\_score: 4.232868  
> hits: [  
> {  
> \_index: teste  
> \_type: ofertas  
> \_id: 3  
> \_score: 4.232868  
> \_source: {  
> name: Notebook ACER mod 1862  
> }  
> }  
> {  
> \_index: teste  
> \_type: ofertas  
> \_id: 2  
> \_score: 3.5136628  
> \_source: {  
> nome: HP pavillion notebook  
> }  
> }  
> {  
> \_index: teste  
> \_type: ofertas  
> \_id: 1  
> \_score: 3.2192051  
> \_source: {  
> name: Notebook dell inspirion  
> }  
> }  
> {  
> \_index: teste  
> \_type: ofertas  
> \_id: 6  
> \_score: 3.2192051  
> \_source: {  
> name: Bag black for notebook  
> }  
> }  
> {  
> \_index: teste  
> \_type: ofertas  
> \_id: 4  
> \_score: 2.5  
> \_source: {  
> name: Acer Notebook serie gammer  
> }  
> }  
> {  
> \_index: teste  
> \_type: ofertas  
> \_id: 5  
> \_score: 2.4748738  
> \_source: {  
> name: Notebook dell inspiriom 1525 the better notebook  
> }  
> }  
> ]  
> }  
> }

---

<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:18am UTC](https://discuss.elastic.co/t/search-score/8589/4 "2017-07-06T03:18:12Z")

</div>


