# URI search not behaving the same as in Query DSL

**URL:** <https://discuss.elastic.co/t/uri-search-not-behaving-the-same-as-in-query-dsl/21062>\
**Category:** Elasticsearch\
**Created:** [December 3, 2014, 3:58pm UTC](https://discuss.elastic.co/t/uri-search-not-behaving-the-same-as-in-query-dsl/21062 "2014-12-03T15:58:40Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![drjz](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/drjz/32/972_2.png) [@drjz](https://discuss.elastic.co/u/drjz)\
**Post date:** [December 3, 2014, 3:58pm UTC](https://discuss.elastic.co/t/uri-search-not-behaving-the-same-as-in-query-dsl/21062/1 "2014-12-03T15:58:40Z")

</div>

Hi all,

I am testing using wildcards in field names. I have the following URI  
search:

\_search?q=p.\*:pair&explain

It returns me results (in the browser).

However, when I express this query in Query DSL like this, then no results  
get returned:

{  
"query" : {  
"query\_string" : {  
"fields" : ["p.\*"],  
"query" : "pair"  
}  
}  
}

Is this a bug or do I have the wrong translation of the query in Query DSL?

Thanks!

/JZ

--  
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/d0236cbc-17e2-4f14-83b7-da5941351d48%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/d0236cbc-17e2-4f14-83b7-da5941351d48%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![jprante](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jprante/32/44941_2.png) [@jprante](https://discuss.elastic.co/u/jprante)\
**Post date:** [December 4, 2014, 8:59am UTC](https://discuss.elastic.co/t/uri-search-not-behaving-the-same-as-in-query-dsl/21062/2 "2014-12-04T08:59:27Z")

</div>

You have to enable "analyze\_wildcard: true"

Jörg

On Wed, Dec 3, 2014 at 4:58 PM, drjz [juntezhang@gmail.com](mailto:juntezhang@gmail.com) wrote:

> Hi all,
> 
> I am testing using wildcards in field names. I have the following URI  
> search:
> 
> \_search?q=p.\*:pair&explain
> 
> It returns me results (in the browser).
> 
> However, when I express this query in Query DSL like this, then no results  
> get returned:
> 
> {  
> "query" : {  
> "query\_string" : {  
> "fields" : ["p.\*"],  
> "query" : "pair"  
> }  
> }  
> }
> 
> Is this a bug or do I have the wrong translation of the query in Query DSL?
> 
> Thanks!
> 
> /JZ
> 
> --  
> 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/d0236cbc-17e2-4f14-83b7-da5941351d48%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/d0236cbc-17e2-4f14-83b7-da5941351d48%40googlegroups.com)  
> [https://groups.google.com/d/msgid/elasticsearch/d0236cbc-17e2-4f14-83b7-da5941351d48%40googlegroups.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/d0236cbc-17e2-4f14-83b7-da5941351d48%40googlegroups.com?utm_medium=email&utm_source=footer)  
> .  
> For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

--  
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/CAKdsXoHhFgbyqH9grwoa%3DyST5NS%3DTa208Tg8kSf\_zJ8sYYtU8w%40mail.gmail.com](https://groups.google.com/d/msgid/elasticsearch/CAKdsXoHhFgbyqH9grwoa%3DyST5NS%3DTa208Tg8kSf_zJ8sYYtU8w%40mail.gmail.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![drjz](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/drjz/32/972_2.png) [@drjz](https://discuss.elastic.co/u/drjz)\
**Post date:** [December 5, 2014, 12:02pm UTC](https://discuss.elastic.co/t/uri-search-not-behaving-the-same-as-in-query-dsl/21062/3 "2014-12-05T12:02:46Z")

</div>

Adding analyze\_wildcard does not have an effect.

For example, the DSL query below does not return any results, while as a  
URI query it does return me the set of matching documents.

{  
"query" : {  
"query\_string" : {  
"analyze\_wildcard" : true,  
"fields" : ["p.\*"],  
"query" : "london"  
}  
}  
}

Any more ideas?

Thanks!

/JZ

On Thursday, December 4, 2014 9:59:35 AM UTC+1, Jörg Prante wrote:

> You have to enable "analyze\_wildcard: true"
> 
> Jörg
> 
> On Wed, Dec 3, 2014 at 4:58 PM, drjz \<[junte...@gmail.com](mailto:junte...@gmail.com) \<javascript:\>\>  
> wrote:
> 
> > Hi all,
> > 
> > I am testing using wildcards in field names. I have the following URI  
> > search:
> > 
> > \_search?q=p.\*:pair&explain
> > 
> > It returns me results (in the browser).
> > 
> > However, when I express this query in Query DSL like this, then no  
> > results get returned:
> > 
> > {  
> > "query" : {  
> > "query\_string" : {  
> > "fields" : ["p.\*"],  
> > "query" : "pair"  
> > }  
> > }  
> > }
> > 
> > Is this a bug or do I have the wrong translation of the query in Query  
> > DSL?
> > 
> > Thanks!
> > 
> > /JZ
> > 
> > --  
> > 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 [elasticsearc...@googlegroups.com](mailto:elasticsearc...@googlegroups.com) \<javascript:\>.  
> > To view this discussion on the web visit  
> > [https://groups.google.com/d/msgid/elasticsearch/d0236cbc-17e2-4f14-83b7-da5941351d48%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/d0236cbc-17e2-4f14-83b7-da5941351d48%40googlegroups.com)  
> > [https://groups.google.com/d/msgid/elasticsearch/d0236cbc-17e2-4f14-83b7-da5941351d48%40googlegroups.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/d0236cbc-17e2-4f14-83b7-da5941351d48%40googlegroups.com?utm_medium=email&utm_source=footer)  
> > .  
> > For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

--  
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/a3306b15-5c6f-4ee1-b9be-fd89b5118af1%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/a3306b15-5c6f-4ee1-b9be-fd89b5118af1%40googlegroups.com).  
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:45am UTC](https://discuss.elastic.co/t/uri-search-not-behaving-the-same-as-in-query-dsl/21062/4 "2017-07-06T00:45:35Z")

</div>


