When playing around with various schemes for implementing synonyms, I'll occasionally get 400s when trying to create the index, with the message 'failed to build synonyms'.
Below are settings that replicate the issue:
{ "settings" : { "index" : { "analysis" : { "analyzer" : { "custom_analyzer" : { "tokenizer" : "whitespace", "filter" : [ "syn_filter_1", "syn_filter_2" ], "type" : "custom" } }, "filter" : { "syn_filter_1" : { "type" : "synonym", "synonyms" : [ "foo => foo, bar" ] }, "syn_filter_2": { "type": "synonym", "synonyms": [ "baz => foo" ] } } } } } }
I have a few questions:
- What's wrong with the synonym graph that this generates?
- Are there any general principles I need to follow to avoid errors like this? I imagine issues like this could be difficult to debug in larger files.
- Is there an easy way to get a more detailed summary of why synonyms would fail to build, or at least which lines of text are problematic?