Usually one will either apply synonyms at index time or apply them at query
time, but not both. I think the situation is that you will get most correct
behavior, respecting synonym graph structure, with query time synonyms.
Index time synonyms may give better performance, but at the cost of some
o
So, the below statement suggests this?
"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 TokenStreamToTermAuto
Any examples on the following note on the Javadocs at
https://lucene.apache.org/core/6_4_1/analyzers-common/org/apache/lucene/analysis/synonym/SynonymGraphFilter.html
Quoted from the above url:
*/However, if you use this during indexing, you must follow it with
FlattenGraphFilter to squash to