# Multi\_match query spanning multiple analyzer fields

**URL:** <https://discuss.elastic.co/t/multi-match-query-spanning-multiple-analyzer-fields/19951>\
**Category:** Elasticsearch\
**Created:** [September 24, 2014, 8:22pm UTC](https://discuss.elastic.co/t/multi-match-query-spanning-multiple-analyzer-fields/19951 "2014-09-24T20:22:38Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Mike\_Topper1](https://avatars.discourse-cdn.com/v4/letter/m/7bcc69/32.png) [@Mike\_Topper1](https://discuss.elastic.co/u/Mike_Topper1)\
**Post date:** [September 24, 2014, 8:22pm UTC](https://discuss.elastic.co/t/multi-match-query-spanning-multiple-analyzer-fields/19951/1 "2014-09-24T20:22:38Z")

</div>

Hello,

I'm trying to come up with a query that will search multiple fields, using  
the 'and' operator and the cross\_fieds type. My goal is that a search for  
"quick brown fox" will match documents where all 3 of those words are found  
but not necessarily in the same field. This works fine if the field list i  
give the multi\_match query are all the same analyzer, although does NOT  
work when some of the fields are different analyzers. I've read in the  
documentation that this is because ES will group by analyzer and then do a  
bool query.

Is there some other query/parameter that would allow me to do what I want  
here? I'm currently not worried about the scoring and just the matching if  
that makes any difference.

-Mike

--  
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/CALdNed%2BXtfHSKX8QqRuA8FB8vrajW-ECxk1cGOX24nTZF%3D5%2BBg%40mail.gmail.com](https://groups.google.com/d/msgid/elasticsearch/CALdNed%2BXtfHSKX8QqRuA8FB8vrajW-ECxk1cGOX24nTZF%3D5%2BBg%40mail.gmail.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![Anne\_Veling](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/anne_veling/32/1260_2.png) [@Anne\_Veling](https://discuss.elastic.co/u/Anne_Veling)\
**Post date:** [September 25, 2014, 1:52pm UTC](https://discuss.elastic.co/t/multi-match-query-spanning-multiple-analyzer-fields/19951/2 "2014-09-25T13:52:55Z")

</div>

You could use a "text\_query" query type, and enable dis-max, or use the  
dis\_max query type; that will return the "best" documents for multiple  
fields and multiple words, as you seem to describe

Anne

On Wed, Sep 24, 2014 at 10:22 PM, Mike Topper [topper@gmail.com](mailto:topper@gmail.com) wrote:

> Hello,
> 
> I'm trying to come up with a query that will search multiple fields, using  
> the 'and' operator and the cross\_fieds type. My goal is that a search for  
> "quick brown fox" will match documents where all 3 of those words are found  
> but not necessarily in the same field. This works fine if the field list i  
> give the multi\_match query are all the same analyzer, although does NOT  
> work when some of the fields are different analyzers. I've read in the  
> documentation that this is because ES will group by analyzer and then do a  
> bool query.
> 
> Is there some other query/parameter that would allow me to do what I want  
> here? I'm currently not worried about the scoring and just the matching if  
> that makes any difference.
> 
> -Mike
> 
> --  
> 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/CALdNed%2BXtfHSKX8QqRuA8FB8vrajW-ECxk1cGOX24nTZF%3D5%2BBg%40mail.gmail.com](https://groups.google.com/d/msgid/elasticsearch/CALdNed%2BXtfHSKX8QqRuA8FB8vrajW-ECxk1cGOX24nTZF%3D5%2BBg%40mail.gmail.com)  
> [https://groups.google.com/d/msgid/elasticsearch/CALdNed%2BXtfHSKX8QqRuA8FB8vrajW-ECxk1cGOX24nTZF%3D5%2BBg%40mail.gmail.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/CALdNed%2BXtfHSKX8QqRuA8FB8vrajW-ECxk1cGOX24nTZF%3D5%2BBg%40mail.gmail.com?utm_medium=email&utm_source=footer)  
> .  
> For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

--  
Anne Veling  
[BeyondTrees.com](http://BeyondTrees.com)  
+31 6 50 969 170  
@anneveling

--  
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/CAAwWRiK5KWmt%2B-Wb6N8vwtZuFGAT-%2BiW\_4QEWXpJPUCi4BzLLw%40mail.gmail.com](https://groups.google.com/d/msgid/elasticsearch/CAAwWRiK5KWmt%2B-Wb6N8vwtZuFGAT-%2BiW_4QEWXpJPUCi4BzLLw%40mail.gmail.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:59am UTC](https://discuss.elastic.co/t/multi-match-query-spanning-multiple-analyzer-fields/19951/3 "2017-07-06T00:59:59Z")

</div>


