# Searching using NOT IN

**URL:** <https://discuss.elastic.co/t/searching-using-not-in/242403>\
**Category:** Elasticsearch\
**Created:** [July 23, 2020, 8:52pm UTC](https://discuss.elastic.co/t/searching-using-not-in/242403 "2020-07-23T20:52:16Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![mfwstchas](https://avatars.discourse-cdn.com/v4/letter/m/9dc877/32.png) [@mfwstchas](https://discuss.elastic.co/u/mfwstchas)\
**Post date:** [July 23, 2020, 8:52pm UTC](https://discuss.elastic.co/t/searching-using-not-in/242403/1 "2020-07-23T20:52:16Z")

</div>

I'm using the below post in Akana and it returns all records with a paymentReasonCode of 426 or 427.

"companyCode": ["10"],  
"customerNumber":["52526"],  
"searchString":["IN paymentReasonCode.keyword :426,427"]

Is there a way to code NOT IN so I get all records that are NOT 426 or NOT 427?\*\* I have tried these, but they are not working

"searchString":["NOT IN paymentReasonCode.keyword :426,427"],  
"searchString":["NOT IN paymentReasonCode.keyword :426,427"],

---

<div class="post-metadata">

**Author:** ![JasonStoltz](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jasonstoltz/32/49893_2.png) [@JasonStoltz](https://discuss.elastic.co/u/JasonStoltz)\
**Post date:** [July 27, 2020, 12:44pm UTC](https://discuss.elastic.co/t/searching-using-not-in/242403/2 "2020-07-27T12:44:19Z")

</div>

Hey @mfwstchas,

Can you confirm that your question pertains to the Elastic App Search product? [https://www.elastic.co/app-search/](https://www.elastic.co/app-search/).

If so, could you rephrase it? I am not sure I understand what you are asking.

Thank you,

Jason

---

<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:** [August 24, 2020, 12:51pm UTC](https://discuss.elastic.co/t/searching-using-not-in/242403/3 "2020-08-24T12:51:05Z")

</div>

Closed on August 24, 2020, 12:51pm UTC

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