# Can we customized the overall result score using java?

**URL:** <https://discuss.elastic.co/t/can-we-customized-the-overall-result-score-using-java/9131>\
**Category:** Elasticsearch\
**Created:** [September 25, 2012, 9:22am UTC](https://discuss.elastic.co/t/can-we-customized-the-overall-result-score-using-java/9131 "2012-09-25T09:22:59Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Sam\_4](https://avatars.discourse-cdn.com/v4/letter/s/db5fbb/32.png) [@Sam\_4](https://discuss.elastic.co/u/Sam_4)\
**Post date:** [September 25, 2012, 9:22am UTC](https://discuss.elastic.co/t/can-we-customized-the-overall-result-score-using-java/9131/1 "2012-09-25T09:22:59Z")

</div>

Hi

I have question regarding result score:

1. On which basis elastic search will calculate the over result score,can  
we manipulate(customized) over all result score.

2. what is score mode and how can we define it.

Thanks

--

---

<div class="post-metadata">

**Author:** ![Derry\_O\_Sullivan](https://avatars.discourse-cdn.com/v4/letter/d/7bcc69/32.png) [@Derry\_O\_Sullivan](https://discuss.elastic.co/u/Derry_O_Sullivan)\
**Post date:** [September 25, 2012, 9:26am UTC](https://discuss.elastic.co/t/can-we-customized-the-overall-result-score-using-java/9131/2 "2012-09-25T09:26:51Z")

</div>

Hi Sam,

It's worth checking out the custom scoring:

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

and explanation docs:

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

to see how a score is calculated and also how you can change/create your  
own custom scoring.

On 25 September 2012 10:22, sam [mishra.sameek@gmail.com](mailto:mishra.sameek@gmail.com) wrote:

> Hi
> 
> I have question regarding result score:
> 
> 1. On which basis Elasticsearch will calculate the over result score,can  
> we manipulate(customized) over all result score.
> 
> 2. what is score mode and how can we define it.
> 
> Thanks
> 
> --

--

---

<div class="post-metadata">

**Author:** ![Derry\_O\_Sullivan](https://avatars.discourse-cdn.com/v4/letter/d/7bcc69/32.png) [@Derry\_O\_Sullivan](https://discuss.elastic.co/u/Derry_O_Sullivan)\
**Post date:** [September 25, 2012, 9:33am UTC](https://discuss.elastic.co/t/can-we-customized-the-overall-result-score-using-java/9131/3 "2012-09-25T09:33:21Z")

</div>

For java, you can take an existing querybuilder object and wrap it in a  
customScore script e.g:  
customScoreQuery(qb1).param("param1", 0.3).param("param2",  
0.9).script("doc.score \* (doc['count'].value/doc['numVotes'].value)");

Check out the customScoreBuilder doc  
[http://es-java-doc.medcl.net/org/elasticsearch/index/query/CustomScoreQueryBuilder.html](http://es-java-doc.medcl.net/org/elasticsearch/index/query/CustomScoreQueryBuilder.html)

On 25 September 2012 10:26, Derry O' Sullivan [derryos@gmail.com](mailto:derryos@gmail.com) wrote:

> Hi Sam,
> 
> It's worth checking out the custom scoring:
> 
> [Elasticsearch Platform — Find real-time answers at scale | Elastic](http://www.elasticsearch.org/guide/reference/query-dsl/custom-score-query.html)
> 
> and explanation docs:  
> [Elasticsearch Platform — Find real-time answers at scale | Elastic](http://www.elasticsearch.org/guide/reference/api/explain.html)
> 
> to see how a score is calculated and also how you can change/create your  
> own custom scoring.
> 
> On 25 September 2012 10:22, sam [mishra.sameek@gmail.com](mailto:mishra.sameek@gmail.com) wrote:
> 
> > Hi
> > 
> > I have question regarding result score:
> > 
> > 1. On which basis Elasticsearch will calculate the over result score,can  
> > we manipulate(customized) over all result score.
> > 
> > 2. what is score mode and how can we define it.
> > 
> > Thanks
> > 
> > --

--

---

<div class="post-metadata">

**Author:** ![Sam\_4](https://avatars.discourse-cdn.com/v4/letter/s/db5fbb/32.png) [@Sam\_4](https://discuss.elastic.co/u/Sam_4)\
**Post date:** [September 25, 2012, 9:33am UTC](https://discuss.elastic.co/t/can-we-customized-the-overall-result-score-using-java/9131/4 "2012-09-25T09:33:25Z")

</div>

I am using elastic-search 0.16.2 and impossible to move higher version for  
now ,can you suggest another option.

On Tuesday, September 25, 2012 2:52:59 PM UTC+5:30, sam wrote:

> Hi
> 
> I have question regarding result score:
> 
> 1. On which basis Elasticsearch will calculate the over result score,can  
> we manipulate(customized) over all result score.
> 
> 2. what is score mode and how can we define it.
> 
> Thanks

--

---

<div class="post-metadata">

**Author:** ![Derry\_O\_Sullivan](https://avatars.discourse-cdn.com/v4/letter/d/7bcc69/32.png) [@Derry\_O\_Sullivan](https://discuss.elastic.co/u/Derry_O_Sullivan)\
**Post date:** [September 25, 2012, 9:48am UTC](https://discuss.elastic.co/t/can-we-customized-the-overall-result-score-using-java/9131/5 "2012-09-25T09:48:10Z")

</div>

Hi Sam,

I'm a pretty new ES user so not sure about backwards compatibility with the  
Java jar for 0.16.2. If you don't have customScoreQueryBuilder classes,  
i'll defer to one of the ES experts!

On 25 September 2012 10:33, sam [mishra.sameek@gmail.com](mailto:mishra.sameek@gmail.com) wrote:

> I am using elastic-search 0.16.2 and impossible to move higher version for  
> now ,can you suggest another option.
> 
> On Tuesday, September 25, 2012 2:52:59 PM UTC+5:30, sam wrote:
> 
> > Hi
> > 
> > I have question regarding result score:
> > 
> > 1. On which basis Elasticsearch will calculate the over result score,can  
> > we manipulate(customized) over all result score.
> > 
> > 2. what is score mode and how can we define it.
> > 
> > Thanks
> 
> --

--

---

<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:11am UTC](https://discuss.elastic.co/t/can-we-customized-the-overall-result-score-using-java/9131/6 "2017-07-06T03:11:32Z")

</div>


