O'Reilly logo

Instant Lucene.NET by Michael Heydt

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Indexing numbers, dates, and time (Become an expert)

Lucene.NET is generally thought of as a library that facilitates search against textual data, but Lucene.NET can also be used to search against data types such as numbers, dates, and times. This can facilitate greatly if it is needed to be able to determine search results based upon scalar data, such as numeric values that are equal to, greater than, or less than a certain value, or perhaps if you are storing music or videos and want to search for the duration of the content.

How to do it...

Previous recipes have stored length of the document, but the value is stored as a string. This really isn't too valuable in a search scenario, as searching against that field will always do a string comparison. ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required