OpenSearch/x-pack
Alan Woodward 5107949402
Allow TokenFilterFactories to rewrite themselves against their preceding chain (#33702)
We currently special-case SynonymFilterFactory and SynonymGraphFilterFactory, which need to 
know their predecessors in the analysis chain in order to correctly analyze their synonym lists. This
special-casing doesn't work with Referring filter factories, such as the Multiplexer or Conditional
filters. We also have a number of filters (eg the Multiplexer) that will break synonyms when they
appear before them in a chain, because they produce multiple tokens at the same position.

This commit adds two methods to the TokenFilterFactory interface.

* `getChainAwareTokenFilterFactory()` allows a filter factory to rewrite itself against its preceding
  filter chain, or to resolve references to other filters. It replaces `ReferringFilterFactory` and
  `CustomAnalyzerProvider.checkAndApplySynonymFilter`, and by default returns `this`.
* `getSynonymFilter()` defines whether or not a filter should be applied when building a synonym
  list `Analyzer`. By default it returns `true`.

Fixes #33609
2018-09-19 15:52:14 +01:00
..
dev-tools Build: Merge xpack checkstyle config into core (#33399) 2018-09-05 09:17:02 -04:00
docs Docs: Fixed a grammatical mistake: 'a HTTP ...' -> 'an HTTP ...' (#33744) 2018-09-17 15:35:54 -04:00
license-tools Build: Rework shadow plugin configuration (#32409) 2018-08-21 20:03:28 -04:00
plugin Allow TokenFilterFactories to rewrite themselves against their preceding chain (#33702) 2018-09-19 15:52:14 +01:00
protocol Test fix - Graph connections could appear in different orders 2018-09-19 15:16:14 +01:00
qa SQL: Fix issue with options for QUERY() and MATCH(). (#33828) 2018-09-19 10:16:24 +02:00
test Build: Rework shadow plugin configuration (#32409) 2018-08-21 20:03:28 -04:00
transport-client Run forbidden api checks with runtimeJavaVersion (#32947) 2018-08-22 09:05:22 +03:00
NOTICE.txt
README.md
build.gradle Build: Merge xpack checkstyle config into core (#33399) 2018-09-05 09:17:02 -04:00

README.md

Elastic License Functionality

This directory tree contains files subject to the Elastic License. The files subject to the Elastic License are grouped in this directory to clearly separate them from files licensed under the Apache License 2.0.