# Typeahead using edge\_ngram

**URL:** <https://discuss.elastic.co/t/typeahead-using-edge-ngram/112021>\
**Category:** Elasticsearch\
**Created:** [December 15, 2017, 5:06pm UTC](https://discuss.elastic.co/t/typeahead-using-edge-ngram/112021 "2017-12-15T17:06:03Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![bjd14](https://avatars.discourse-cdn.com/v4/letter/b/e5b9ba/32.png) [@bjd14](https://discuss.elastic.co/u/bjd14)\
**Post date:** [December 15, 2017, 5:06pm UTC](https://discuss.elastic.co/t/typeahead-using-edge-ngram/112021/1 "2017-12-15T17:06:03Z")

</div>

I'm using edge\_ngram for an auto-complete in a text box of course.

The index I'm trying to convert to a typeaheadable index

```
          "Code" : {
           "type" : "text",
             "fields" : {
                "sortField" : {
                   "analyzer" : "case_insensitive_sort",
                   "type" : "text",
                   "fielddata" : true
               },
              "myLabel" : {
                "type" : "keyword"
              }
          }
      }

```

I'm trying to use the following

```
     "Code" : {
      "type": "text",
      "fields": {
        "sortField": {
          "analyzer": "case_insensitive_sort",
          "type": "text",
          "fielddata": true
        },
        "myLabel": {
          "type": "keyword"
        },
        "edge_ngram": {
          "search_analyzer": "lowercase_search_analyzer",
          "analyzer": "edge_ngram_analyzer",
          "type": "text"
        }
      }
  }

```

To be able to make just the text of this field able to use the edge\_ngram does there need to be another field to access the ngrams EX: code.typeaheadLabel.edge\_ngram? Or access 'myLabel' directly with code.myLabel.edge\_ngram?

Right now I have been trying to access them by using code.edge\_ngram.

---

<div class="post-metadata">

**Author:** ![luiz.santos](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/luiz.santos/32/24664_2.png) [@luiz.santos](https://discuss.elastic.co/u/luiz.santos)\
**Post date:** [December 22, 2017, 3:57pm UTC](https://discuss.elastic.co/t/typeahead-using-edge-ngram/112021/2 "2017-12-22T15:57:08Z")

</div>

Hi @bjd14,

I can help you with this edge\_ngram thing but first I just wanna make sure you have considered [Completion Suggester](https://www.elastic.co/guide/en/elasticsearch/reference/current/search-suggesters-completion.html).

Cheers,  
LG

---

<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:** [January 19, 2018, 3:57pm UTC](https://discuss.elastic.co/t/typeahead-using-edge-ngram/112021/3 "2018-01-19T15:57:19Z")

</div>

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