0

I added a Maven dependency

<dependency>
      <groupId>org.apache.lucene</groupId>
      <artifactId>lucene-core</artifactId>
      <version>9.7.0</version>
</dependency>

but Cannot resolve the symbol 'NumericRangeQuery'; "NumericRangeQuery" should be defined in org.apache.lucene.search. Is this class still there? How Can I import it successfully? Here is more details about "NumericRangeQuery": https://lucene.apache.org/core/5_3_1/core/org/apache/lucene/search/NumericRangeQuery.html

1
  • When I import "Lucene-core 5.2.1-1", there is "NumericRangeQuery". Do you guys know why they deleted it in the new version?
    – Anna
    Commented Oct 14, 2023 at 6:55

1 Answer 1

0

NumericRangeQuery was deprecated and moved from org.apache.lucene.search.NumericRangeQuery to org.apache.solr.legacy.LegacyNumericRangeQuery.

You can import it using import org.apache.solr.legacy.LegacyNumericRangeQuery;. But I would not recommend to use deprecated API. It is better to migrate your index to the new types and use modern API.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.