Ok, This is the method that adds the aliases, it is located in my SynonymFilter:
private void addAliasesToStack(Token token) { String[] synonyms = engine.getSynonyms("contents", token.termText()); if (synonyms == null) { return; } for (int i = 0; i < synonyms.length; i++) { Token synToken = new Token(synonyms[i], token.startOffset(), token.endOffset(), token.type()); synToken.setPositionIncrement(0); modelSynonymStack.push(synToken); } } And at the Search class, the query is done like that: Query query = new QueryParser("contents", new SynonymAnalyzer()).parse(keyword); And the return is: contents:"(wind window)" And no hit... -----Original Message----- From: Daniel Naber [mailto:[EMAIL PROTECTED] Sent: terça-feira, 5 de dezembro de 2006 18:58 To: java-user@lucene.apache.org Subject: Re: Customized Analyzer On Tuesday 05 December 2006 21:37, Alice wrote: > It does not work. > > Even with the synonyms indexed it is not found. So if your text contains "wind" it is not found by the query that prints as content:"(wind window)"? Then I suggest you post a small test case that shows this problem. As Chris said, calling setPositionIncrement(0) is important. Regards Daniel -- http://www.danielnaber.de --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]