# Wild card query with case insensitive search

**URL:** <https://discuss.elastic.co/t/wild-card-query-with-case-insensitive-search/23692>\
**Category:** Elasticsearch\
**Created:** [May 26, 2015, 8:29pm UTC](https://discuss.elastic.co/t/wild-card-query-with-case-insensitive-search/23692 "2015-05-26T20:29:20Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Sagar\_Shah](https://avatars.discourse-cdn.com/v4/letter/s/a9a28c/32.png) [@Sagar\_Shah](https://discuss.elastic.co/u/Sagar_Shah)\
**Post date:** [May 26, 2015, 8:29pm UTC](https://discuss.elastic.co/t/wild-card-query-with-case-insensitive-search/23692/1 "2015-05-26T20:29:20Z")

</div>

Hello everyone,  
We are trying to replace application log storage from postgres db with  
elastic search.  
We had two features in postgres that should not get affected.

1. Perform case insensitive search
2. Perform wild card search

In elastic search, we are using lowercase filter with keyword anlayzer to  
meet point# 1.  
For performing wild card search, we are using wildQuery (ES Java API).

Everything looks file as long as I am searching for single word like  
'sagar', but searches fail to return any results when I use multiple words  
in my search criteria like 'sagar shah'. That's probably because of keyword  
analyzer, which breaks it into multiple words.

Is there a way to perform search a wild card type search in  
case-insensitive format.

Please advise.  
Appreciate your inputs.

Regards,  
Sagar Shah

## -- Please update your bookmarks! We have moved to [https://discuss.elastic.co/](https://discuss.elastic.co/)

You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/48b9228e-9cd0-4dc8-b4f2-3e5a5d24ddf9%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/48b9228e-9cd0-4dc8-b4f2-3e5a5d24ddf9%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [May 27, 2015, 1:48am UTC](https://discuss.elastic.co/t/wild-card-query-with-case-insensitive-search/23692/2 "2015-05-27T01:48:22Z")

</div>

Don't use wildcard query unless you want it to be "slow".  
Prefer using ngrams based analyzers (will cost you more disk space).

HTH

David

> Le 26 mai 2015 à 22:29, Sagar Shah [sagarshah1983@gmail.com](mailto:sagarshah1983@gmail.com) a écrit :
> 
> Hello everyone,  
> We are trying to replace application log storage from postgres db with Elasticsearch.  
> We had two features in postgres that should not get affected.
> 
> 1. Perform case insensitive search
> 2. Perform wild card search
> 
> In Elasticsearch, we are using lowercase filter with keyword anlayzer to meet point# 1.  
> For performing wild card search, we are using wildQuery (ES Java API).
> 
> Everything looks file as long as I am searching for single word like 'sagar', but searches fail to return any results when I use multiple words in my search criteria like 'sagar shah'. That's probably because of keyword analyzer, which breaks it into multiple words.
> 
> Is there a way to perform search a wild card type search in case-insensitive format.
> 
> Please advise.  
> Appreciate your inputs.
> 
> ## Regards, Sagar Shah
> 
> ## Please update your bookmarks! We have moved to [https://discuss.elastic.co/](https://discuss.elastic.co/)
> 
> You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
> To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
> To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/48b9228e-9cd0-4dc8-b4f2-3e5a5d24ddf9%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/48b9228e-9cd0-4dc8-b4f2-3e5a5d24ddf9%40googlegroups.com).  
> For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

## -- Please update your bookmarks! We have moved to [https://discuss.elastic.co/](https://discuss.elastic.co/)

You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/AFA7CBFD-AFF9-421F-88EB-A67C67A65AB7%40pilato.fr](https://groups.google.com/d/msgid/elasticsearch/AFA7CBFD-AFF9-421F-88EB-A67C67A65AB7%40pilato.fr).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<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:** [July 6, 2017, 12:11am UTC](https://discuss.elastic.co/t/wild-card-query-with-case-insensitive-search/23692/3 "2017-07-06T00:11:46Z")

</div>


