hello everyone
I would like to know how to add search by synonym. In fact I use my definition of analyzers in a class instead of annotatins when instantiating and I had a problem with SynonymFilter(streams.result, SynonymMap), what is the SynonymMap :
Code:
@Override
public TokenStream reusableTokenStream(String fieldName, Reader reader) throws IOException {
SavedStreams streams = (SavedStreams) getPreviousTokenStream();
if (streams == null) {
streams = new SavedStreams();
streams.source = new StandardTokenizer(matchVersion, reader);
streams.result = new StandardFilter(streams.source);
streams.result = new LowerCaseFilter(streams.result);
streams.result = new SnowballFilter(streams.result, name);
streams.result = new SynonymFilter(streams.result, SynonimMap);
setPreviousTokenStream(streams);
} else {
streams.source.reset(reader);
}
return streams.result;
}
thx