# Wildcard search result problems

**URL:** <https://discuss.elastic.co/t/wildcard-search-result-problems/129061>\
**Category:** Elasticsearch\
**Created:** [April 23, 2018, 8:53am UTC](https://discuss.elastic.co/t/wildcard-search-result-problems/129061 "2018-04-23T08:53:23Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![rso249](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/rso249/32/41992_2.png) [@rso249](https://discuss.elastic.co/u/rso249)\
**Post date:** [April 23, 2018, 8:53am UTC](https://discuss.elastic.co/t/wildcard-search-result-problems/129061/1 "2018-04-23T08:53:23Z")

</div>

Dear Elastic search Team,

It seems that the wildcard isnt working for the following example:  
Data for search: **Task, Tasks, Task to do**  
If I search with **Task** \* it only returns:  
Tasks.  
The users expect that it returns all the above mentioned Data... (having several bugs on this) :  
Search with wildcard _"Task"_\* : **Task, Tasks, Task to do**  
The search field is mapped with the following attributes:  
**"type": "text"**  
\*\* "analyzer": "german"\*\*  
I use the German analyzer in order to have the stop words, stemming etc...

Thank you for any help.

---

<div class="post-metadata">

**Author:** ![polyfractal](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/polyfractal/32/48162_2.png) [@polyfractal](https://discuss.elastic.co/u/polyfractal)\
**Post date:** [April 23, 2018, 1:55pm UTC](https://discuss.elastic.co/t/wildcard-search-result-problems/129061/2 "2018-04-23T13:55:18Z")

</div>

Would it be possible to post a recreation of your issue (a few sample docs, the mapping and a query)? That will make it a lot easier to help with your issue.

Which wildcard query are you using? `wildcard`, `match_phrase_prefix` or `query_string` with wildcards? They all behave slightly differently.

---

<div class="post-metadata">

**Author:** ![rso249](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/rso249/32/41992_2.png) [@rso249](https://discuss.elastic.co/u/rso249)\
**Post date:** [April 23, 2018, 6:49pm UTC](https://discuss.elastic.co/t/wildcard-search-result-problems/129061/3 "2018-04-23T18:49:17Z")

</div>

Thank you for your answer. I am Using query\_string.

The mapping of the filed:

> "titelDe":{  
> "type":"text",  
> "analyzer":"german",  
> "fields":{  
> "titelDeKey":{  
> "type":"keyword"  
> }  
> }  
> },

The field in ES:

> "titelDe": "Basis",  
> "kurztitelDe": null,  
> "spracheCode": "de",

and

> "titelDe": "Basisvorlage",  
> "kurztitelDe": null,  
> "spracheCode": "de",

Searching with **query\_string** and the searchfield **Basis** \* ES returns only **Basisvorlage** the word Basis is not in the results.

The query:

> { "query": {  
> "nested": {  
> "path": "fassungen",  
> "query": {  
> "query\_string": {  
> "default\_field": "fassungen.titelDe",  
> "query": "Basis\*"  
> }  
> }}}  
> }

---

<div class="post-metadata">

**Author:** ![rso249](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/rso249/32/41992_2.png) [@rso249](https://discuss.elastic.co/u/rso249)\
**Post date:** [April 23, 2018, 7:37pm UTC](https://discuss.elastic.co/t/wildcard-search-result-problems/129061/4 "2018-04-23T19:37:13Z")

</div>

**Update**... It seems that the query returns the correct data.... Basis and Basisvorlage.... False bug alarm!!!

---

<div class="post-metadata">

**Author:** ![polyfractal](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/polyfractal/32/48162_2.png) [@polyfractal](https://discuss.elastic.co/u/polyfractal)\
**Post date:** [April 24, 2018, 11:33am UTC](https://discuss.elastic.co/t/wildcard-search-result-problems/129061/5 "2018-04-24T11:33:21Z")

</div>

Good news! Those are the best kinds of bugs 🙂

---

<div class="post-metadata">

**Author:** ![rso249](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/rso249/32/41992_2.png) [@rso249](https://discuss.elastic.co/u/rso249)\
**Post date:** [April 24, 2018, 1:09pm UTC](https://discuss.elastic.co/t/wildcard-search-result-problems/129061/6 "2018-04-24T13:09:36Z")

</div>

😁 exactly!!! I am just happy that my searches work correctly with ES!! Thank you again!

---

<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:** [May 22, 2018, 1:21pm UTC](https://discuss.elastic.co/t/wildcard-search-result-problems/129061/7 "2018-05-22T13:21:27Z")

</div>

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