lucenenet-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Robert Jordan <robe...@gmx.net>
Subject Re: Highlighter and ConstantScoreQuery don't play together
Date Tue, 18 May 2010 19:48:29 GMT
On 18.05.2010 17:09, TJ Kolev wrote:
> Greetings!
>
> I am in the process of upgrading from 2.3.1 to 2.9.2 and my highlighter
> stopped working. I tracked the issue down to this code in Lucene.Net.Search.
> ConstantScoreQuery:
>
>          public override void  ExtractTerms(System.Collections.Hashtable
> terms)
>          {
>              // OK to not add any terms when used for MultiSearcher,
>              // but may not be OK for highlighting
>          }
>
> The highlighter goes through it and the terms are not populated.
>
> What is to be done to make it work?
>
> I found https://issues.apache.org/jira/browse/LUCENE-1731 and it implies it
> is fixed for 2.9. How valid is this for the .net release?
>
> I can supply more code if needed.

A workaround for this is calling

SetMultiTermRewriteMethod(MultiTermQuery.SCORING_BOOLEAN_QUERY_REWRITE);

on the query parser that creates the query you're using for the
highlighter.

IIRC, even Lucene/Java is needing this call.

Robert


Mime
View raw message