# Dictionary of stop words with special behavior

**URL:** <https://discuss.elastic.co/t/dictionary-of-stop-words-with-special-behavior/59174>\
**Category:** Elasticsearch\
**Created:** [August 29, 2016, 11:21am UTC](https://discuss.elastic.co/t/dictionary-of-stop-words-with-special-behavior/59174 "2016-08-29T11:21:45Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![amelkikh](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/amelkikh/32/25394_2.png) [@amelkikh](https://discuss.elastic.co/u/amelkikh)\
**Post date:** [August 29, 2016, 11:21am UTC](https://discuss.elastic.co/t/dictionary-of-stop-words-with-special-behavior/59174/1 "2016-08-29T11:21:45Z")

</div>

I had a necessity to filter the document with dictionary, so that the document did not fall in the index, if it contains a word from this dictionary (for example prohibited documents, obscene language, etc.).  
How can I do that?

If this is not possible, may be you will consider this idea?

---

<div class="post-metadata">

**Author:** ![danielmitterdorfer](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/danielmitterdorfer/32/110510_2.png) [@danielmitterdorfer](https://discuss.elastic.co/u/danielmitterdorfer)\
**Post date:** [August 30, 2016, 8:57am UTC](https://discuss.elastic.co/t/dictionary-of-stop-words-with-special-behavior/59174/2 "2016-08-30T08:57:32Z")

</div>

Hi @amelkikh,

I'd consider this logic part of the application, although you might be able to use [percolator](https://www.elastic.co/guide/en/elasticsearch/reference/current/search-percolate.html) for that: Register queries that match your forbidden words, index the document and check with percolator if any query matches. It depends a bit on the number of forbidden words whether this solution is really feasible though... .

Daniel

---

<div class="post-metadata">

**Author:** ![amelkikh](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/amelkikh/32/25394_2.png) [@amelkikh](https://discuss.elastic.co/u/amelkikh)\
**Post date:** [August 30, 2016, 9:18am UTC](https://discuss.elastic.co/t/dictionary-of-stop-words-with-special-behavior/59174/3 "2016-08-30T09:18:44Z")

</div>

Thanks for the suggestion, it will help me to better understand the features of the product.

---

<div class="post-metadata">

**Author:** ![danielmitterdorfer](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/danielmitterdorfer/32/110510_2.png) [@danielmitterdorfer](https://discuss.elastic.co/u/danielmitterdorfer)\
**Post date:** [August 30, 2016, 9:19am UTC](https://discuss.elastic.co/t/dictionary-of-stop-words-with-special-behavior/59174/4 "2016-08-30T09:19:55Z")

</div>

Hi @amelkikh,

sure, you're welcome. 🙂

Daniel

---

<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 5, 2017, 10:24pm UTC](https://discuss.elastic.co/t/dictionary-of-stop-words-with-special-behavior/59174/5 "2017-07-05T22:24:10Z")

</div>


