# Search / filter with wildcard

**URL:** <https://discuss.elastic.co/t/search-filter-with-wildcard/151814>\
**Category:** Kibana\
**Created:** [October 10, 2018, 10:16am UTC](https://discuss.elastic.co/t/search-filter-with-wildcard/151814 "2018-10-10T10:16:30Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![asp](https://avatars.discourse-cdn.com/v4/letter/a/9fc348/32.png) [@asp](https://discuss.elastic.co/u/asp)\
**Post date:** [October 10, 2018, 10:16am UTC](https://discuss.elastic.co/t/search-filter-with-wildcard/151814/1 "2018-10-10T10:16:30Z")

</div>

Hi there,

I have a field payload with following value:

`Routing to activemq:queue:tuxedoHighPriority.vpntbm2.2?exchangePattern=InOnly&messageConverter=#ttp2ActiveMQMessageConverter`

I want to set a filter for "Routing to activemq:queue:tuxedoHighPriority.vpntbm\*"  
How do I do this? I tried the keyword and normal field of payload, tried with .\* and only \*, but I always get no match.

What is the correct syntax?

Thanks, Andreas

---

<div class="post-metadata">

**Author:** ![Bill\_McConaghy](https://avatars.discourse-cdn.com/v4/letter/b/ed655f/32.png) [@Bill\_McConaghy](https://discuss.elastic.co/u/Bill_McConaghy)\
**Post date:** [October 11, 2018, 11:08am UTC](https://discuss.elastic.co/t/search-filter-with-wildcard/151814/2 "2018-10-11T11:08:39Z")

</div>

This should work for you:

`(fieldname:Routing and fieldname:activemq:queue:tuxedoHighPriority.vpntbm*)`

---

<div class="post-metadata">

**Author:** ![asp](https://avatars.discourse-cdn.com/v4/letter/a/9fc348/32.png) [@asp](https://discuss.elastic.co/u/asp)\
**Post date:** [October 12, 2018, 7:27am UTC](https://discuss.elastic.co/t/search-filter-with-wildcard/151814/3 "2018-10-12T07:27:32Z")

</div>

thanks for the reply, but it does not work. Lets concentrate on the second part of the query, where the wildcard comes into account.

`payload: "activemq:queue*"` -\> does not work  
`payload: "activemq:queue:tuxedoHighPriority*"` -\> does not work  
`payload: "activemq:queue:tuxedoHighPriority.vpntbm*"` -\> does not work  
`payload: "activemq:queue:tuxedoHighPriority.vpntbm2*"` -\> does not work  
`payload: "activemq:queue:tuxedoHighPriority.vpntbm2.5"` -\> works  
`payload: "activemq:queue:tuxedoHighPriority.vpntbm2.5*"` -\> works

For me it looks like that it is not possible to search a substring inside an analyzed word. I am not sure, but I thought I used once in previous versions.  
Using ES and Kibana 6.4.1.

---

<div class="post-metadata">

**Author:** ![asp](https://avatars.discourse-cdn.com/v4/letter/a/9fc348/32.png) [@asp](https://discuss.elastic.co/u/asp)\
**Post date:** [October 12, 2018, 7:29am UTC](https://discuss.elastic.co/t/search-filter-with-wildcard/151814/4 "2018-10-12T07:29:17Z")

</div>

mapping of the field has been auto created and looks like the following:

```
"payload": {
            "type": "text",
            "fields": {
              "keyword": {
                "type": "keyword",
                "ignore_above": 256
              }
            }
```

---

<div class="post-metadata">

**Author:** ![asp](https://avatars.discourse-cdn.com/v4/letter/a/9fc348/32.png) [@asp](https://discuss.elastic.co/u/asp)\
**Post date:** [October 12, 2018, 7:57am UTC](https://discuss.elastic.co/t/search-filter-with-wildcard/151814/5 "2018-10-12T07:57:55Z")

</div>

in documentation [https://www.elastic.co/guide/en/elasticsearch/reference/6.4/query-dsl-query-string-query.html#query-string-syntax](https://www.elastic.co/guide/en/elasticsearch/reference/6.4/query-dsl-query-string-query.html#query-string-syntax) (section wildcards) I understood that lucene supports wildcards in form of \* and ?.

But this here does also not work for me:  
payload: "activemq:queue:tuxedoHighPriority.vpntbm2. **?**"

---

<div class="post-metadata">

**Author:** ![Bill\_McConaghy](https://avatars.discourse-cdn.com/v4/letter/b/ed655f/32.png) [@Bill\_McConaghy](https://discuss.elastic.co/u/Bill_McConaghy)\
**Post date:** [October 15, 2018, 1:42pm UTC](https://discuss.elastic.co/t/search-filter-with-wildcard/151814/6 "2018-10-15T13:42:28Z")

</div>

I got this to work with an analyzed field"

`fieldname:/Routing to activemq:queue:tuxedoHighPriority.vpntbm2.*/`

---

<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:** [November 12, 2018, 1:42pm UTC](https://discuss.elastic.co/t/search-filter-with-wildcard/151814/7 "2018-11-12T13:42:28Z")

</div>

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