# Match pharse prefix acts strange

**URL:** https://discuss.elastic.co/t/match-pharse-prefix-acts-strange/38608
**Category:** Elasticsearch
**Created:** [January 7, 2016, 11:46am UTC](https://discuss.elastic.co/t/match-pharse-prefix-acts-strange/38608 "2016-01-07T11:46:23Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![lalitha](https://avatars.discourse-cdn.com/v4/letter/l/c6cbf5/32.png) [@lalitha](https://discuss.elastic.co/u/lalitha)
#### Post date: [January 7, 2016, 11:46am UTC](https://discuss.elastic.co/t/match-pharse-prefix-acts-strange/38608/1 "2016-01-07T11:46:23Z")

</div>

I have two documents with same content like

```auto
"hits": [
         {
            "_index": "testbyprogrammer",
            "_type": "type1",
            "_id": "1",
            "_score": 0.095891505,
            "_source": {
               "msg": "Huegli Bioforce Trocomare Sea Salt with Vegetables and Herbs"
            }
         },
         {
            "_index": "testbyprogrammer",
            "_type": "type1",
            "_id": "2",
            "_score": 0.095891505,
            "_source": {
               "msg": "Huegli Bioforce Trocomare Sea Salt with Vegetables and Herbs"
            }
         }
      ]

```

When i search like this

```auto
POST testbyprogrammer/type1/_search
{
    "query": {
        "match_phrase_prefix": {
           "msg": "bio"
        }
    }
}

```

It only returns one document.But when i use like

```auto
POST testbyprogrammer/type1/_search
{
    "query": {
        "match_phrase_prefix": {
           "msg": "biof"
        }
    }
}

```

it returns two records

Shall i know the reason?

---

<div class="post-metadata">

### Author: ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)
#### Post date: [January 8, 2016, 9:29am UTC](https://discuss.elastic.co/t/match-pharse-prefix-acts-strange/38608/2 "2016-01-08T09:29:18Z")

</div>

A full script, including mapping would help IMO.

---

<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 5, 2017, 11:26pm UTC](https://discuss.elastic.co/t/match-pharse-prefix-acts-strange/38608/3 "2017-07-05T23:26:06Z")

</div>


