Fail index analyzer that contains a graph token filter
#24,396 opened on 2017年4月28日
説明
Currently it is possible to set a synonym_graph or a word_delimiter_graph token filter in an analyzer that is used at index time. Though these filters can produce side-paths that will break the positions in the index and make phrase query matching impossible on the field.
The flatten_graph token filter is supposed to handle this situation but it can only flatten the graph which is also a lossy operation. So whether the user adds a flatten_graph filter at the end of the analyzer or not the positions of the terms in the index will not be accurate.
Instead we could try to detect these situation and fail the mapping if a graph filter is used in an index analyzer. This would allow us to remove the flatten_graph filter and also help users to not shoot themselves in the foot.
Here is an hopefully exhaustive list of token filters that should be impacted by this:
synonym_graph_filterword_delimiter_graph_filtershingles(only whenoutput_unigram:trueormin_size<max_size)cjk(only whenoutput_unigram:true)ngramtokenizer whenmin_gram < max_gramcommon_gramkuromoji_tokenizerwhen (nbest_cost or nbest_example > 1).