# Conditional boosting of results based on the # of conditions that are true

**URL:** <https://discuss.elastic.co/t/conditional-boosting-of-results-based-on-the-of-conditions-that-are-true/357022>\
**Category:** Elasticsearch\
**Created:** [April 8, 2024, 10:27pm UTC](https://discuss.elastic.co/t/conditional-boosting-of-results-based-on-the-of-conditions-that-are-true/357022 "2024-04-08T22:27:45Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![pekadad](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/pekadad/32/133375_2.png) [@pekadad](https://discuss.elastic.co/u/pekadad)\
**Post date:** [April 8, 2024, 10:27pm UTC](https://discuss.elastic.co/t/conditional-boosting-of-results-based-on-the-of-conditions-that-are-true/357022/1 "2024-04-08T22:27:45Z")

</div>

I am trying to determine if it is feasible to include boosting of results based on a number of conditions that might or might not be true for each result.

We have implemented some boosting using a function\_score clause today and that includes a number of conditions but each one is independent of others.

We are now trying to tackle a scenario where we need to match multiple conditions for each result but we don't care which specific conditions match - only how many.

Hopefully this makes sense, but a simplified example:

A result A matches the inclusion criteria. It has a score from that match.

We want to boost that score. Let's say we need to test 5 related conditions for a result.

If one of those conditions matches, we want to increase the score by a particular amount.

If two of those conditions match, we want to increase the score by a slightly larger amount.

If three, by a slightly larger amount.

The "amount" is not really a decay function but it is kind of similar - we want the first match to have a minimum impact but we don't want to just use the exact same boost for each additional match.

Is this something that could be done using function\_score or some other approach?

---

<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:** [May 6, 2024, 10:28pm UTC](https://discuss.elastic.co/t/conditional-boosting-of-results-based-on-the-of-conditions-that-are-true/357022/2 "2024-05-06T22:28:33Z")

</div>

Closed on May 6, 2024, 10:28pm UTC

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
