Special characters for ngram


(adi) #1

{
"template" : "spectre*",
"settings": {
"analysis": {
"filter": {
"custom_filter": {
"type": "mapping",
"mappings": [
"& => ALPHA"
]
}
},
"analyzer" : {
"autocomplete" : {
"tokenizer" : "autocomplete_tokenizer",
"filter" : [
"uppercase"
]
},
"autocomplete_search" : {
"tokenizer" : "standard",
"filter" : [
"uppercase",
"custom_filter"
]
},
"comma" : {
"tokenizer": "comma_tokenizer"
}
},
"tokenizer" : {
"autocomplete_tokenizer" : {
"type" : "edge_ngram",
"min_gram" : 1,
"max_gram" : 20,
"token_chars" : [
"letter",
"digit",
"symbol",
"punctuation"
]
},
"comma_tokenizer" : {
"type": "pattern",
"pattern": ","
}
}
},
"index.refresh_interval" : "5s",
"index.max_result_window" : "1000000"
},
"mappings" : {
"default" : {
"_all" : { "enabled" : false },
"dynamic_templates" : [ {
"strings_as_keywords" : {
"match" : "*",
"match_mapping_type" : "string",
"mapping" : {
"type" : "text",
"norms" : false,
"fields" : {
"keyword" : {
"type" : "keyword"
}
}
}
}
} ]
},
"company" : {
"properties" : {
"entityId": {
"type": "text",
"boost": 3,
"fields": {
"keyword": {
"type": "keyword"
}
}
},
"entityTypeId" : {
"type" : "text",
"analyzer": "comma"
},
"name" : {
"type" : "text",
"boost": 2,
"analyzer" : "autocomplete",
"search_analyzer" : "autocomplete_search",
"fields" : {
"keyword" : {
"type" : "keyword"
}
}
},
"nameAlt" : {
"type" : "text",
"analyzer" : "autocomplete",
"search_analyzer" : "autocomplete_search",
"fields" : {
"keyword" : {
"type" : "keyword"
}
}
},
"rssdId": {
"type": "text",
"boost": 4,
"fields": {
"keyword": {
"type": "keyword"
}
}
},
"ticker" : {
"type" : "text",
"boost": 4,
"analyzer" : "autocomplete_search",
"search_analyzer" : "autocomplete_search",
"fields" : {
"keyword" : {
"type" : "keyword"
}
}
}
}
}
}
}

This index is not loading when try to create index, usecase is to do text search, tokenized with special characters like (, ) and &


(system) #2

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