You can set setExpandMultiTermQuery(true) on QueryScorer (or
WeightedSpanTermExtractor), which is  needed by the Highlighter CTOR - that
would do exactly what you want with the standard highlighter.

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


> -----Original Message-----
> From: Alexander Kanarsky [mailto:kanarsky2...@gmail.com]
> Sent: Tuesday, January 25, 2011 8:44 PM
> To: java-user@lucene.apache.org
> Subject: Re: Highlight Wildcard Queries
> 
> Hi Wulf,
> 
> Check the http://www.lucidimagination.com/blog/2009/06/08/bringing-the-
> highlighter-back-to-wildcard-queries-in-solr-14/
> this may help. I do not know what of Mark's changes are in Lucene 3.x, but
> most likely you will just need to set a proper RewriteMethod for the
> MultiTermQuery somewhere.
> 
> -Alexander
> 
> On Tue, Jan 25, 2011 at 9:40 AM, Wulf Berschin <bersc...@dosco.de> wrote:
> > Hi,
> >
> > I'm just migrating our small search customization from Lucene version
> > 2.3 to the current version (3.0.3) and wonder why, in contrast to the
> > old version, we no longer get the Wildcard Queries (which are default,
> > since surround the search string with asterisks) highlighted.
> >
> > We're using the "traditional" Highlighter and don't store documents
> > content (in total about 100MB) in the index.
> >
> > As far I understand in the earlier version a WildCard Query was
> > rewritten
> > (expanded) into many Term Queries before highlighting (but in practice
> > never exceeded the maximum clauses size since we only wrapped strings
> > longer than
> > 3 characters...)
> >
> > Now however, QueryParser returns a BooleanQuery conataining a
> > ConstantScoreQuery which has an enmpty extractTerms method and thus
> > doesnt contribute terms for the highlighter.
> >
> > What do I have to do to get the wildcard query results highlighted?
> > Use th old Rewrite methods (if possible)??
> > Go back to Lucene 2.3???
> >
> > 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



---------------------------------------------------------------------
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