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

Advanced index searches (Become an expert)

One of the great things about Lucene.NET is the ease by which you can implement different types of searches with minimal change to your code. The following examples demonstrate several types of searches that differ only by the creation of a different search object that is passed to IndexSearcher. All code for setting up a search, executing the search, and processing results are identical, with just a simple change to the type of query object that is created!

How to do it...

For demonstration of several of the following queries (all but PhraseQuery), the example facade provides the buildLexicographicalExampleIndex method that will be called instead of indexing wotw.txt and tm.txt. Using the content created ...

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