# Trying to apply a wildcard exclusion in the Query bar using Lucene

**URL:** <https://discuss.elastic.co/t/trying-to-apply-a-wildcard-exclusion-in-the-query-bar-using-lucene/218250>\
**Category:** Kibana\
**Created:** [February 6, 2020, 8:59pm UTC](https://discuss.elastic.co/t/trying-to-apply-a-wildcard-exclusion-in-the-query-bar-using-lucene/218250 "2020-02-06T20:59:24Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![dleota](https://avatars.discourse-cdn.com/v4/letter/d/779978/32.png) [@dleota](https://discuss.elastic.co/u/dleota)\
**Post date:** [February 6, 2020, 8:59pm UTC](https://discuss.elastic.co/t/trying-to-apply-a-wildcard-exclusion-in-the-query-bar-using-lucene/218250/1 "2020-02-06T20:59:24Z")

</div>

Hello I am trying filter out the records where the field: "callCodeDesc" does not equal wildcard "NIVR"

in the query bar for Lucene I entered: callCodeDesc: - _NIVR_  
(I have an asterisk before the "N" and after the "R". )

I would appreciate any help on how to complete this in the query bar or in the custom dsl option thanks!

---

<div class="post-metadata">

**Author:** ![flash1293](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/flash1293/32/41227_2.png) [@flash1293](https://discuss.elastic.co/u/flash1293)\
**Post date:** [February 7, 2020, 8:54am UTC](https://discuss.elastic.co/t/trying-to-apply-a-wildcard-exclusion-in-the-query-bar-using-lucene/218250/2 "2020-02-07T08:54:16Z")

</div>

Hi @dleota,

The `-` should go before the field name: `-callCodeDesc:*NIVR*`.

However consider using KQL in the query bar instead, it has a more human readable syntax (in this case `NOT callCodeDesc:*NIVR*`)

If this doesn't work for you the mapping of your index might have to be adjusted, please post the mapping here in this case.

---

<div class="post-metadata">

**Author:** ![dleota](https://avatars.discourse-cdn.com/v4/letter/d/779978/32.png) [@dleota](https://discuss.elastic.co/u/dleota)\
**Post date:** [February 7, 2020, 1:13pm UTC](https://discuss.elastic.co/t/trying-to-apply-a-wildcard-exclusion-in-the-query-bar-using-lucene/218250/3 "2020-02-07T13:13:44Z")

</div>

@flash1293 The Lucene syntax worked. I'll also try the KQL syntax. Thank you!

---

<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:** [March 6, 2020, 1:13pm UTC](https://discuss.elastic.co/t/trying-to-apply-a-wildcard-exclusion-in-the-query-bar-using-lucene/218250/4 "2020-03-06T13:13:52Z")

</div>

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