# How to remove stopwords from query everywhere except phrase subquery?

**URL:** <https://discuss.elastic.co/t/how-to-remove-stopwords-from-query-everywhere-except-phrase-subquery/109687>\
**Category:** Elasticsearch\
**Created:** [November 30, 2017, 5:45am UTC](https://discuss.elastic.co/t/how-to-remove-stopwords-from-query-everywhere-except-phrase-subquery/109687 "2017-11-30T05:45:06Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![anaym](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/anaym/32/24897_2.png) [@anaym](https://discuss.elastic.co/u/anaym)\
**Post date:** [November 30, 2017, 5:45am UTC](https://discuss.elastic.co/t/how-to-remove-stopwords-from-query-everywhere-except-phrase-subquery/109687/1 "2017-11-30T05:45:06Z")

</div>

`the` - single stopword in stop token filter.  
I search (by query\_string) `The quick brown fox jumps "over the lazy" dog` and I expect that the string should be transformed into `quick brown fox jumps "over the lazy" dog`, but actually I get `quick brown fox jumps "over lazy" dog` (`the` removed from quoted subquery).  
How to fix it?

---

<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 30, 2017, 6:51am UTC](https://discuss.elastic.co/t/how-to-remove-stopwords-from-query-everywhere-except-phrase-subquery/109687/2 "2017-11-30T06:51:51Z")

</div>

I don’t think you can do it. Or may be by writing your own tokenizer as a plugin.

Not that easy IMHO.

May be someone else has an idea?

---

<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:** [December 28, 2017, 6:52am UTC](https://discuss.elastic.co/t/how-to-remove-stopwords-from-query-everywhere-except-phrase-subquery/109687/3 "2017-12-28T06:52:16Z")

</div>

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