# Boosting negatively (or demoting) documents based on an array of values for a given field

**URL:** <https://discuss.elastic.co/t/boosting-negatively-or-demoting-documents-based-on-an-array-of-values-for-a-given-field/193879>\
**Category:** Elasticsearch\
**Created:** [August 5, 2019, 8:09pm UTC](https://discuss.elastic.co/t/boosting-negatively-or-demoting-documents-based-on-an-array-of-values-for-a-given-field/193879 "2019-08-05T20:09:25Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![ToddDtown](https://avatars.discourse-cdn.com/v4/letter/t/df705f/32.png) [@ToddDtown](https://discuss.elastic.co/u/ToddDtown)\
**Post date:** [August 5, 2019, 8:09pm UTC](https://discuss.elastic.co/t/boosting-negatively-or-demoting-documents-based-on-an-array-of-values-for-a-given-field/193879/1 "2019-08-05T20:09:25Z")

</div>

Can anyone help with a query to do a negative boost on documents based on an array of values that i have when creating the query postData?  
Example:

1. A user has viewed 100 images and those 100 image id's are stored in an array somewhere else.
2. I now want to create a query that retrieves a set of documents that will include documents with these id's however they're demoted down in the result set

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:** [September 2, 2019, 8:09pm UTC](https://discuss.elastic.co/t/boosting-negatively-or-demoting-documents-based-on-an-array-of-values-for-a-given-field/193879/2 "2019-09-02T20:09:26Z")

</div>

Closed on September 2, 2019, 8:09pm UTC

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