# Best approach to multi-word search as you type

**URL:** https://discuss.elastic.co/t/best-approach-to-multi-word-search-as-you-type/266826
**Category:** Elasticsearch
**Created:** [March 10, 2021, 3:00pm UTC](https://discuss.elastic.co/t/best-approach-to-multi-word-search-as-you-type/266826 "2021-03-10T15:00:51Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![tbzl](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/tbzl/32/85328_2.png) [@tbzl](https://discuss.elastic.co/u/tbzl)
#### Post date: [March 10, 2021, 3:00pm UTC](https://discuss.elastic.co/t/best-approach-to-multi-word-search-as-you-type/266826/1 "2021-03-10T15:00:51Z")

</div>

Hi,

I would like to add some sort of "search as you type" functionality but have been struggling to find the right one.

Say I have the following product name:

**Some Brand Sweater Striped Green**

What would be the best method to find this product when the user is at "sweater gre"?

```auto
    "multi_match": {
        "query": "sweater gre",
        "type": "bool_prefix",
        "fields": [
            "name"
        ]
    }

```

This will give me products called just "Sweater" first; then the product I'm looking for; and after that other products that only include "sweater" and not "gre".

---

<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: [April 7, 2021, 3:01pm UTC](https://discuss.elastic.co/t/best-approach-to-multi-word-search-as-you-type/266826/2 "2021-04-07T15:01:34Z")

</div>

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