# Understand this simple search query

**URL:** <https://discuss.elastic.co/t/understand-this-simple-search-query/277759>\
**Category:** Elasticsearch\
**Created:** [July 5, 2021, 3:06am UTC](https://discuss.elastic.co/t/understand-this-simple-search-query/277759 "2021-07-05T03:06:29Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![KS\_123](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ks_123/32/81648_2.png) [@KS\_123](https://discuss.elastic.co/u/KS_123)\
**Post date:** [July 5, 2021, 3:06am UTC](https://discuss.elastic.co/t/understand-this-simple-search-query/277759/1 "2021-07-05T03:06:29Z")

</div>

this is probably a very basic question but I have 2 searches below.  
search 1 returns 4 values, I just want it to return 1 value(DeviceCommandEvent). how do I do this?  
search 2 retruns 3 values which I would expect, that is everything but the value DeviceCommandEvent. which I understand.

search1  
eventType:"DeviceCommandEvent"  
returns these 4 values:  
DeviceRequestResponseEvent  
DeviceCommandEvent  
DeviceUpdateEvent  
CattleUpdateEvent

search2  
!eventType:"DeviceCommandEvent"  
returns these 3 values  
DeviceRequestResponseEvent  
DeviceUpdateEvent  
CattleUpdateEvent

---

<div class="post-metadata">

**Author:** ![KS\_123](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ks_123/32/81648_2.png) [@KS\_123](https://discuss.elastic.co/u/KS_123)\
**Post date:** [July 5, 2021, 3:07am UTC](https://discuss.elastic.co/t/understand-this-simple-search-query/277759/2 "2021-07-05T03:07:43Z")

</div>

ah scratch that, I worked it out, there was other fields filtering going on in my search that was creating this confusion..hmm

---

<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 2, 2021, 3:08am UTC](https://discuss.elastic.co/t/understand-this-simple-search-query/277759/3 "2021-08-02T03:08:17Z")

</div>

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