How to index numeric fields and search them by range in Lucene.Net?

I am looking for an efficient way to index and search for numeric fields in Lucene.Net. Right now my need for integer values.

I want to search by ranges of values ​​(between x and y, greater than x ...). Right now, I index the number as is and manually create clauses for each value between the two values, but it quickly generates a lot of sentences and presses the default constraint (1024) when I look for a value between 1000 and 5000, for example. I am sure there is a better way to do this ...

+3
source share
1 answer

RangeQuery. :

FieldName:[startValue TO endValue]

, , , . 5 .ToString( "00000" ). , .

+6

Source: https://habr.com/ru/post/1720472/


All Articles