# Boosting on most frequent term

**URL:** <https://discuss.elastic.co/t/boosting-on-most-frequent-term/49076>\
**Category:** Elasticsearch\
**Created:** [May 3, 2016, 3:24pm UTC](https://discuss.elastic.co/t/boosting-on-most-frequent-term/49076 "2016-05-03T15:24:57Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Andarius](https://avatars.discourse-cdn.com/v4/letter/a/0ea827/32.png) [@Andarius](https://discuss.elastic.co/u/Andarius)\
**Post date:** [May 3, 2016, 3:24pm UTC](https://discuss.elastic.co/t/boosting-on-most-frequent-term/49076/1 "2016-05-03T15:24:57Z")

</div>

I'm trying to order the results of a search such as the most frequent term is the one with the highest score.  
For instance, given these documents:

```
doc_1 = {'abb':['foo']}
doc_2 = {'abb':['foo', 'bar']}
doc_3 = {'abb':['foo', 'bar', 'foo']})
doc_4 = {'abb':['foo', 'foo', 'foo']})

```

or

```
doc_1 = {'abb':{'foo': 1}}
doc_2 = {'abb':{'foo': 1, 'bar': 1}}
doc_3 = {'abb':{'foo': 2, 'bar': 1}}
doc_4 = {'abb':{'foo': 3}} 

```

How can I manage to get as top answer the document with the most occurence of a given field (here `foo` where the best match would be `doc_4`) ?

Eg. this query (without boosting here): `'query': { 'match': {'abb': 'foo'}}`

---

<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 5, 2017, 10:54pm UTC](https://discuss.elastic.co/t/boosting-on-most-frequent-term/49076/2 "2017-07-05T22:54:22Z")

</div>


