lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gtkesh <>
Subject Injecting custom synonyms in Lucene
Date Fri, 12 Jul 2013 19:27:30 GMT
Hi everyone! 

I tried to inject the synonyms during indexing. I created a custom analyzer.
It pretty much does the same as a standard analyzer with an addition of
having synonym filter. During indexing and searching, I pass this custom
analyzer to both indexwriter and indexsearcher, but the results do not seem
to be different so I’m guessing I must have made a mistake somewhere. So
basically what happens in custom analyzer’s constructor is that it just
reads the synonyms.txt file and creates SynonymMap and then I’m overriding
TokenStreamComponents method of an Analyzer class where I pass newly created
SynonymMap in the SynonymFilter. What am I doing wrong?    If you’d like to
have a look at the code, here it is:

I'd appreciate your suggestions. Thanks in advance!

View this message in context:
Sent from the Lucene - Java Users mailing list archive at

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message