# Match\_none and must\_not named queries

**URL:** https://discuss.elastic.co/t/match-none-and-must-not-named-queries/348857
**Category:** Elasticsearch
**Created:** [December 8, 2023, 5:33am UTC](https://discuss.elastic.co/t/match-none-and-must-not-named-queries/348857 "2023-12-08T05:33:06Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![OS1](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/os1/32/128986_2.png) [@OS1](https://discuss.elastic.co/u/OS1)
#### Post date: [December 8, 2023, 5:33am UTC](https://discuss.elastic.co/t/match-none-and-must-not-named-queries/348857/1 "2023-12-08T05:33:06Z")

</div>

I'm building ES queries dynamically in code, and sometimes I choose to omit some part of the query.  
I've been using the "\_name" property for logging and debugging, however I wish I could also use it to tell which sub queries did NOT match.  
Specifically I wish I could name a "match\_none" or queries in a "bool must\_not" clause, is there any way for me to achieve this?

---

<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: [January 5, 2024, 5:33am UTC](https://discuss.elastic.co/t/match-none-and-must-not-named-queries/348857/2 "2024-01-05T05:33:32Z")

</div>

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