我是新的solr和尝试范围查询" to“。然而,我无法理解正确的行为。
下面是表中我的字段:
order_range intschema.xml包含:
<fieldType name="int" class="solr.IntField"/>和
<field name="order_range" type="int" indexed="true" stored="true"/>但是,当我发出以下查询时
order_range:[20 TO *]它返回order_range小于20的文档。
field:[100 TO *] finds all field values greater than or equal to 100有人能帮我弄清楚我少了什么吗?
发布于 2015-03-10 19:58:54
对于数值范围查询,我建议使用以下两种字段类型之一:
<fieldType name="tint" class="solr.TrieIntField" precisionStep="8" positionIncrementGap="0"/>
<fieldType name="tdouble" class="solr.TrieDoubleField" precisionStep="8" positionIncrementGap="0"/>根据schema.xml中的文档:
要获得更快的范围查询,请考虑tint/tfloat/tlong/tdouble类型。
当您使用int字段类型时,它会按字典顺序对它们进行排序。
更多细节:http://www.slideshare.net/VadimKirilchuk/numeric-rangequeries
https://stackoverflow.com/questions/28972329
复制相似问题