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

2023-11-26 Thread Claude Lepère
Hello Uwe. Many thanks for your reply. We thought this would be the explanation. We are using an external imported method that has a NumericRangeQuery as input parameter. The NumericRangeQuery is part of a complex BooleanQuery built from the user input and we would be able to change its default

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

2023-11-26 Thread Uwe Schindler
Hi, Lucene 5 removed the way to boost queries on its own. You have to live with that. In addition, all queries should be immutable Not yet enfocred in Lucene 5), which is required for caching purposes*). When you apply a BoostQuery on top of any other query the scores the inner query return

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

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

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