# Prefix with multi\_match

**URL:** <https://discuss.elastic.co/t/prefix-with-multi-match/103606>\
**Category:** Elasticsearch\
**Created:** [October 11, 2017, 7:34pm UTC](https://discuss.elastic.co/t/prefix-with-multi-match/103606 "2017-10-11T19:34:18Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Paddy\_Mahadeva](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/paddy_mahadeva/32/44225_2.png) [@Paddy\_Mahadeva](https://discuss.elastic.co/u/Paddy_Mahadeva)\
**Post date:** [October 11, 2017, 7:34pm UTC](https://discuss.elastic.co/t/prefix-with-multi-match/103606/1 "2017-10-11T19:34:18Z")

</div>

Hi,

I am running the below search query on my index

```
{
  "_source": "false", 
  "query": {
    "bool": {
      "must": [
        {
          "multi_match": {
            "fields": ["email","name", "company", "phone"],
            "query": "tes",
            "type" : "phrase_prefix"
          }
        }
      ]
    }
  },
  "highlight": {
    "fields": {"name": {}, "company" : {}, "email" : {}, "phone" : {}}
  }
}

```

I have some sample data with the field values  
name: test paddy  
name : test user  
name : test logger  
name : test

When I run the above query, I do not get any results, but when I change it to `"query": "test"`, I start seeing 1 result "test". I was expecting to see in both cases all the above names that i have. Am I missing something here?

---

<div class="post-metadata">

**Author:** ![Paddy\_Mahadeva](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/paddy_mahadeva/32/44225_2.png) [@Paddy\_Mahadeva](https://discuss.elastic.co/u/Paddy_Mahadeva)\
**Post date:** [October 12, 2017, 1:28pm UTC](https://discuss.elastic.co/t/prefix-with-multi-match/103606/2 "2017-10-12T13:28:57Z")

</div>

Hi,

I noticed that multi\_match with prefix is working with text fields, but fails with keywords, long fields etc Also, when I tried

```
{ "query": {
    "prefix" : { "phone" : 99 }
  }
}

```

with number fields and keyword fields its working.

So is it like multi\_match and prefix don't work well with keyword and number fields?

---

<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:** [November 9, 2017, 1:29pm UTC](https://discuss.elastic.co/t/prefix-with-multi-match/103606/3 "2017-11-09T13:29:09Z")

</div>

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