# Notwithin operator

**URL:** <https://discuss.elastic.co/t/notwithin-operator/276849>\
**Category:** Elasticsearch\
**Created:** [June 23, 2021, 9:14pm UTC](https://discuss.elastic.co/t/notwithin-operator/276849 "2021-06-23T21:14:50Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Abhishek\_Shinde](https://avatars.discourse-cdn.com/v4/letter/a/6bbea6/32.png) [@Abhishek\_Shinde](https://discuss.elastic.co/u/Abhishek_Shinde)\
**Post date:** [June 23, 2021, 9:14pm UTC](https://discuss.elastic.co/t/notwithin-operator/276849/1 "2021-06-23T21:14:50Z")

</div>

I’m trying to achieve with searches Notwithin operators but no luck with intervals query,  
• a?e NOTWITHIN (How are yo?): find all the documents not having “a?e” (? can be any character) inside the phrase “How are yo?” (? can be any character)

I’ve tried following in the Elasticsearch:

> **[Intervals query | Elasticsearch Guide \[7.13\] | Elastic](https://www.elastic.co/guide/en/elasticsearch/reference/7.13/query-dsl-intervals-query.html)**

Problem seen:  
• the not\_contained\_by filter along with wildcard interval seems to be the closest fit but wildcard pattern is only recognising terms/single words and not sentences

Any guidance would be helpful here.

---

<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 21, 2021, 9:15pm UTC](https://discuss.elastic.co/t/notwithin-operator/276849/2 "2021-07-21T21:15:11Z")

</div>

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