# Hot to filter out the results which NOT equal to the key words?

**URL:** <https://discuss.elastic.co/t/hot-to-filter-out-the-results-which-not-equal-to-the-key-words/97532>\
**Category:** Elasticsearch\
**Created:** [August 18, 2017, 8:28am UTC](https://discuss.elastic.co/t/hot-to-filter-out-the-results-which-not-equal-to-the-key-words/97532 "2017-08-18T08:28:39Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![ChelseaCao](https://avatars.discourse-cdn.com/v4/letter/c/76d3ee/32.png) [@ChelseaCao](https://discuss.elastic.co/u/ChelseaCao)\
**Post date:** [August 18, 2017, 8:28am UTC](https://discuss.elastic.co/t/hot-to-filter-out-the-results-which-not-equal-to-the-key-words/97532/1 "2017-08-18T08:28:39Z")

</div>

Hi there,

I am wondering how can I filter the search result filtering the field!='key words'? something like:  
select \* from tbl where col1!='test'

Thanks,  
Chelsea

---

<div class="post-metadata">

**Author:** ![xavierfacq](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/xavierfacq/32/8744_2.png) [@xavierfacq](https://discuss.elastic.co/u/xavierfacq)\
**Post date:** [August 18, 2017, 8:35am UTC](https://discuss.elastic.co/t/hot-to-filter-out-the-results-which-not-equal-to-the-key-words/97532/2 "2017-08-18T08:35:46Z")

</div>

Hi,

Look at Bool query must\_not with the TermQuery in.

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

bye,  
Xavier

---

<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:** [September 15, 2017, 8:35am UTC](https://discuss.elastic.co/t/hot-to-filter-out-the-results-which-not-equal-to-the-key-words/97532/3 "2017-09-15T08:35:57Z")

</div>

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