# Edge Ngram not working on querying all fields

**URL:** <https://discuss.elastic.co/t/edge-ngram-not-working-on-querying-all-fields/88469>\
**Category:** Elasticsearch\
**Created:** [June 6, 2017, 8:42pm UTC](https://discuss.elastic.co/t/edge-ngram-not-working-on-querying-all-fields/88469 "2017-06-06T20:42:10Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![munotshubham](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/munotshubham/32/22663_2.png) [@munotshubham](https://discuss.elastic.co/u/munotshubham)\
**Post date:** [June 6, 2017, 8:42pm UTC](https://discuss.elastic.co/t/edge-ngram-not-working-on-querying-all-fields/88469/1 "2017-06-06T20:42:10Z")

</div>

Hi,

I'm trying to implement search-as-you-type

```
PUT my_index
{
  "settings": {
    "analysis": {
      "analyzer": {
        "autocomplete": {
          "tokenizer": "autocomplete",
          "filter": [
            "lowercase"
          ]
        },
        "autocomplete_search": {
          "tokenizer": "lowercase"
        }
      },
      "tokenizer": {
        "autocomplete": {
          "type": "edge_ngram",
          "min_gram": 2,
          "max_gram": 10,
          "token_chars": [
            "letter"
          ]
        }
      }
    }
  },
  "mappings": {
    "doc": {
      "properties": {
        "firstname": {
          "type": "text",
          "analyzer": "autocomplete",
          "search_analyzer": "autocomplete_search"
        }
      }
    }
  }
}

```

**my\_index has other fields as well.**

Now when I try to query:

```
GET patientdb/_search
{
  "query": {
    "match": {
      "_all": "charl"
    }
  }
}

```

It will give me no output.  
But when I query just the firstname

```
GET patientdb/_search
{
  "query": {
    "match": {
      "firstname": "charl"
    }
  }
}

```

It gives me "Charles"

What should I do?

---

<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 4, 2017, 8:42pm UTC](https://discuss.elastic.co/t/edge-ngram-not-working-on-querying-all-fields/88469/2 "2017-07-04T20:42:22Z")

</div>

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