Domanda

I'm using lucene.net for a search on huge file, the search is amazing fast and I'm really happy with it. We are using Lucene.Net.Store.Directory to store the index and we build the index in the global.asax app_start.

What I'm missing is if there is a way to avoid rebuilding if the index is already written to the directory, since the data are very static and we would like to avoid rebuilding the index until we really need to explicitly update tha data.

Reusing the already built and written index is possible in lucene.net.. somehow?

È stato utile?

Soluzione

Are you saying that you're using a RAMDirectory to store the file? Or a FSDirectory?

If you're using a RAMDirectory, switch to FSDirectory to persist your index between application recycles.

Use IndexReader.LastModified(Directory) to determine if you're content is outdated and you need an index rebuild.

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top