Range Search In Lucene

You’ll be quite surprised to find out about how Lucene actually expands your range queries. As pointed out by Simon, range queries are enumerated for every possible value in the given range. Now ain’t that naive >-:. This limits the range to about 1024 values. Simon also points out a possible solution for dates by indexing them as strings of the form ‘yyyymmdd’.

I tried doing the same on one of my recent projects where I was indexing dates as strings ‘yyyymmdd’. But when I actually had a look at my expanded query via Limo, I found Lucene enumerating for string range queries as well.

Apparently this is not a bug nor even a feature but a “known behaviour”.

Leave a Reply

Popular Tags

AJAX algorithm Artificial Intelligence artificial intelligence BarCamp bayesian blogger Blogging cache database delicious design event extension firefox gmail Google humor India Interview knowledge lifelogger Linux Lucene Machine Learning machine learning misc Mozilla mplayer Open Source open source patterns Performance plugin Project pune Ruby Search sergey brin Social Networks social networks Tagging thunderbird thunderbolt Trends visualization Web Web 2.0 yahoo Yahoo!