# Stop words filter works non-deterministically

**URL:** <https://discuss.elastic.co/t/stop-words-filter-works-non-deterministically/242050>\
**Category:** Elasticsearch\
**Created:** [July 21, 2020, 2:42pm UTC](https://discuss.elastic.co/t/stop-words-filter-works-non-deterministically/242050 "2020-07-21T14:42:30Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ewelina\_Zarebska](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ewelina_zarebska/32/72520_2.png) [@Ewelina\_Zarebska](https://discuss.elastic.co/u/Ewelina_Zarebska)\
**Post date:** [July 21, 2020, 2:42pm UTC](https://discuss.elastic.co/t/stop-words-filter-works-non-deterministically/242050/1 "2020-07-21T14:42:30Z")

</div>

Hi colleagues,

I have following filter and custom analyzer:

```auto
"custom_address_stopwords_filter": {
"type": "stop",
"stopwords": [
"po"
,
"p.o."
,
"box"
,
"n\a"
,
"n\a"
,
"n/a"
,
"n/a"
,
"-"
,
"-----"
,
"none"
,
"TBD"
]
},

"address_text_transliteration_analyzer": {
"filter": [
"icu_folding",
"custom_address_stopwords_filter"
],
"type": "custom",
"tokenizer": "icu_tokenizer"
},

```

I have 2 cases that I am expecting that will work in the same way but they are not.

Case 1:  
In elastic search, I have indexed an entry with a property "address" for which I applied mentioned analyzer:

"address": "none"

when I am querying data providing also "none" as address it matches which for me works as expected.

Case 2:  
In elastic search, I have indexed an entry with:  
"address": "TBD"

when I am querying data providing "none" as address it does not match. Both "TBD" and "none" are stopwords and from my understanding, there should be removed, then compared, so in both cases there should be an empty list of tokens that should always match but it is not.

Could you please explain what I am doing wrong?  
Ewelina

---

<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:** [August 18, 2020, 2:42pm UTC](https://discuss.elastic.co/t/stop-words-filter-works-non-deterministically/242050/2 "2020-08-18T14:42:34Z")

</div>

Closed on August 18, 2020, 2:42pm UTC

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