简体   繁体   English

在Lucene中按大小搜索

[英]Search by size in Lucene

I have a problem with my search. 我的搜索有问题。

I want to search at a range of sizes, but it does not work. 我想搜索一定范围的大小,但是它不起作用。

Size: [0 TO 1000] and I show the files which have a size of between 0 and 1000. 大小:[0至1000],我显示的文件大小在0到1000之间。

Is it possible to do a search of this type in Lucene? 是否可以在Lucene中进行此类搜索?

Thank you! 谢谢!

When searching on field with a range of numbers you have to first make sure, the field is of numeric type when indexing a document and adding the size field. 在具有一定范围的数字的字段上搜索时,必须首先确保索引文档并添加大小字段时该字段是数字类型。 While searching (if you have trouble with the syntax) you can create a RangeQuery , and combine multiple ranges with BooleanQuery . 搜索时(如果您对语法有RangeQuery ),可以创建RangeQuery ,并将多个范围与BooleanQuery

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM