# WildCard Query by query\_string

**URL:** <https://discuss.elastic.co/t/wildcard-query-by-query-string/12258>\
**Category:** Elasticsearch\
**Created:** [June 4, 2013, 2:30pm UTC](https://discuss.elastic.co/t/wildcard-query-by-query-string/12258 "2013-06-04T14:30:52Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![tarang\_dawer](https://avatars.discourse-cdn.com/v4/letter/t/c0e974/32.png) [@tarang\_dawer](https://discuss.elastic.co/u/tarang_dawer)\
**Post date:** [June 4, 2013, 2:30pm UTC](https://discuss.elastic.co/t/wildcard-query-by-query-string/12258/1 "2013-06-04T14:30:52Z")

</div>

Hi

I have some fields indexed in ES as not analyzed , containing some URL's  
like [https://facebook.com](https://facebook.com) , [http://mail.yahoo.co.in](http://mail.yahoo.co.in)

When i run wild card Queries on them , like  
QueryBuilder wildCard=QueryBuilders.wildcardQuery("urls", "[https://facebook](https://facebook).  
\*");

etc, it returns results fine.

but when i use the queryString , eg - QueryBuilder string=QueryBuilders.  
queryString("[https://facebook](https://facebook).\*").field("urls");

the search fails to return any results.  
Also searching "https://\*[cebook.com](http://cebook.com)" , and it was returning results fine.

So , i thought may be the query string is getting analyzed (although i  
specified the field as not analyzed)  
and tried by setting analyzeWildCard=true with the query string , but it  
did not work , no result.

I also tried by changing the mapping , setting the field to analyzed , and  
specifying the "index\_analyzer" , and "search\_analyzer" fields both with  
"keyword" analyzer , but still it didn't work.

Please Help me out, where i am going wrong ?

How would the wildcard search work on the fields having URL data , through  
query\_string ?

Thanks  
Tarang Dawer

--  
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).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<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, 2:33am UTC](https://discuss.elastic.co/t/wildcard-query-by-query-string/12258/2 "2017-07-06T02:33:04Z")

</div>


