# Elasticsearch match\_phrase\_prefix Vs wild card

**URL:** <https://discuss.elastic.co/t/elasticsearch-match-phrase-prefix-vs-wild-card/170559>\
**Category:** Elasticsearch\
**Created:** [March 1, 2019, 8:08pm UTC](https://discuss.elastic.co/t/elasticsearch-match-phrase-prefix-vs-wild-card/170559 "2019-03-01T20:08:34Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![pak\_es](https://avatars.discourse-cdn.com/v4/letter/p/7feea3/32.png) [@pak\_es](https://discuss.elastic.co/u/pak_es)\
**Post date:** [March 1, 2019, 8:08pm UTC](https://discuss.elastic.co/t/elasticsearch-match-phrase-prefix-vs-wild-card/170559/1 "2019-03-01T20:08:34Z")

</div>

This query use phrase prefix and returns 5k records

```auto
POST index/_search
{
  "from": 0,
  "size": 10,
  "query": {
    "match_phrase_prefix": {
      "Identifiers.Identifier.$": {
        "query": "nct"
        "max_expansions": 1024

      }
    }
  }
}

```

When I use following query with wild card it gives me 200K results

```auto
GET index/_search
{
  "from": 0,
  "size": 10,
  "query": {
    "query_string": {
      "fields": [
        "Identifiers.Identifier.$"
      ],
      "query": "nct*",
      "analyze_wildcard": true,
      "boost": 2
    }
  }
}

```

Most of my values in Identifiers has NCT in it , why do I see such a big difference in both these results ?

---

<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:** [March 29, 2019, 8:08pm UTC](https://discuss.elastic.co/t/elasticsearch-match-phrase-prefix-vs-wild-card/170559/2 "2019-03-29T20:08:42Z")

</div>

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