# Multi Match query with one field of edge n-grams and another field of stemmed terms

**URL:** <https://discuss.elastic.co/t/multi-match-query-with-one-field-of-edge-n-grams-and-another-field-of-stemmed-terms/160184>\
**Category:** Elasticsearch\
**Created:** [December 10, 2018, 1:36pm UTC](https://discuss.elastic.co/t/multi-match-query-with-one-field-of-edge-n-grams-and-another-field-of-stemmed-terms/160184 "2018-12-10T13:36:03Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![marvalben](https://avatars.discourse-cdn.com/v4/letter/m/4da419/32.png) [@marvalben](https://discuss.elastic.co/u/marvalben)\
**Post date:** [December 10, 2018, 1:36pm UTC](https://discuss.elastic.co/t/multi-match-query-with-one-field-of-edge-n-grams-and-another-field-of-stemmed-terms/160184/1 "2018-12-10T13:36:03Z")

</div>

Hi All,

Been doing a lot of research and I think I may have a solution, but I’m looking for some “best practice” advise!

I have a document with 2 fields (name and description). Both fields use the standard tokeniser but differ in their filters. The name field uses edge ngrams to provide search as you type results. The description field uses porter stem to reduce terms to their roots. Let’s assume any other filters are common to both fields.

I want to use a multi match query to search across both fields (i.e. a cross fields search). So I need to choose an appropriate search analyser for both fields (to avoid the best/most fields scoring problems).

So do I stem in the search analyser? I guess I have to otherwise I won’t find the stemmed terms in the description field. Is this compatible with edge ngrams for the name field? Logically I think it is because the stemmed term is (probably?) a prefix of the original and will have matches in both fields. Does this differ per language?

An alternate approach might be to use the keyword repeat token filter at search time and OR the terms in the same position:

“I like cats” would become “I AND like AND (cats OR cat)”.

Does Elasticsearch support that kind of query?

Any advise would be great!

Thanks.  
Ben

---

<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:** [January 7, 2019, 1:36pm UTC](https://discuss.elastic.co/t/multi-match-query-with-one-field-of-edge-n-grams-and-another-field-of-stemmed-terms/160184/2 "2019-01-07T13:36:06Z")

</div>

Closed on January 7, 2019, 1:36pm UTC

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
