# Boost, but don't require?

**URL:** <https://discuss.elastic.co/t/boost-but-dont-require/115845>\
**Category:** Elasticsearch\
**Created:** [January 17, 2018, 7:58am UTC](https://discuss.elastic.co/t/boost-but-dont-require/115845 "2018-01-17T07:58:01Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![SparkyRih](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/sparkyrih/32/24762_2.png) [@SparkyRih](https://discuss.elastic.co/u/SparkyRih)\
**Post date:** [January 17, 2018, 7:58am UTC](https://discuss.elastic.co/t/boost-but-dont-require/115845/1 "2018-01-17T07:58:01Z")

</div>

I'm looking for a way to boost the score certain document which contain an array of fuzzy terms... Documents not containing any of the terms should still appear (but with a lower rating)... However, when I apply a filter, let's say I filter on an organization, documents from another organization should not appear...

unfortunately I can't figure out how to achieve this...

---

<div class="post-metadata">

**Author:** ![s1monw](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/s1monw/32/3637_2.png) [@s1monw](https://discuss.elastic.co/u/s1monw)\
**Post date:** [January 19, 2018, 1:07pm UTC](https://discuss.elastic.co/t/boost-but-dont-require/115845/2 "2018-01-19T13:07:00Z")

</div>

you mean something like this:

`(fuzzyTerm1~2.0 OR fuzzyTerm2~2.0)^5 AND (organization:my_org)` that would boost docs that contain either `fuzzyTerm1` or `fuzzyTerm2` by 5 that are in organization `my_org`

is this what you mean?

---

<div class="post-metadata">

**Author:** ![SparkyRih](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/sparkyrih/32/24762_2.png) [@SparkyRih](https://discuss.elastic.co/u/SparkyRih)\
**Post date:** [January 19, 2018, 1:35pm UTC](https://discuss.elastic.co/t/boost-but-dont-require/115845/3 "2018-01-19T13:35:41Z")

</div>

What I needed was more like this:  
`organization:my_org AND (fuzzyTerm1:hello^5 OR fuzzyTerm2:world^2 OR (!fuzzyTerm1:hello AND !fuzzyTerm2:world))`

This shows all documents within the organization, including the ones that don't match any of the fuzzy terms... The ones that do match are boosted by 5 and 2 in this example...

It sounds weird to return documents, or in my case aggregations which are not being asked for, but I'm using this for an automated logging system...

So I found out what I looked for already 🙂

---

<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:** [February 16, 2018, 1:36pm UTC](https://discuss.elastic.co/t/boost-but-dont-require/115845/4 "2018-02-16T13:36:20Z")

</div>

Closed on February 16, 2018, 1:36pm UTC

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