# Wrapping query text into "\<\>" results into match all

**URL:** <https://discuss.elastic.co/t/wrapping-query-text-into-results-into-match-all/21037>\
**Category:** Elasticsearch\
**Created:** [December 2, 2014, 4:02pm UTC](https://discuss.elastic.co/t/wrapping-query-text-into-results-into-match-all/21037 "2014-12-02T16:02:25Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Anthony\_Andrushchenk](https://avatars.discourse-cdn.com/v4/letter/a/65b543/32.png) [@Anthony\_Andrushchenk](https://discuss.elastic.co/u/Anthony_Andrushchenk)\
**Post date:** [December 2, 2014, 4:02pm UTC](https://discuss.elastic.co/t/wrapping-query-text-into-results-into-match-all/21037/1 "2014-12-02T16:02:25Z")

</div>

Hi everybody,

I have encountered very strange behaviour of the search when the search  
query is wrapped into "\<\>" characters,

for example query text: "products" matches no documents, while ""  
matches all the documents from the index.

I won't post the index creation definitions (i.e. mappings and structure)  
yet, but rather ask you to try this on your working installations or point  
me to the document on special characters I am missing.

As a hint, the \_explain returns following message: "description":  
"ConstantScore(model\_en:[\* TO products\>}), product of:", where "model\_en"  
is the matched field.

Thank you in advance for your advices,

Tony

--  
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/2e888d66-b2a1-498a-99ed-d265fa95e221%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/2e888d66-b2a1-498a-99ed-d265fa95e221%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![nik9000](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/nik9000/32/44947_2.png) [@nik9000](https://discuss.elastic.co/u/nik9000)\
**Post date:** [December 2, 2014, 4:05pm UTC](https://discuss.elastic.co/t/wrapping-query-text-into-results-into-match-all/21037/2 "2014-12-02T16:05:56Z")

</div>

Its a range query on all terms less than products\>. You'll want to use  
match instead of query\_string and you won't see weird stuff like that.

On Tue, Dec 2, 2014 at 11:02 AM, Anthony Andrushchenko [amrmaker@gmail.com](mailto:amrmaker@gmail.com)  
wrote:

> Hi everybody,
> 
> I have encountered very strange behaviour of the search when the search  
> query is wrapped into "\<\>" characters,
> 
> for example query text: "products" matches no documents, while  
> "" matches all the documents from the index.
> 
> I won't post the index creation definitions (i.e. mappings and structure)  
> yet, but rather ask you to try this on your working installations or point  
> me to the document on special characters I am missing.
> 
> As a hint, the \_explain returns following message: "description":  
> "ConstantScore(model\_en:[\* TO products\>}), product of:", where "model\_en"  
> is the matched field.
> 
> Thank you in advance for your advices,
> 
> Tony
> 
> --  
> 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/2e888d66-b2a1-498a-99ed-d265fa95e221%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/2e888d66-b2a1-498a-99ed-d265fa95e221%40googlegroups.com)  
> [https://groups.google.com/d/msgid/elasticsearch/2e888d66-b2a1-498a-99ed-d265fa95e221%40googlegroups.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/2e888d66-b2a1-498a-99ed-d265fa95e221%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/CAPmjWd34HzFKjpuF67hkLy2vp57YwZgo3csF%2B30z7BUgpwgXzg%40mail.gmail.com](https://groups.google.com/d/msgid/elasticsearch/CAPmjWd34HzFKjpuF67hkLy2vp57YwZgo3csF%2B30z7BUgpwgXzg%40mail.gmail.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![Anthony\_Andrushchenk](https://avatars.discourse-cdn.com/v4/letter/a/65b543/32.png) [@Anthony\_Andrushchenk](https://discuss.elastic.co/u/Anthony_Andrushchenk)\
**Post date:** [December 2, 2014, 4:26pm UTC](https://discuss.elastic.co/t/wrapping-query-text-into-results-into-match-all/21037/3 "2014-12-02T16:26:30Z")

</div>

Hi Nikolas,

thank you very much for your fast and accurate response!

Best,  
Tony

вторник, 2 декабря 2014 г., 18:06:49 UTC+2 пользователь Nikolas Everett  
написал:

> Its a range query on all terms less than products\>. You'll want to use  
> match instead of query\_string and you won't see weird stuff like that.
> 
> On Tue, Dec 2, 2014 at 11:02 AM, Anthony Andrushchenko \<[amrm...@gmail.com](mailto:amrm...@gmail.com)  
> \<javascript:\>\> wrote:
> 
> > Hi everybody,
> > 
> > I have encountered very strange behaviour of the search when the search  
> > query is wrapped into "\<\>" characters,
> > 
> > for example query text: "products" matches no documents, while  
> > "" matches all the documents from the index.
> > 
> > I won't post the index creation definitions (i.e. mappings and structure)  
> > yet, but rather ask you to try this on your working installations or point  
> > me to the document on special characters I am missing.
> > 
> > As a hint, the \_explain returns following message: "description":  
> > "ConstantScore(model\_en:[\* TO products\>}), product of:", where "model\_en"  
> > is the matched field.
> > 
> > Thank you in advance for your advices,
> > 
> > Tony
> > 
> > --  
> > 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/2e888d66-b2a1-498a-99ed-d265fa95e221%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/2e888d66-b2a1-498a-99ed-d265fa95e221%40googlegroups.com)  
> > [https://groups.google.com/d/msgid/elasticsearch/2e888d66-b2a1-498a-99ed-d265fa95e221%40googlegroups.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/2e888d66-b2a1-498a-99ed-d265fa95e221%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/a5c222ff-094c-461a-abf1-5c988e640a5a%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/a5c222ff-094c-461a-abf1-5c988e640a5a%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:46am UTC](https://discuss.elastic.co/t/wrapping-query-text-into-results-into-match-all/21037/4 "2017-07-06T00:46:34Z")

</div>


