Hi All,

We are trying to implement multi-color highlighting in our Lucene.NET (v2.0) 
based search engine. We are using "Lucene.Net.Highlight" library for the same. 
Since we do not have any support for multi-color highlighting, we are doing 
that indirectly by extracting each term in search query and highlighting it 
individually with separate formatter.

For example:

String strQuery = "merger agree*" (without quotes)
---
WeightedTerm[] terms = QueryTermExtractor.GetTerms(strQuery, false);
---
---
SimpleHTMLFormatter formatter = new 
SimpleHTMLFormatter(_strFormatterStartTag[nFormatter], _strFormatterEndTag);
--- loop to traverse each term ---
WeightedTerm term = terms[nTerm];
---
TermQuery termQuery = new TermQuery (new Term (FIELDNAME, term.GetTerm()));
---
Highlighter highlighterContent = ---

Problem:

Above implementation is working fine. However all variations of "agree*" query 
term like "agreements", "agreed", "agreement" are being highlighted in separate 
color. I am not able to correlate all these variations to same original term 
"agree*" to highlight them in same color.

Can anyone suggest me an alternate approach?


Reply via email to