Hi All,
I am working on Searching parts in elasticsearch I have elasticsearch version 5.1.1 with me.the index has contains partNumbers which has values like 044-1215S etc.. and mostly it contains dots and special characters. I have built the following analyzer for this to support the criteria
PUT /test
{
"settings": {
"number_of_shards": 1,
"analysis": {
"filter": {
"ngram_filter": {
"type": "edge_ngram",
"min_gram": 2,
"max_gram": 20
}
},
"analyzer": {
"ngram_analyzer": {
"type": "custom",
"tokenizer": "standard",
"filter": [
"lowercase",
"ngram_filter"
]
}
}
}
},
"mappings": {
"p1":{
"properties": {
"partNumber":{
"type": "text",
"analyzer": "ngram_analyzer",
"search_analyzer": "standard"
}
}
}
}
}
- All my partial matches working.
- but term queries not working with hyphen it is considering at all when i checked analyzer .
can a term query will work on this ? is there any special analyzers which can work with all most of the special characters that lucene allowed.
Thanks in advance