highlight snowball analyzer stem word
0 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Anonymous
Posted On:   Monday, June 15, 2009 01:49 PM

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); 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(tokenStre   More>>
			
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);
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.
   <<Less
About | Sitemap | Contact