# Per user document exclusions

**URL:** https://discuss.elastic.co/t/per-user-document-exclusions/9756
**Category:** Elasticsearch
**Created:** [November 19, 2012, 5:09am UTC](https://discuss.elastic.co/t/per-user-document-exclusions/9756 "2012-11-19T05:09:50Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![Christian\_Jensen](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/christian_jensen/32/2613_2.png) [@Christian\_Jensen](https://discuss.elastic.co/u/Christian_Jensen)
#### Post date: [November 19, 2012, 5:09am UTC](https://discuss.elastic.co/t/per-user-document-exclusions/9756/1 "2012-11-19T05:09:50Z")

</div>

Hi,

We have a need to allow each user to 'exclude' individual documents in the  
results. We can easily do this now within the RDBMS using a FTS index and a  
query with 'OUTER LEFT JOIN WHERE NULL' type of thing.

Can Elasticsearch do this somehow? Heavy customization is not a problem - I  
would bet this has already been done. I would like to avoid multiple trips  
back and forth from either the DB or Elasticsearch if possible.

Thanks!

--

---

<div class="post-metadata">

### Author: ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)
#### Post date: [November 19, 2012, 6:53am UTC](https://discuss.elastic.co/t/per-user-document-exclusions/9756/2 "2012-11-19T06:53:14Z")

</div>

Could you filter your query with a "not filter" based on ids?

[http://www.elasticsearch.org/guide/reference/query-dsl/not-filter.html](http://www.elasticsearch.org/guide/reference/query-dsl/not-filter.html)  
[http://www.elasticsearch.org/guide/reference/query-dsl/ids-filter.html](http://www.elasticsearch.org/guide/reference/query-dsl/ids-filter.html)

Does it help?

--  
David 😉  
Twitter : @dadoonet / @elasticsearchfr / @scrutmydocs

Le 19 nov. 2012 à 06:09, Christian Jensen [christian@jensenbox.com](mailto:christian@jensenbox.com) a écrit :

Hi,

We have a need to allow each user to 'exclude' individual documents in the results. We can easily do this now within the RDBMS using a FTS index and a query with 'OUTER LEFT JOIN WHERE NULL' type of thing.

Can Elasticsearch do this somehow? Heavy customization is not a problem - I would bet this has already been done. I would like to avoid multiple trips back and forth from either the DB or Elasticsearch if possible.

## 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:03am UTC](https://discuss.elastic.co/t/per-user-document-exclusions/9756/3 "2017-07-06T03:03:45Z")

</div>


