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: [email protected] > -----Original Message----- > From: [email protected] [mailto:[email protected]] On Behalf Of Yonik > Seeley > Sent: Friday, February 17, 2012 5:16 PM > To: [email protected] > 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 <[email protected]> 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: [email protected] For additional > commands, e-mail: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
