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


I am looking for an efficient way to find numerical areas in the index and Lucene.Net. Now my need is for integer values ​​only.

I want to search for categories of values ​​(X and Y, X plus ...). Right now I am indexing numbers and manually creating clauses for each value between two values, but it generates many clauses and kills the default range (1024) when I am between 1000 and 1000 Looking for value 5000, for example. I am sure that there is a better way of doing this ...

It solved with a RangeQuery It can also be done with the query parser with the following syntax:

  Field Name: [startValue to endValue]  

Keep in mind that the boundary query operates On the stars, so your numbers should be normalized in both index and query. Normalized with the .5 string in my case ("00000") normalized. Special handling will be necessary for negative numbers and decades, but in my case this was not an issue.


Comments

Popular posts from this blog

asp.net - Javascript/DOM Why is does my form not support submit()? -

sockets - Delphi: TTcpServer, connection reset when reading -

javascript - Classic ASP "ExecuteGlobal" statement acting differently on two servers -