如何在Lucene里面进行数字范围搜索 (Numeric Range Query)

首先是建立索引:

然后就是搜索了,只要新建对应的:

Query query = NumericRangeQuery.newDoubleRange(field, 0.0, 0.5, true, true);

更详细的使用方法,请参考:

http://wiki.apache.org/lucene-java/SearchNumericalFields

http://lucene.apache.org/java/3_0_2/api/core/org/apache/lucene/search/NumericRangeQuery.html

你可能感兴趣的:(java,apache,html,Lucene)