I'm trying to create an index for an e-commerce site an would like my index to work for typo/mispellings and for synonyms. Actually I am testing with these settings.
{
"settings": {
"index" : {
"analysis" : {
"analyzer" : {
"synonym_analyzer" : {
"tokenizer" : "standard",
"char_filter": [
"html_strip"
],
"filter" : [
"lowercase",
"synonym_filter",
"italian_stop",
"asciifolding",
"custom_length",
"custom_ngram",
"custom_shingle"
]
}
},
"filter" : {
"synonym_filter" : {
"type" : "synonym",
"synonyms_path" : "analysis/synonym.txt"
},
"custom_length":
{
"type": "length",
"min": 2,
"max": 255
},
"custom_ngram":
{
"type": "ngram",
"min_gram": 3,
"max_gram": 12,
"token_chars": [
"letter",
"digit"
]
},
"custom_shingle":
{
"type":"shingle",
"max_shingle_size":4,
"min_shingle_size":2,
"output_unigrams":"true"
},
"italian_stop": {
"type": "stop",
"stopwords": "_italian_"
}
}
}
}
},
"mappings": {
"product": {
"properties": {
"pname": {
"type": "text",
"analyzer": "synonym_analyzer"
},
"shortdesc": {
"type": "text",
"analyzer": "synonym_analyzer"
},
"desc": {
"type": "text",
"analyzer": "synonym_analyzer"
},
"mname": {
"type": "text",
"analyzer": "synonym_analyzer"
}
}
}
}
}
In this case my synonyms are working good, but I can't get typo or mispellings to work.
Let's say my indexed product name is "rilastil", if I search for "rilastol" I can't get any results.
If I remove mappings from the index settings:
{
"settings": {
"index" : {
"analysis" : {
"analyzer" : {
"synonym_analyzer" : {
"tokenizer" : "standard",
"char_filter": [
"html_strip"
],
"filter" : [
"lowercase",
"synonym_filter",
"italian_stop",
"asciifolding",
"custom_length",
"custom_ngram",
"custom_shingle"
]
}
},
"filter" : {
"synonym_filter" : {
"type" : "synonym",
"synonyms_path" : "analysis/synonym.txt"
},
"custom_length":
{
"type": "length",
"min": 2,
"max": 255
},
"custom_ngram":
{
"type": "ngram",
"min_gram": 3,
"max_gram": 12,
"token_chars": [
"letter",
"digit"
]
},
"custom_shingle":
{
"type":"shingle",
"max_shingle_size":4,
"min_shingle_size":2,
"output_unigrams":"true"
},
"italian_stop": {
"type": "stop",
"stopwords": "_italian_"
}
}
}
}
}
}
I can't get synonyms to work, but my typo/misspellings are working fine.
Can someone help me with this issue? Any help would ber really appreciated