# Prefix Search

**URL:** https://discuss.elastic.co/t/prefix-search/273324
**Category:** Elastic Search
**Tags:** elastic-app-search
**Created:** [May 18, 2021, 4:58pm UTC](https://discuss.elastic.co/t/prefix-search/273324 "2021-05-18T16:58:44Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![pesc](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/pesc/32/82536_2.png) [@pesc](https://discuss.elastic.co/u/pesc)
#### Post date: [May 18, 2021, 4:58pm UTC](https://discuss.elastic.co/t/prefix-search/273324/1 "2021-05-18T16:58:44Z")

</div>

Hi

Is it possible to use a PrefixSearch with Appsearch?

With Elasticsearch it's easy. Something like that:

```auto
{
  "query": {
    "match_phrase_prefix": {
      "aaaa_record$string": {
        "query": "2a02:168:2132:"
      }
    }
  }
}

```

or

```auto
{
  "query": {
    "prefix": {
      "aaaa_record$string": {
        "value": "2a02:168:2132:"
      }
    }
  }
}

```

Any idea how to use it with AppSearch?

---

<div class="post-metadata">

### Author: ![ross.bell](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ross.bell/32/77559_2.png) [@ross.bell](https://discuss.elastic.co/u/ross.bell)
#### Post date: [May 24, 2021, 6:55pm UTC](https://discuss.elastic.co/t/prefix-search/273324/2 "2021-05-24T18:55:00Z")

</div>

Hey @pesc,

There's no current way to explicitly use a prefix search. However, matching on the prefix of a field should still work in most cases. What version of App Search are you running? This behavior was slightly changed in [7.12](https://www.elastic.co/guide/en/enterprise-search/current/release-notes-7.12.0.html), although the intent was actually to improve typo-tolerance.

Ross

---

<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: [June 21, 2021, 6:55pm UTC](https://discuss.elastic.co/t/prefix-search/273324/3 "2021-06-21T18:55:37Z")

</div>

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