SynonymMapto an incoming
TokenStream, producing a fully correct graph output. This is a replacement for
SynonymFilter, which produces incorrect graphs for multi-token synonyms.
However, if you use this during indexing, you must follow it with
to squash tokens on top of one another like
SynonymFilter, because the indexer can't
directly consume a graph. To get fully correct positional queries when your synonym replacements
are multiple tokens, you should instead apply synonyms using this
TokenFilter at query
time and translate the resulting graph to a
TermAutomatonQuery e.g. using
NOTE: this cannot consume an incoming graph; results will be undefined.
- WARNING: This API is experimental and might change in incompatible ways in the next release.
Nested Class Summary
Methods inherited from class org.apache.lucene.util.AttributeSource
addAttribute, addAttributeImpl, captureState, clearAttributes, cloneAttributes, copyTo, endAttributes, equals, getAttribute, getAttributeClassesIterator, getAttributeFactory, getAttributeImplsIterator, hasAttribute, hasAttributes, hashCode, reflectAsString, reflectWith, removeAllAttributes, restoreState, toString
SynonymGraphFilterApply previously built synonyms to incoming tokens.