# \[SOLVED\] Are antimatch possible?

**URL:** <https://discuss.elastic.co/t/solved-are-antimatch-possible/186461>\
**Category:** Elasticsearch\
**Created:** [June 19, 2019, 12:11pm UTC](https://discuss.elastic.co/t/solved-are-antimatch-possible/186461 "2019-06-19T12:11:30Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![key](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/key/32/45480_2.png) [@key](https://discuss.elastic.co/u/key)\
**Post date:** [June 19, 2019, 12:11pm UTC](https://discuss.elastic.co/t/solved-are-antimatch-possible/186461/1 "2019-06-19T12:11:30Z")

</div>

Hi,  
are antimatch pattern possible with ES ?  
For instance, take two documents

```auto
{description : "I'm a flower"}
{description : "I'm a blue flower"}

```

And an analyzer with ascii folding, lowercase, edgnengram and maybe some custom tokenization.but this doesn't really matter.

I wnt to match all documents containing the word _flower_ but **not** containeing the word _blue_.  
Is this possible ?  
If so, what would be the java RHLC methods required ?  
If not, where can I submit the idea because it feels very important.  
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:** [June 19, 2019, 12:29pm UTC](https://discuss.elastic.co/t/solved-are-antimatch-possible/186461/2 "2019-06-19T12:29:50Z")

</div>

You can use a bool query with a must with a match query on flower and a must not with a match on blue.

---

<div class="post-metadata">

**Author:** ![key](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/key/32/45480_2.png) [@key](https://discuss.elastic.co/u/key)\
**Post date:** [June 19, 2019, 12:38pm UTC](https://discuss.elastic.co/t/solved-are-antimatch-possible/186461/3 "2019-06-19T12:38:25Z")

</div>

Nice, obviously, 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 17, 2019, 12:38pm UTC](https://discuss.elastic.co/t/solved-are-antimatch-possible/186461/4 "2019-07-17T12:38:26Z")

</div>

Closed on July 17, 2019, 12:38pm UTC

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