On Feb 21, 2005, at 10:53 AM, Michael Celona wrote:
That the only stack I get. One thing to mention that I am using a MultiSearcher to rewrite the queries. I tried...
query = searcher_last.rewrite( query ); query = searcher_cur.rewrite( query );
using IndexSearcher and I don't get an error... However, I not able to highlight wildcard queries.
I use Highlighter for lucenebook.com and have two indexes that I search with MultiSearcher. Here's how I highlight:
IndexReader reader = readers[indexIndex]; QueryScorer scorer = new QueryScorer(query.rewrite(reader)); SimpleHTMLFormatter formatter = new SimpleHTMLFormatter("<span class=\"highlight\">", "</span>"); Highlighter highlighter = new Highlighter(formatter, scorer);
I get the appropriate IndexReader for the document being highlighted. You can get the index _index_ this way:
'
int indexIndex = searcher.subSearcher(hits.id(position));
Hope this helps.
Erik
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]