Hi All,
As per Docs as mentioned example says we can use analyser for related words search. i.e. java rocks can be searched as rock, rocks etc.
EnglistAnalyser class
Code:
public class EnglishAnalyzer extends Analyzer {
private static Logger log = Logger.getLogger(EnglishAnalyzer.class);
/**
* {@inheritDoc}
*/
@Override
public TokenStream tokenStream(String fieldName, Reader reader) {
TokenStream result = new StandardTokenizer(reader);
result = new StandardFilter(result);
result = new LowerCaseFilter(result);
result = new SnowballFilter(result, name);
return result;
}
}
Search queryCode:
org.apache.lucene.queryParser.QueryParser parser = new QueryParser("message", new EnglishAnalyzer() );
It gives error at
Code:
result = new SnowballFilter(result, name); //at name not found in EnglishAnalyser
i belive that name represents which Stemmer it should use? is what i am doing correct? trying this because of...
http://forum.hibernate.org/viewtopic.ph ... 07#2398507
but got stuck :( , any idea GUYS?
Regards,
Sachin Parnami