# Have an issue with match query

**URL:** <https://discuss.elastic.co/t/have-an-issue-with-match-query/21448>\
**Category:** Elasticsearch\
**Created:** [January 1, 2015, 7:30am UTC](https://discuss.elastic.co/t/have-an-issue-with-match-query/21448 "2015-01-01T07:30:36Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![Anoop\_P\_R](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/anoop_p_r/32/1016_2.png) [@Anoop\_P\_R](https://discuss.elastic.co/u/Anoop_P_R)\
**Post date:** [January 1, 2015, 7:30am UTC](https://discuss.elastic.co/t/have-an-issue-with-match-query/21448/1 "2015-01-01T07:30:36Z")

</div>

Hi,

We have an issue with the match query of elastic search implementation.

Our index for categories field is as below.

"categories": [  
"DJ’s",  
"Entertainment Entertainment Entertainment  
Entertai",  
_"Allergist_",  
"Transportation Services"  
],

We are getting result when searched using the following input, with "query":  
"allergist". Please see the query below.  
{  
"query": {  
"bool": {  
"must": [  
{  
"term": {  
"status": 1  
}  
},  
{  
"term": {  
"account\_status": 1  
}  
}  
],  
"should": {  
"multi\_match": {  
\* "query": "allergist",\*  
"fields": [  
"categories^5",  
"service\_titles^4",  
"keywords^3",  
"long\_descriptions^2",  
"general\_desc^1",  
"business\_name^0"  
],  
"type": "phrase\_prefix"  
}  
},  
"minimum\_should\_match": 1  
}  
},  
"sort": {  
"recommend\_rank": {  
"order": "desc"  
}  
},  
"from": 0,  
"size": "10"  
}

But not getting the result when using the input with "query": "holistic  
allergist". Please see the query below.

{  
"query": {  
"bool": {  
"must": [  
{  
"term": {  
"status": 1  
}  
},  
{  
"term": {  
"account\_status": 1  
}  
}  
],  
"should": {  
"multi\_match": {  
\* "query": "holistic allergist",\*  
"fields": [  
"categories^5",  
"service\_titles^4",  
"keywords^3",  
"long\_descriptions^2",  
"general\_desc^1",  
"business\_name^0"  
],  
"type": "phrase\_prefix"  
}  
},  
"minimum\_should\_match": 1  
}  
},  
"sort": {  
"recommend\_rank": {  
"order": "desc"  
}  
},  
"from": 0,  
"size": "10"  
}

I would appreciate your help on solving this issue.

Regards,  
Anoop.

--  
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/c4e1ba5e-5374-49cd-b22b-c09c3946c091%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/c4e1ba5e-5374-49cd-b22b-c09c3946c091%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:** [January 1, 2015, 7:44am UTC](https://discuss.elastic.co/t/have-an-issue-with-match-query/21448/2 "2015-01-01T07:44:31Z")

</div>

I guess it's caused by:

```
  "type": "phrase_prefix"

```

Just a note: why searching with a boost=0?

--  
David 😉  
Twitter : @dadoonet / @elasticsearchfr / @scrutmydocs

> Le 1 janv. 2015 à 08:30, Anoop P R [anoopkumaranalloor@gmail.com](mailto:anoopkumaranalloor@gmail.com) a écrit :
> 
> Hi,
> 
> We have an issue with the match query of Elasticsearch implementation.
> 
> Our index for categories field is as below.
> 
> "categories": [  
> "DJ’s",  
> "Entertainment Entertainment Entertainment Entertai",  
> "Allergist",  
> "Transportation Services"  
> ],
> 
> We are getting result when searched using the following input, with "query": "allergist". Please see the query below.  
> {  
> "query": {  
> "bool": {  
> "must": [  
> {  
> "term": {  
> "status": 1  
> }  
> },  
> {  
> "term": {  
> "account\_status": 1  
> }  
> }  
> ],  
> "should": {  
> "multi\_match": {  
> "query": "allergist",  
> "fields": [  
> "categories^5",  
> "service\_titles^4",  
> "keywords^3",  
> "long\_descriptions^2",  
> "general\_desc^1",  
> "business\_name^0"  
> ],  
> "type": "phrase\_prefix"  
> }  
> },  
> "minimum\_should\_match": 1  
> }  
> },  
> "sort": {  
> "recommend\_rank": {  
> "order": "desc"  
> }  
> },  
> "from": 0,  
> "size": "10"  
> }
> 
> But not getting the result when using the input with "query": "holistic allergist". Please see the query below.
> 
> {  
> "query": {  
> "bool": {  
> "must": [  
> {  
> "term": {  
> "status": 1  
> }  
> },  
> {  
> "term": {  
> "account\_status": 1  
> }  
> }  
> ],  
> "should": {  
> "multi\_match": {  
> "query": "holistic allergist",  
> "fields": [  
> "categories^5",  
> "service\_titles^4",  
> "keywords^3",  
> "long\_descriptions^2",  
> "general\_desc^1",  
> "business\_name^0"  
> ],  
> "type": "phrase\_prefix"  
> }  
> },  
> "minimum\_should\_match": 1  
> }  
> },  
> "sort": {  
> "recommend\_rank": {  
> "order": "desc"  
> }  
> },  
> "from": 0,  
> "size": "10"  
> }
> 
> I would appreciate your help on solving this issue.
> 
> ## Regards, Anoop.
> 
> 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/c4e1ba5e-5374-49cd-b22b-c09c3946c091%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/c4e1ba5e-5374-49cd-b22b-c09c3946c091%40googlegroups.com).  
> 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/4891ACE2-EBA9-472F-8237-65EC52B01D70%40pilato.fr](https://groups.google.com/d/msgid/elasticsearch/4891ACE2-EBA9-472F-8237-65EC52B01D70%40pilato.fr).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![Anoop\_P\_R](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/anoop_p_r/32/1016_2.png) [@Anoop\_P\_R](https://discuss.elastic.co/u/Anoop_P_R)\
**Post date:** [January 1, 2015, 11:40am UTC](https://discuss.elastic.co/t/have-an-issue-with-match-query/21448/3 "2015-01-01T11:40:58Z")

</div>

David,

Its not work for me!

Is it possible to split the keyword with whitespace and search on the  
fields.

Boost "0" doesn't make seance and I removed that, Thanks for the note.

On Thursday, January 1, 2015 1:14:53 PM UTC+5:30, David Pilato wrote:

> I guess it's caused by:
> 
> ```
> "type": "phrase_prefix"
> 
> ```
> 
> Just a note: why searching with a boost=0?
> 
> --  
> David 😉  
> Twitter : @dadoonet / @elasticsearchfr / @scrutmydocs
> 
> Le 1 janv. 2015 à 08:30, Anoop P R \<[anoopkuma...@gmail.com](mailto:anoopkuma...@gmail.com) \<javascript:\>\>  
> a écrit :
> 
> Hi,
> 
> We have an issue with the match query of Elasticsearch implementation.
> 
> Our index for categories field is as below.
> 
> "categories": [  
> "DJ’s",  
> "Entertainment Entertainment Entertainment  
> Entertai",  
> _"Allergist_",  
> "Transportation Services"  
> ],
> 
> We are getting result when searched using the following input, with "query":  
> "allergist". Please see the query below.  
> {  
> "query": {  
> "bool": {  
> "must": [  
> {  
> "term": {  
> "status": 1  
> }  
> },  
> {  
> "term": {  
> "account\_status": 1  
> }  
> }  
> ],  
> "should": {  
> "multi\_match": {  
> \* "query": "allergist",\*  
> "fields": [  
> "categories^5",  
> "service\_titles^4",  
> "keywords^3",  
> "long\_descriptions^2",  
> "general\_desc^1",  
> "business\_name^0"  
> ],  
> "type": "phrase\_prefix"  
> }  
> },  
> "minimum\_should\_match": 1  
> }  
> },  
> "sort": {  
> "recommend\_rank": {  
> "order": "desc"  
> }  
> },  
> "from": 0,  
> "size": "10"  
> }
> 
> But not getting the result when using the input with "query": "holistic  
> allergist". Please see the query below.
> 
> {  
> "query": {  
> "bool": {  
> "must": [  
> {  
> "term": {  
> "status": 1  
> }  
> },  
> {  
> "term": {  
> "account\_status": 1  
> }  
> }  
> ],  
> "should": {  
> "multi\_match": {  
> \* "query": "holistic allergist",\*  
> "fields": [  
> "categories^5",  
> "service\_titles^4",  
> "keywords^3",  
> "long\_descriptions^2",  
> "general\_desc^1",  
> "business\_name^0"  
> ],  
> "type": "phrase\_prefix"  
> }  
> },  
> "minimum\_should\_match": 1  
> }  
> },  
> "sort": {  
> "recommend\_rank": {  
> "order": "desc"  
> }  
> },  
> "from": 0,  
> "size": "10"  
> }
> 
> I would appreciate your help on solving this issue.
> 
> Regards,  
> Anoop.
> 
> --  
> 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/c4e1ba5e-5374-49cd-b22b-c09c3946c091%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/c4e1ba5e-5374-49cd-b22b-c09c3946c091%40googlegroups.com)  
> [https://groups.google.com/d/msgid/elasticsearch/c4e1ba5e-5374-49cd-b22b-c09c3946c091%40googlegroups.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/c4e1ba5e-5374-49cd-b22b-c09c3946c091%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/5a5dc3a9-50e0-4060-8f96-cf13719fc5fd%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/5a5dc3a9-50e0-4060-8f96-cf13719fc5fd%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:** [January 1, 2015, 12:20pm UTC](https://discuss.elastic.co/t/have-an-issue-with-match-query/21448/4 "2015-01-01T12:20:57Z")

</div>

Well. Hard to say without seeing your mapping and a full reproduction...

--  
David 😉  
Twitter : @dadoonet / @elasticsearchfr / @scrutmydocs

> Le 1 janv. 2015 à 12:40, Anoop P R [anoopkumaranalloor@gmail.com](mailto:anoopkumaranalloor@gmail.com) a écrit :
> 
> David,
> 
> Its not work for me!
> 
> Is it possible to split the keyword with whitespace and search on the fields.
> 
> Boost "0" doesn't make seance and I removed that, Thanks for the note.
> 
> > On Thursday, January 1, 2015 1:14:53 PM UTC+5:30, David Pilato wrote:  
> > I guess it's caused by:
> > 
> > ```
> > "type": "phrase_prefix"
> > 
> > ```
> > 
> > Just a note: why searching with a boost=0?
> > 
> > --  
> > David 😉  
> > Twitter : @dadoonet / @elasticsearchfr / @scrutmydocs
> > 
> > > Le 1 janv. 2015 à 08:30, Anoop P R [anoopkuma...@gmail.com](mailto:anoopkuma...@gmail.com) a écrit :
> > > 
> > > Hi,
> > > 
> > > We have an issue with the match query of Elasticsearch implementation.
> > > 
> > > Our index for categories field is as below.
> > > 
> > > "categories": [  
> > > "DJ’s",  
> > > "Entertainment Entertainment Entertainment Entertai",  
> > > "Allergist",  
> > > "Transportation Services"  
> > > ],
> > > 
> > > We are getting result when searched using the following input, with "query": "allergist". Please see the query below.  
> > > {  
> > > "query": {  
> > > "bool": {  
> > > "must": [  
> > > {  
> > > "term": {  
> > > "status": 1  
> > > }  
> > > },  
> > > {  
> > > "term": {  
> > > "account\_status": 1  
> > > }  
> > > }  
> > > ],  
> > > "should": {  
> > > "multi\_match": {  
> > > "query": "allergist",  
> > > "fields": [  
> > > "categories^5",  
> > > "service\_titles^4",  
> > > "keywords^3",  
> > > "long\_descriptions^2",  
> > > "general\_desc^1",  
> > > "business\_name^0"  
> > > ],  
> > > "type": "phrase\_prefix"  
> > > }  
> > > },  
> > > "minimum\_should\_match": 1  
> > > }  
> > > },  
> > > "sort": {  
> > > "recommend\_rank": {  
> > > "order": "desc"  
> > > }  
> > > },  
> > > "from": 0,  
> > > "size": "10"  
> > > }
> > > 
> > > But not getting the result when using the input with "query": "holistic allergist". Please see the query below.
> > > 
> > > {  
> > > "query": {  
> > > "bool": {  
> > > "must": [  
> > > {  
> > > "term": {  
> > > "status": 1  
> > > }  
> > > },  
> > > {  
> > > "term": {  
> > > "account\_status": 1  
> > > }  
> > > }  
> > > ],  
> > > "should": {  
> > > "multi\_match": {  
> > > "query": "holistic allergist",  
> > > "fields": [  
> > > "categories^5",  
> > > "service\_titles^4",  
> > > "keywords^3",  
> > > "long\_descriptions^2",  
> > > "general\_desc^1",  
> > > "business\_name^0"  
> > > ],  
> > > "type": "phrase\_prefix"  
> > > }  
> > > },  
> > > "minimum\_should\_match": 1  
> > > }  
> > > },  
> > > "sort": {  
> > > "recommend\_rank": {  
> > > "order": "desc"  
> > > }  
> > > },  
> > > "from": 0,  
> > > "size": "10"  
> > > }
> > > 
> > > I would appreciate your help on solving this issue.
> > > 
> > > ## Regards, Anoop.
> > > 
> > > 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).  
> > > To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/c4e1ba5e-5374-49cd-b22b-c09c3946c091%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/c4e1ba5e-5374-49cd-b22b-c09c3946c091%40googlegroups.com).  
> > > 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/5a5dc3a9-50e0-4060-8f96-cf13719fc5fd%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/5a5dc3a9-50e0-4060-8f96-cf13719fc5fd%40googlegroups.com).  
> 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/7F4B9EE2-FE03-4550-997D-57C44A074678%40pilato.fr](https://groups.google.com/d/msgid/elasticsearch/7F4B9EE2-FE03-4550-997D-57C44A074678%40pilato.fr).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![Anoop\_P\_R](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/anoop_p_r/32/1016_2.png) [@Anoop\_P\_R](https://discuss.elastic.co/u/Anoop_P_R)\
**Post date:** [January 2, 2015, 5:21am UTC](https://discuss.elastic.co/t/have-an-issue-with-match-query/21448/5 "2015-01-02T05:21:35Z")

</div>

Here is the mapping

{  
"demo\_local": {  
"mappings": {  
"tradesman": {  
"properties": {  
"account\_status": {  
"type": "boolean"  
},  
"business\_name": {  
"type": "string"  
},  
"business\_name\_sort": {  
"type": "string"  
},  
"categories": {  
"type": "string"  
},  
"general\_desc": {  
"type": "string"  
},  
"keywords": {  
"type": "string"  
},  
"long\_descriptions": {  
"type": "string"  
},  
"member\_id": {  
"type": "string"  
},  
"pin": {  
"properties": {  
"location": {  
"type": "geo\_point"  
}  
}  
},  
"professionalism\_rank": {  
"type": "long"  
},  
"punctuality\_rank": {  
"type": "long"  
},  
"recommend\_rank": {  
"type": "long"  
},  
"service\_location": {  
"type": "long"  
},  
"service\_titles": {  
"type": "string"  
},  
"state": {  
"type": "boolean"  
},  
"status": {  
"type": "long"  
},  
"unique\_name": {  
"type": "string"  
},  
"value\_rank": {  
"type": "long"  
}  
}  
}  
}  
}  
}

On Thursday, January 1, 2015 5:51:08 PM UTC+5:30, David Pilato wrote:

> Well. Hard to say without seeing your mapping and a full reproduction...
> 
> --  
> David 😉  
> Twitter : @dadoonet / @elasticsearchfr / @scrutmydocs
> 
> Le 1 janv. 2015 à 12:40, Anoop P R \<[anoopkuma...@gmail.com](mailto:anoopkuma...@gmail.com) \<javascript:\>\>  
> a écrit :
> 
> David,
> 
> Its not work for me!
> 
> Is it possible to split the keyword with whitespace and search on the  
> fields.
> 
> Boost "0" doesn't make seance and I removed that, Thanks for the note.
> 
> On Thursday, January 1, 2015 1:14:53 PM UTC+5:30, David Pilato wrote:
> 
> > I guess it's caused by:
> > 
> > ```
> > "type": "phrase_prefix"
> > 
> > ```
> > 
> > Just a note: why searching with a boost=0?
> > 
> > --  
> > David 😉  
> > Twitter : @dadoonet / @elasticsearchfr / @scrutmydocs
> > 
> > Le 1 janv. 2015 à 08:30, Anoop P R [anoopkuma...@gmail.com](mailto:anoopkuma...@gmail.com) a écrit :
> > 
> > Hi,
> > 
> > We have an issue with the match query of Elasticsearch implementation.
> > 
> > Our index for categories field is as below.
> > 
> > "categories": [  
> > "DJ’s",  
> > "Entertainment Entertainment Entertainment  
> > Entertai",  
> > _"Allergist_",  
> > "Transportation Services"  
> > ],
> > 
> > We are getting result when searched using the following input, with "query":  
> > "allergist". Please see the query below.  
> > {  
> > "query": {  
> > "bool": {  
> > "must": [  
> > {  
> > "term": {  
> > "status": 1  
> > }  
> > },  
> > {  
> > "term": {  
> > "account\_status": 1  
> > }  
> > }  
> > ],  
> > "should": {  
> > "multi\_match": {  
> > \* "query": "allergist",\*  
> > "fields": [  
> > "categories^5",  
> > "service\_titles^4",  
> > "keywords^3",  
> > "long\_descriptions^2",  
> > "general\_desc^1",  
> > "business\_name^0"  
> > ],  
> > "type": "phrase\_prefix"  
> > }  
> > },  
> > "minimum\_should\_match": 1  
> > }  
> > },  
> > "sort": {  
> > "recommend\_rank": {  
> > "order": "desc"  
> > }  
> > },  
> > "from": 0,  
> > "size": "10"  
> > }
> > 
> > But not getting the result when using the input with "query": "holistic  
> > allergist". Please see the query below.
> > 
> > {  
> > "query": {  
> > "bool": {  
> > "must": [  
> > {  
> > "term": {  
> > "status": 1  
> > }  
> > },  
> > {  
> > "term": {  
> > "account\_status": 1  
> > }  
> > }  
> > ],  
> > "should": {  
> > "multi\_match": {  
> > \* "query": "holistic allergist",\*  
> > "fields": [  
> > "categories^5",  
> > "service\_titles^4",  
> > "keywords^3",  
> > "long\_descriptions^2",  
> > "general\_desc^1",  
> > "business\_name^0"  
> > ],  
> > "type": "phrase\_prefix"  
> > }  
> > },  
> > "minimum\_should\_match": 1  
> > }  
> > },  
> > "sort": {  
> > "recommend\_rank": {  
> > "order": "desc"  
> > }  
> > },  
> > "from": 0,  
> > "size": "10"  
> > }
> > 
> > I would appreciate your help on solving this issue.
> > 
> > Regards,  
> > Anoop.
> > 
> > --  
> > 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).  
> > To view this discussion on the web visit  
> > [https://groups.google.com/d/msgid/elasticsearch/c4e1ba5e-5374-49cd-b22b-c09c3946c091%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/c4e1ba5e-5374-49cd-b22b-c09c3946c091%40googlegroups.com)  
> > [https://groups.google.com/d/msgid/elasticsearch/c4e1ba5e-5374-49cd-b22b-c09c3946c091%40googlegroups.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/c4e1ba5e-5374-49cd-b22b-c09c3946c091%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 [elasticsearc...@googlegroups.com](mailto:elasticsearc...@googlegroups.com) \<javascript:\>.  
> > To view this discussion on the web visit  
> > [https://groups.google.com/d/msgid/elasticsearch/5a5dc3a9-50e0-4060-8f96-cf13719fc5fd%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/5a5dc3a9-50e0-4060-8f96-cf13719fc5fd%40googlegroups.com)  
> > [https://groups.google.com/d/msgid/elasticsearch/5a5dc3a9-50e0-4060-8f96-cf13719fc5fd%40googlegroups.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/5a5dc3a9-50e0-4060-8f96-cf13719fc5fd%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/c6abc327-eda9-43c8-8735-c36b24470d2b%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/c6abc327-eda9-43c8-8735-c36b24470d2b%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:** [January 2, 2015, 8:39am UTC](https://discuss.elastic.co/t/have-an-issue-with-match-query/21448/6 "2015-01-02T08:39:49Z")

</div>

Do you have a doc which contains all terms?

--  
David 😉  
Twitter : @dadoonet / @elasticsearchfr / @scrutmydocs

> Le 2 janv. 2015 à 06:21, Anoop P R [anoopkumaranalloor@gmail.com](mailto:anoopkumaranalloor@gmail.com) a écrit :
> 
> Here is the mapping
> 
> {  
> "demo\_local": {  
> "mappings": {  
> "tradesman": {  
> "properties": {  
> "account\_status": {  
> "type": "boolean"  
> },  
> "business\_name": {  
> "type": "string"  
> },  
> "business\_name\_sort": {  
> "type": "string"  
> },  
> "categories": {  
> "type": "string"  
> },  
> "general\_desc": {  
> "type": "string"  
> },  
> "keywords": {  
> "type": "string"  
> },  
> "long\_descriptions": {  
> "type": "string"  
> },  
> "member\_id": {  
> "type": "string"  
> },  
> "pin": {  
> "properties": {  
> "location": {  
> "type": "geo\_point"  
> }  
> }  
> },  
> "professionalism\_rank": {  
> "type": "long"  
> },  
> "punctuality\_rank": {  
> "type": "long"  
> },  
> "recommend\_rank": {  
> "type": "long"  
> },  
> "service\_location": {  
> "type": "long"  
> },  
> "service\_titles": {  
> "type": "string"  
> },  
> "state": {  
> "type": "boolean"  
> },  
> "status": {  
> "type": "long"  
> },  
> "unique\_name": {  
> "type": "string"  
> },  
> "value\_rank": {  
> "type": "long"  
> }  
> }  
> }  
> }  
> }  
> }
> 
> > On Thursday, January 1, 2015 5:51:08 PM UTC+5:30, David Pilato wrote:  
> > Well. Hard to say without seeing your mapping and a full reproduction...
> > 
> > --  
> > David 😉  
> > Twitter : @dadoonet / @elasticsearchfr / @scrutmydocs
> > 
> > > Le 1 janv. 2015 à 12:40, Anoop P R [anoopkuma...@gmail.com](mailto:anoopkuma...@gmail.com) a écrit :
> > > 
> > > David,
> > > 
> > > Its not work for me!
> > > 
> > > Is it possible to split the keyword with whitespace and search on the fields.
> > > 
> > > Boost "0" doesn't make seance and I removed that, Thanks for the note.
> > > 
> > > > On Thursday, January 1, 2015 1:14:53 PM UTC+5:30, David Pilato wrote:  
> > > > I guess it's caused by:
> > > > 
> > > > ```
> > > > "type": "phrase_prefix"
> > > > 
> > > > ```
> > > > 
> > > > Just a note: why searching with a boost=0?
> > > > 
> > > > --  
> > > > David 😉  
> > > > Twitter : @dadoonet / @elasticsearchfr / @scrutmydocs
> > > > 
> > > > > Le 1 janv. 2015 à 08:30, Anoop P R [anoopkuma...@gmail.com](mailto:anoopkuma...@gmail.com) a écrit :
> > > > > 
> > > > > Hi,
> > > > > 
> > > > > We have an issue with the match query of Elasticsearch implementation.
> > > > > 
> > > > > Our index for categories field is as below.
> > > > > 
> > > > > "categories": [  
> > > > > "DJ’s",  
> > > > > "Entertainment Entertainment Entertainment Entertai",  
> > > > > "Allergist",  
> > > > > "Transportation Services"  
> > > > > ],
> > > > > 
> > > > > We are getting result when searched using the following input, with "query": "allergist". Please see the query below.  
> > > > > {  
> > > > > "query": {  
> > > > > "bool": {  
> > > > > "must": [  
> > > > > {  
> > > > > "term": {  
> > > > > "status": 1  
> > > > > }  
> > > > > },  
> > > > > {  
> > > > > "term": {  
> > > > > "account\_status": 1  
> > > > > }  
> > > > > }  
> > > > > ],  
> > > > > "should": {  
> > > > > "multi\_match": {  
> > > > > "query": "allergist",  
> > > > > "fields": [  
> > > > > "categories^5",  
> > > > > "service\_titles^4",  
> > > > > "keywords^3",  
> > > > > "long\_descriptions^2",  
> > > > > "general\_desc^1",  
> > > > > "business\_name^0"  
> > > > > ],  
> > > > > "type": "phrase\_prefix"  
> > > > > }  
> > > > > },  
> > > > > "minimum\_should\_match": 1  
> > > > > }  
> > > > > },  
> > > > > "sort": {  
> > > > > "recommend\_rank": {  
> > > > > "order": "desc"  
> > > > > }  
> > > > > },  
> > > > > "from": 0,  
> > > > > "size": "10"  
> > > > > }
> > > > > 
> > > > > But not getting the result when using the input with "query": "holistic allergist". Please see the query below.
> > > > > 
> > > > > {  
> > > > > "query": {  
> > > > > "bool": {  
> > > > > "must": [  
> > > > > {  
> > > > > "term": {  
> > > > > "status": 1  
> > > > > }  
> > > > > },  
> > > > > {  
> > > > > "term": {  
> > > > > "account\_status": 1  
> > > > > }  
> > > > > }  
> > > > > ],  
> > > > > "should": {  
> > > > > "multi\_match": {  
> > > > > "query": "holistic allergist",  
> > > > > "fields": [  
> > > > > "categories^5",  
> > > > > "service\_titles^4",  
> > > > > "keywords^3",  
> > > > > "long\_descriptions^2",  
> > > > > "general\_desc^1",  
> > > > > "business\_name^0"  
> > > > > ],  
> > > > > "type": "phrase\_prefix"  
> > > > > }  
> > > > > },  
> > > > > "minimum\_should\_match": 1  
> > > > > }  
> > > > > },  
> > > > > "sort": {  
> > > > > "recommend\_rank": {  
> > > > > "order": "desc"  
> > > > > }  
> > > > > },  
> > > > > "from": 0,  
> > > > > "size": "10"  
> > > > > }
> > > > > 
> > > > > I would appreciate your help on solving this issue.
> > > > > 
> > > > > ## Regards, Anoop.
> > > > > 
> > > > > 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).  
> > > > > To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/c4e1ba5e-5374-49cd-b22b-c09c3946c091%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/c4e1ba5e-5374-49cd-b22b-c09c3946c091%40googlegroups.com).  
> > > > > 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 [elasticsearc...@googlegroups.com](mailto:elasticsearc...@googlegroups.com).  
> > > To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/5a5dc3a9-50e0-4060-8f96-cf13719fc5fd%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/5a5dc3a9-50e0-4060-8f96-cf13719fc5fd%40googlegroups.com).  
> > > 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/c6abc327-eda9-43c8-8735-c36b24470d2b%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/c6abc327-eda9-43c8-8735-c36b24470d2b%40googlegroups.com).  
> 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/509BB0B1-394F-4271-AF94-A35268879E86%40pilato.fr](https://groups.google.com/d/msgid/elasticsearch/509BB0B1-394F-4271-AF94-A35268879E86%40pilato.fr).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![Anoop\_P\_R](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/anoop_p_r/32/1016_2.png) [@Anoop\_P\_R](https://discuss.elastic.co/u/Anoop_P_R)\
**Post date:** [January 2, 2015, 9:56am UTC](https://discuss.elastic.co/t/have-an-issue-with-match-query/21448/7 "2015-01-02T09:56:32Z")

</div>

Please find the attached doc for the mapping, index and query we use  
currently.

On Friday, January 2, 2015 2:10:00 PM UTC+5:30, David Pilato wrote:

> Do you have a doc which contains all terms?
> 
> --  
> David 😉  
> Twitter : @dadoonet / @elasticsearchfr / @scrutmydocs
> 
> Le 2 janv. 2015 à 06:21, Anoop P R \<[anoopkuma...@gmail.com](mailto:anoopkuma...@gmail.com) \<javascript:\>\>  
> a écrit :
> 
> Here is the mapping
> 
> {  
> "demo\_local": {  
> "mappings": {  
> "tradesman": {  
> "properties": {  
> "account\_status": {  
> "type": "boolean"  
> },  
> "business\_name": {  
> "type": "string"  
> },  
> "business\_name\_sort": {  
> "type": "string"  
> },  
> "categories": {  
> "type": "string"  
> },  
> "general\_desc": {  
> "type": "string"  
> },  
> "keywords": {  
> "type": "string"  
> },  
> "long\_descriptions": {  
> "type": "string"  
> },  
> "member\_id": {  
> "type": "string"  
> },  
> "pin": {  
> "properties": {  
> "location": {  
> "type": "geo\_point"  
> }  
> }  
> },  
> "professionalism\_rank": {  
> "type": "long"  
> },  
> "punctuality\_rank": {  
> "type": "long"  
> },  
> "recommend\_rank": {  
> "type": "long"  
> },  
> "service\_location": {  
> "type": "long"  
> },  
> "service\_titles": {  
> "type": "string"  
> },  
> "state": {  
> "type": "boolean"  
> },  
> "status": {  
> "type": "long"  
> },  
> "unique\_name": {  
> "type": "string"  
> },  
> "value\_rank": {  
> "type": "long"  
> }  
> }  
> }  
> }  
> }  
> }
> 
> On Thursday, January 1, 2015 5:51:08 PM UTC+5:30, David Pilato wrote:
> 
> > Well. Hard to say without seeing your mapping and a full reproduction...
> > 
> > --  
> > David 😉  
> > Twitter : @dadoonet / @elasticsearchfr / @scrutmydocs
> > 
> > Le 1 janv. 2015 à 12:40, Anoop P R [anoopkuma...@gmail.com](mailto:anoopkuma...@gmail.com) a écrit :
> > 
> > David,
> > 
> > Its not work for me!
> > 
> > Is it possible to split the keyword with whitespace and search on the  
> > fields.
> > 
> > Boost "0" doesn't make seance and I removed that, Thanks for the note.
> > 
> > On Thursday, January 1, 2015 1:14:53 PM UTC+5:30, David Pilato wrote:
> > 
> > > I guess it's caused by:
> > > 
> > > ```
> > > "type": "phrase_prefix"
> > > 
> > > ```
> > > 
> > > Just a note: why searching with a boost=0?
> > > 
> > > --  
> > > David 😉  
> > > Twitter : @dadoonet / @elasticsearchfr / @scrutmydocs
> > > 
> > > Le 1 janv. 2015 à 08:30, Anoop P R [anoopkuma...@gmail.com](mailto:anoopkuma...@gmail.com) a écrit :
> > > 
> > > Hi,
> > > 
> > > We have an issue with the match query of Elasticsearch implementation.
> > > 
> > > Our index for categories field is as below.
> > > 
> > > "categories": [  
> > > "DJ’s",  
> > > "Entertainment Entertainment Entertainment  
> > > Entertai",  
> > > _"Allergist_",  
> > > "Transportation Services"  
> > > ],
> > > 
> > > We are getting result when searched using the following input, with "query":  
> > > "allergist". Please see the query below.  
> > > {  
> > > "query": {  
> > > "bool": {  
> > > "must": [  
> > > {  
> > > "term": {  
> > > "status": 1  
> > > }  
> > > },  
> > > {  
> > > "term": {  
> > > "account\_status": 1  
> > > }  
> > > }  
> > > ],  
> > > "should": {  
> > > "multi\_match": {  
> > > \* "query": "allergist",\*  
> > > "fields": [  
> > > "categories^5",  
> > > "service\_titles^4",  
> > > "keywords^3",  
> > > "long\_descriptions^2",  
> > > "general\_desc^1",  
> > > "business\_name^0"  
> > > ],  
> > > "type": "phrase\_prefix"  
> > > }  
> > > },  
> > > "minimum\_should\_match": 1  
> > > }  
> > > },  
> > > "sort": {  
> > > "recommend\_rank": {  
> > > "order": "desc"  
> > > }  
> > > },  
> > > "from": 0,  
> > > "size": "10"  
> > > }
> > > 
> > > But not getting the result when using the input with "query": "holistic  
> > > allergist". Please see the query below.
> > > 
> > > {  
> > > "query": {  
> > > "bool": {  
> > > "must": [  
> > > {  
> > > "term": {  
> > > "status": 1  
> > > }  
> > > },  
> > > {  
> > > "term": {  
> > > "account\_status": 1  
> > > }  
> > > }  
> > > ],  
> > > "should": {  
> > > "multi\_match": {  
> > > \* "query": "holistic allergist",\*  
> > > "fields": [  
> > > "categories^5",  
> > > "service\_titles^4",  
> > > "keywords^3",  
> > > "long\_descriptions^2",  
> > > "general\_desc^1",  
> > > "business\_name^0"  
> > > ],  
> > > "type": "phrase\_prefix"  
> > > }  
> > > },  
> > > "minimum\_should\_match": 1  
> > > }  
> > > },  
> > > "sort": {  
> > > "recommend\_rank": {  
> > > "order": "desc"  
> > > }  
> > > },  
> > > "from": 0,  
> > > "size": "10"  
> > > }
> > > 
> > > I would appreciate your help on solving this issue.
> > > 
> > > Regards,  
> > > Anoop.
> > > 
> > > --  
> > > 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).  
> > > To view this discussion on the web visit  
> > > [https://groups.google.com/d/msgid/elasticsearch/c4e1ba5e-5374-49cd-b22b-c09c3946c091%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/c4e1ba5e-5374-49cd-b22b-c09c3946c091%40googlegroups.com)  
> > > [https://groups.google.com/d/msgid/elasticsearch/c4e1ba5e-5374-49cd-b22b-c09c3946c091%40googlegroups.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/c4e1ba5e-5374-49cd-b22b-c09c3946c091%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 [elasticsearc...@googlegroups.com](mailto:elasticsearc...@googlegroups.com).  
> > > To view this discussion on the web visit  
> > > [https://groups.google.com/d/msgid/elasticsearch/5a5dc3a9-50e0-4060-8f96-cf13719fc5fd%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/5a5dc3a9-50e0-4060-8f96-cf13719fc5fd%40googlegroups.com)  
> > > [https://groups.google.com/d/msgid/elasticsearch/5a5dc3a9-50e0-4060-8f96-cf13719fc5fd%40googlegroups.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/5a5dc3a9-50e0-4060-8f96-cf13719fc5fd%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 [elasticsearc...@googlegroups.com](mailto:elasticsearc...@googlegroups.com) \<javascript:\>.  
> > To view this discussion on the web visit  
> > [https://groups.google.com/d/msgid/elasticsearch/c6abc327-eda9-43c8-8735-c36b24470d2b%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/c6abc327-eda9-43c8-8735-c36b24470d2b%40googlegroups.com)  
> > [https://groups.google.com/d/msgid/elasticsearch/c6abc327-eda9-43c8-8735-c36b24470d2b%40googlegroups.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/c6abc327-eda9-43c8-8735-c36b24470d2b%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/e6998354-630f-43ef-ada5-16cfcce62153%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/e6998354-630f-43ef-ada5-16cfcce62153%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:41am UTC](https://discuss.elastic.co/t/have-an-issue-with-match-query/21448/8 "2017-07-06T00:41:11Z")

</div>


