简体   繁体   中英

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.

Is it possible to do a search of this type in 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 .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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