lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Uwe Schindler" <...@thetaphi.de>
Subject RE: [jira] [Commented] (LUCENE-3796) Disallow setBoost() on StringField, throw exception if boosts are set if norms are omitted
Date Fri, 17 Feb 2012 16:53:42 GMT
Yeah. I was not sure if you was referring to Robert's patch where we throw
ex when boost!=1.0f and norms omitted.

In general, boosting documents (not fields) was never really supported by
Lucene, it was always just a "norms hack". And it only works when TermQuery
is involved. If you really want to boost documents, the way to go is to use
FloatDocValues for the per-doc boosts and use a CustomScoreQuery wrapping
your final parsed query including constant scores,...) that multiplies the
docvalues boost in (or write a Collector wrapper around your
TopDocsCollector). I have used this quite often (with FieldCache), it works
as you would expect. Otherwise constant score queries (or other queries like
MatchAllDocs) were never using the boosts and this was always a problem
(because people don't understand that).

In my opinion, per document boosts should maybe removed in trunk and people
should be instructed to use DocValues and CustomScoreQuery.

Uwe

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


> -----Original Message-----
> From: yseeley@gmail.com [mailto:yseeley@gmail.com] On Behalf Of Yonik
> Seeley
> Sent: Friday, February 17, 2012 5:16 PM
> To: dev@lucene.apache.org
> Subject: Re: [jira] [Commented] (LUCENE-3796) Disallow setBoost() on
> StringField, throw exception if boosts are set if norms are omitted
> 
> On Fri, Feb 17, 2012 at 11:04 AM, Uwe Schindler <uwe@thetaphi.de> wrote:
> > We dont prohibit anything. If the field type/field has norms omitted
> > (which is the default for those fields), applying a boost will never
> > work. That's all.
> 
> That's a fine default,  but your answer to Jan suggested that boosts
> *never* work.  I was just pointing out, that's not strictly true.
> 
> -Yonik
> lucidimagination.com
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org For additional
> commands, e-mail: dev-help@lucene.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org


Mime
View raw message