# How to combine completion, suggestion and match phrase across multiple text fields?

**URL:** https://discuss.elastic.co/t/how-to-combine-completion-suggestion-and-match-phrase-across-multiple-text-fields/235859
**Category:** Elasticsearch
**Created:** [June 4, 2020, 10:58pm UTC](https://discuss.elastic.co/t/how-to-combine-completion-suggestion-and-match-phrase-across-multiple-text-fields/235859 "2020-06-04T22:58:27Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![rpm1984](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/rpm1984/32/36595_2.png) [@rpm1984](https://discuss.elastic.co/u/rpm1984)
#### Post date: [June 4, 2020, 10:58pm UTC](https://discuss.elastic.co/t/how-to-combine-completion-suggestion-and-match-phrase-across-multiple-text-fields/235859/1 "2020-06-04T22:58:27Z")

</div>

Hi there, as the title suggests (no pun intended!), i'm trying to combine a few things in a single Elasticsearch query.

Here's a google screenshot to show what i'm trying to do:  
 ![](https://us1.discourse-cdn.com/elastic/original/3X/b/4/b49b260e39b4c5617a90c261f3393c27ce786920.png)

So when we start typing "can", it lists word like canadian, canada, etc. This is **auto complete.** However it lists additional words also like tire, post, post tracking, coronavirus etc. This is **auto suggest**. It searches for most relevant word in all fields. If we type "canxda" it should also show results. This is **fuzziness**. You'll note it's only prefix-based. I don't need to match the middle of a phrase.

Now, no idea if my terminology is right there, but i hope it explains what i'm trying to achieve.

The other curve ball is i have 8 seperate **text** fields. One of those fields is content, with HTML etc.. so it has around 1000+ words. I'm thinking i need to combine all these fields into a single **text** field, and search on that? (e.g with "copy\_to")

I've read so many posts, tried so many things (match phrase prefix, ngram/edge n-gram, shingles), but nothing seems to work. Either the post i'm reading is on and older version of Elasticsearch (i'm on 7.2), or it's not the same as my situation.

So to summarise:

- Need completion, suggestion, and fuzziness for phrases
- Searching across multiple text fields

Could someone please point me in the right direction? Ideally, with some sample code, as i'm fairly new to the analyzer/FTS side of things.

Many thanks, i've been stuck on this for days and days, and would really appreciate any help 🙂

---

<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 2, 2020, 11:10pm UTC](https://discuss.elastic.co/t/how-to-combine-completion-suggestion-and-match-phrase-across-multiple-text-fields/235859/2 "2020-07-02T23:10:14Z")

</div>

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