How do I make the QueryParser in Lucene handle numeric ranges?

前端 未结 5 1123
闹比i
闹比i 2020-12-16 05:43
new QueryParser(.... ).parse (somequery);

it works only for string indexed fields. Say i have a field called count where count is a integer field (

5条回答
  •  生来不讨喜
    2020-12-16 06:24

    QueryParser won't create a NumericRangeQuery as it has no way to know whether a field was indexed with NumericField. Just extend the QueryParser to handle this case.

提交回复
热议问题