# How to score results ES 2.1 (java client)

**URL:** <https://discuss.elastic.co/t/how-to-score-results-es-2-1-java-client/36772>\
**Category:** Elasticsearch\
**Created:** [December 9, 2015, 4:53pm UTC](https://discuss.elastic.co/t/how-to-score-results-es-2-1-java-client/36772 "2015-12-09T16:53:27Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![n3utrino](https://avatars.discourse-cdn.com/v4/letter/n/e274bd/32.png) [@n3utrino](https://discuss.elastic.co/u/n3utrino)\
**Post date:** [December 9, 2015, 4:53pm UTC](https://discuss.elastic.co/t/how-to-score-results-es-2-1-java-client/36772/1 "2015-12-09T16:53:27Z")

</div>

I try to score my resultset on a field if any of the other queries match.

Pre 2.1 I scored my results with a FilterBuilder.

```
FunctionScoreQueryBuilder scoredQuery = QueryBuilders.functionScoreQuery(baseQuery)
.add(FilterBuilders.termFilter("some_field", "123"), ScoreFunctionBuilders.weightFactorFunction(10f));

```

this added a boost to all results that matched the fields. Now I have trouble to find a solution for 2.1.

Everything I tried either

- added the items to the top of my list regardless if any other query matches  
or
- showed only those results that matched my scoring query

Am I missing something?

Help is greatly appreciated.

---

<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, 11:32pm UTC](https://discuss.elastic.co/t/how-to-score-results-es-2-1-java-client/36772/2 "2017-07-05T23:32:15Z")

</div>

Closed on July 5, 2017, 11:32pm UTC


