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.