# Using must\_not and wildcard to search

**URL:** <https://discuss.elastic.co/t/using-must-not-and-wildcard-to-search/134590>\
**Category:** Elasticsearch\
**Created:** [June 5, 2018, 10:37am UTC](https://discuss.elastic.co/t/using-must-not-and-wildcard-to-search/134590 "2018-06-05T10:37:30Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![klof](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/klof/32/31590_2.png) [@klof](https://discuss.elastic.co/u/klof)\
**Post date:** [June 5, 2018, 10:53am UTC](https://discuss.elastic.co/t/using-must-not-and-wildcard-to-search/134590/2 "2018-06-05T10:53:06Z")

</div>

What is the datatype of the message field?  
It must be _keyword_, as wildcard works only with **not analyzed** fields.

[https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-wildcard-query.html](https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-wildcard-query.html)

---

_[View the full topic](https://discuss.elastic.co/t/using-must-not-and-wildcard-to-search/134590)._
