# Problem with scores in a Match\_all query

**URL:** <https://discuss.elastic.co/t/problem-with-scores-in-a-match-all-query/10280>\
**Category:** Elasticsearch\
**Created:** [January 9, 2013, 3:13pm UTC](https://discuss.elastic.co/t/problem-with-scores-in-a-match-all-query/10280 "2013-01-09T15:13:12Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Diego\_Alejandro\_Gara](https://avatars.discourse-cdn.com/v4/letter/d/3be4f8/32.png) [@Diego\_Alejandro\_Gara](https://discuss.elastic.co/u/Diego_Alejandro_Gara)\
**Post date:** [January 9, 2013, 3:13pm UTC](https://discuss.elastic.co/t/problem-with-scores-in-a-match-all-query/10280/1 "2013-01-09T15:13:12Z")

</div>

Hi

I am very newbie on ElasticSearch and I have a basic problem, I have a the  
follow instructions

curl -XGET localhost:9200/twitter/script/\_search?pretty=true -d '  
{  
"from": 0,  
"size": 80,  
"sort": {  
"\_score": "desc"  
},  
"facets": {  
"category": {  
"terms": {  
"field": "category\_description\_untouched"  
}  
},  
"postal\_code": {  
"terms": {  
"field": "postal\_code\_untouched"  
}  
},  
"county": {  
"terms": {  
"field": "county\_untouched"  
}  
},  
"listing\_type": {  
"terms": {  
"field": "listing\_type\_untouched"  
}  
},  
"address\_type": {  
"terms": {  
"field": "address\_type\_untouched"  
}  
}  
},  
"query": {  
"filtered": {  
"query": {  
"query\_string": {  
"query": "taxi",  
"default\_field": "name",  
"default\_operator": "and"  
}  
},  
"filter": {  
"and": {  
"filters": [  
{  
"or": {  
"filters": [  
{  
"geo\_distance": {  
"distance": "20km",  
"position": "52.630885,  
1.297355"  
}  
},  
{  
"fquery": {  
"query": {  
"text": {  
"national\_listing": {  
"query": "true"  
}  
}  
}  
}  
}  
]  
}  
},  
{  
"fquery": {  
"query": {  
"filtered": {  
"query": {  
"query\_string": {  
"query": "700",  
"default\_field":  
"listings.listing\_categories.category\_code",  
"default\_operator": "and"  
}  
}  
}  
}  
}  
},  
{  
"fquery": {  
"query": {  
"filtered": {  
"query": {  
"query\_string": {  
"query": "gb",  
"default\_field":  
"listings.country\_id",  
"default\_operator": "and"  
}  
}  
}  
}  
}  
},  
{  
"terms": {  
"listing\_language": [  
"es-ES",  
"es",  
"en"  
]  
}  
},  
{  
"not": {  
"filter": {  
"and": {  
"filters": [  
{  
"term": {  
"address\_1": ""  
}  
},  
{  
"term": {  
"address\_2": ""  
}  
}  
]  
}  
}  
}  
},  
{  
"not": {  
"filter": {  
"and": {  
"filters": [  
{  
"missing": {  
"field": "address\_1"  
}  
},  
{  
"missing": {  
"field": "address\_2"  
}  
}  
]  
}  
}  
}  
},  
{  
"not": {  
"filter": {  
"terms": {  
"listing\_privacy": [  
"x",  
"dqr",  
"q"  
]  
}  
}  
}  
}  
]  
}  
}  
}  
},  
"fields": [  
"\_source"  
],  
"script\_fields": {  
"distance": {  
"script": "doc['position'].arcDistanceInKm(lat,lon)",  
"params": {  
"lat": 52.630885,  
"lon": 1.297355  
}  
}  
}  
}'

and all results that hits returns with score value 1, I need the results  
returns with differents score values. I read elastic documentation and  
found that I can use custom\_filters\_score with boost fields  
[http://www.elasticsearch.org/guide/reference/query-dsl/custom-filters-score-query.html](http://www.elasticsearch.org/guide/reference/query-dsl/custom-filters-score-query.html)  
but I can't implement that in my query. I appreciate if anyone can help  
with that, and my other question is if there are other ways for doing the  
query calculates score values.

Thanks

--

---

<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:** [January 9, 2013, 3:53pm UTC](https://discuss.elastic.co/t/problem-with-scores-in-a-match-all-query/10280/2 "2013-01-09T15:53:59Z")

</div>

The scores should not be 1 since you are not using a constant score query.  
Do you omit term frequencies in your index? Post (gist) and sample  
explanation output (preferably without the facets).

--  
Ivan

On Wed, Jan 9, 2013 at 7:13 AM, Diego Alejandro Garavito Barreto \<  
[diego.garavito1982@gmail.com](mailto:diego.garavito1982@gmail.com)\> wrote:

> name

--

---

<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, 2:57am UTC](https://discuss.elastic.co/t/problem-with-scores-in-a-match-all-query/10280/3 "2017-07-06T02:57:12Z")

</div>


