You should still not rewrite yourself and let always Lucene do that. When
you rewrite, Lucene is no longer able to detect the correct rewrite mode, as
it only sees ConstantScore query. Rewrite should only be called by internal
Lucene APIs (e.g. IndexSearcher does it before executing the query) and
(that’s most important) highlighter does it more effective by only using the
One-Document-Index. If you rewrite the query before highlighting against
your IndexSearcher, it gets rewritten against the complete index which may
cost lots of time for wildcards or other MultiTermQueries. If you let
highlighter rewrite it, it will only rewrite it against the one-document
MemoryIndex that needs to be highlighted.

-----
Uwe Schindler
H.-H.-Meier-Allee 63, D-28213 Bremen
http://www.thetaphi.de
eMail: u...@thetaphi.de


> -----Original Message-----
> From: Wulf Berschin [mailto:bersc...@dosco.de]
> Sent: Wednesday, January 26, 2011 3:24 PM
> To: java-user@lucene.apache.org
> Subject: Re: Highlight Wildcard Queries: Scores
> 
> Sorry for bothering, that was my fault: I my subclass of QueryParser which
> wraps * around the terms I had not yet considered the new
> multiTermRewriteMethod. After adding these scoring seems to work and
> even the rewrite is possible again.
> 
> Wulf
> 
> Am 26.01.2011 15:10, schrieb Wulf Berschin:
> > Now I have the highlighted wildcards but obviously the scoring is lost.
> > I see that a rewrite of the wildcard query produces a constant score
> > query. I added
> >
> >
> setMultiTermRewriteMethod(MultiTermQuery.SCORING_BOOLEAN_QUERY
> _REWRITE
> > );
> >
> > to my QueryParser instance but no effect. What's to be done now?
> >
> > Wulf
> >
> >
> >
> > Am 26.01.2011 11:06, schrieb Wulf Berschin:
> >> Thank you Alexander and Uwe, for your help.
> >>
> >> I read Marks explanation but it seems to me that his changes are not
> >> contained in Lucene-3.0.3.
> >>
> >> So I commented out the rewrite, changed QueryTermScorer back to
> >> QueryScorer and now I got the wildcard queries highlighted again.
> >>
> >> Wulf
> >>
> >>
> >> ---------------------------------------------------------------------
> >> To unsubscribe, e-mail: java-user-unsubscr...@lucene.apache.org
> >> For additional commands, e-mail: java-user-h...@lucene.apache.org
> >>
> >>
> >>
> >>
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: java-user-unsubscr...@lucene.apache.org
> > For additional commands, e-mail: java-user-h...@lucene.apache.org
> >
> >
> >
> >
> 
> 
> --
> 
> Mit freundlichen Grüßen,
> 
> Wulf Berschin
> 
> --
> 
> <!--
> **********************************************************
> *******
> * Wulf Berschin                            Telefon: +49 6221 1486 16 *
> * DOSCO Document Systems Consulting GmbH   Telefax: +49 6221 1486 19 *
> * Mannheimer Strasse 1                     E-Mail: bersc...@dosco.de *
> * 69115 Heidelberg, Germany                http://www.dosco.de       *
> * Handelsregister: Heidelberg HRB 335122                             *
> * Geschäftsführung: Robert Erfle                                     *
> **********************************************************
> ******** -->
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: java-user-unsubscr...@lucene.apache.org
> For additional commands, e-mail: java-user-h...@lucene.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscr...@lucene.apache.org
For additional commands, e-mail: java-user-h...@lucene.apache.org

Reply via email to