I am having the following method to highlight the terms.
public static String getHighlighter(String colName, Highlighter
highlighter,IndexSearcher searcher,int id, Analyzer analyzer) throws
IOException {
String highlightTerm;
TokenStream tokenStream;
Document doc;
doc = searcher.doc(id);//document id
highlighter.setTextFragmenter(fragmenter);
String text = doc.get(colName);//doc.get("all_attributes");
//tokenStream =
TokenSources.getAnyTokenStream(searcher.getIndexReader(), id,
"all_attributes", analyzer);
tokenStream =
TokenSources.getAnyTokenStream(searcher.getIndexReader(),
id, colName, new StandardAnalyzer());
highlightTerm = highlighter.getBestFragments(tokenStream,
text, 1,
"...");
return highlightTerm;
}
i am using snowball analyzer to search stem words, i wonder stem words could
not be highlighted.
Please guide me how to proceed. if i use standranalyzer for highlighting
terms it works fine.
--
View this message in context:
http://www.nabble.com/lucene-highligher-snowball-analyzer-highlight-stem-words-tp24039468p24039468.html
Sent from the Lucene - Java Users mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]