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

Creating a Lucene.NET index (Must know)

Now that you have built a project referencing Lucene.NET, the next step is to create an index that you can search against. In Lucene.NET, an index is created and manipulated by using an instance of IndexWriter. Content can be added to the index by adding one or more Document objects to the instance of IndexWriter, where each document has one or more fields and value pairs that represent the data which is to be indexed.

How to do it...

The following is the example code for creating a Lucene.NET index through the fluent facade and indexing a single document in the index that has three fields, which Lucene.NET will index and make available for subsequent searches:

namespace Lucene.NET.HowTo._02.CreateAnIndex{ ...

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