Hello there,
I am currently trying out the synonym filter. Here are my settings:
"settings": {
"analysis": {
"filter": {
"nGram_filter": {
"type": "nGram",
"min_gram": 2,
"max_gram": 15
},
"synonym": {
"type": "synonym",
"synonyms_path" : "analysis/synonym.txt",
"ignore_case": true,
"expand": true
}
},
"analyzer": {
"synonym_analyzer": {
"type":"custom",
"tokenizer": "whitespace",
"filter": [
"synonym",
"lowercase",
"asciifolding"
]
}
}
}
}
In the synonym.txt file I have the following line:
Inbus, Innensechskant, Imbus
When I test the analyzer, I get the following results (output is
reformatted for ease of reading). It seems the synonym analyzer only does
its job when the "synonym" word is surrounded by other words
localhost:9200/index_v1/_analyze?analyzer=synonym_analyzer
--input: 'Inbus'
--output: inbus
localhost:9200/index_v1/_analyze?analyzer=synonym_analyzer
--input: 'Der Inbus'
--output: 'der inbus'
localhost:9200/index_v1/_analyze?analyzer=synonym_analyzer
--input: 'Der Inbus ist'
--output: 'der inbus innensechskant imbus ist'
Could anyone please explain why it behaves like this and how to implement
this correctly?
Big thanks in advance!
--
You received this message because you are subscribed to the Google Groups "elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elasticsearch+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/c843106e-be78-4d4c-9101-2c73720b4062%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.