Typeahead using edge_ngram


#1

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.


(Luiz Santos) #2

Hi @bjd14,

I can help you with this edge_ngram thing but first I just wanna make sure you have considered Completion Suggester.

Cheers,
LG


(system) #3

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