# Custom score with multiple query

**URL:** <https://discuss.elastic.co/t/custom-score-with-multiple-query/8893>\
**Category:** Elasticsearch\
**Created:** [August 30, 2012, 12:01pm UTC](https://discuss.elastic.co/t/custom-score-with-multiple-query/8893 "2012-08-30T12:01:42Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Atharva\_Patel](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/atharva_patel/32/2414_2.png) [@Atharva\_Patel](https://discuss.elastic.co/u/Atharva_Patel)\
**Post date:** [August 30, 2012, 12:01pm UTC](https://discuss.elastic.co/t/custom-score-with-multiple-query/8893/1 "2012-08-30T12:01:42Z")

</div>

How to calculate a custom score which is kind of a formula that combines  
scores from multiple queries. Each such query itself might have a custom  
score script inside it. A short example will be great for explanation.

--

---

<div class="post-metadata">

**Author:** ![Atharva\_Patel](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/atharva_patel/32/2414_2.png) [@Atharva\_Patel](https://discuss.elastic.co/u/Atharva_Patel)\
**Post date:** [August 30, 2012, 12:02pm UTC](https://discuss.elastic.co/t/custom-score-with-multiple-query/8893/2 "2012-08-30T12:02:17Z")

</div>

On Thursday, 30 August 2012 17:31:42 UTC+5:30, Atharva Patel wrote:

> How to calculate a custom score which is kind of a formula that combines  
> scores from multiple queries. Each such query itself might have a custom  
> score script inside it. A short example will be great for explanation.

--

---

<div class="post-metadata">

**Author:** ![Atharva\_Patel](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/atharva_patel/32/2414_2.png) [@Atharva\_Patel](https://discuss.elastic.co/u/Atharva_Patel)\
**Post date:** [August 30, 2012, 12:20pm UTC](https://discuss.elastic.co/t/custom-score-with-multiple-query/8893/3 "2012-08-30T12:20:25Z")

</div>

For example I want to find a score something like finalscore =  
0.4_customquery1 + 0.6_customquery2;  
How to achieve this with elasticsearch API?

On Thursday, 30 August 2012 17:31:42 UTC+5:30, Atharva Patel wrote:

> How to calculate a custom score which is kind of a formula that combines  
> scores from multiple queries. Each such query itself might have a custom  
> score script inside it. A short example will be great for explanation.

--

---

<div class="post-metadata">

**Author:** ![phill](https://avatars.discourse-cdn.com/v4/letter/p/779978/32.png) [@phill](https://discuss.elastic.co/u/phill)\
**Post date:** [August 30, 2012, 3:01pm UTC](https://discuss.elastic.co/t/custom-score-with-multiple-query/8893/4 "2012-08-30T15:01:17Z")

</div>

The word to search for on the ES website is boost. The simplest was to  
combine queries is to use a boolean query called a boolQuery in ES.

-Paul  
On 8/30/2012 5:20 AM, Atharva Patel wrote:

> For example I want to find a score something like finalscore =  
> 0.4_customquery1 + 0.6_customquery2;  
> How to achieve this with elasticsearch API?

--

---

<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:14am UTC](https://discuss.elastic.co/t/custom-score-with-multiple-query/8893/5 "2017-07-06T03:14:32Z")

</div>


