Need Ngram_analyzer settings


#1

Hi,

Could someone help me on the below issue.

I have below field in my index,

"postalcode" : 123 456

below mapping for the field,

"postalCode": {
"type": "text",
"fields": {
"keyword": {
"type": "keyword",
"ignore_above": 256
}
},
"analyzer": "ngram_analyzer",
"search_analyzer": "standard"
}

below settings for ngram_analyzer

"settings": {
"index": {
"number_of_shards": "5",
"analysis": {
"filter": {
"ngram_filter": {
"type": "edge_ngram",
"min_gram": "2",
"max_gram": "20"
},
"ascii_filter": {
"type": "asciifolding",
"preserve_original" : true
}
},
"analyzer": {
"ngram_analyzer": {
"filter": [
"lowercase",
"ngram_filter",
"ascii_filter"
],
"type": "custom",
"tokenizer": "standard"
}
}
},
"number_of_replicas": "2"
}
}

below are my different search scenarios of postalCode field,

  1. postalCode: 12
  2. postalCode: 123456
  3. postalCode: 123 456

Please help me on how to get the document for these different search query scenarios.
All the three search scenarios should return the document which
contains postalCode : 123 456 value

Thanks,
Ram Prasad G


#2

Hi,

Any inputs or suggestions please.

Thanks,
Ram Prasad G


(system) #3

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