lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From faisalloe <faisal...@gmail.com>
Subject lucene highligher snowball analyzer highlight stem words
Date Mon, 15 Jun 2009 17:47:21 GMT

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: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org


Mime
View raw message