NumericRangeQuery in Lucene 5.5.5: replacing the deprecated setBoost while keeping the NumericRange type?

2023-11-25 Thread Claude Lepère
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

Re: NumericRangeQuery in Lucene 5.5.5: replacing the deprecated setBoost while keeping the NumericRange type?

2023-11-25 Thread Mikhail Khludnev
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 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 th

Re: NumericRangeQuery in Lucene 5.5.5: replacing the deprecated setBoost while keeping the NumericRange type?

2023-11-25 Thread Claude Lepère
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 ret