Hello Mikhail.

Sorry if I was not precise enough.
A NumericRangeQuery can be wrapped in a BooleanQuery with a boost but this
boost is applied to the BoostQuery (a Query) not to the wrapped
NumericRangeQuery.
Casting BoostQuery or Query to NumericRangeQuery is impossible and
BoostQuery.getQuery returns the wrapped NumericRangeQuery not modified, not
boosted (by virtue of immutability? The migration guide does not say that
NumericRangeQuery is immutable.).

But my problem is indeed boosting the NumericRangeQuery and I'm staying
with the deprecated NumericRangeQuery.setBoost.

Thanks for your help.

Claude Lepère






On Sat, Nov 25, 2023 at 3:14 PM Mikhail Khludnev <m...@apache.org> wrote:

> Hello Claude,
> Wrap it by BoostQuery. see
> https://lucene.apache.org/core/6_0_0/MIGRATE.html
>
>
> On Sat, Nov 25, 2023 at 2:46 PM Claude Lepère <claudelep...@gmail.com>
> wrote:
>
> > Hi.
> >
> > We are using Lucene 5.5.5 where setBoost is deprecated for all Query
> types.
> > How to set the boost of a NumericRangeQuery while preserving the
> > NumericRangeQuery type?
> > BoostQuery doesn't allow this and I haven't found a way.
> >
> > Thanks for your help.
> >
> > Claude Lepère
> >
>
>
> --
> Sincerely yours
> Mikhail Khludnev
>

Reply via email to