Lucene.NET Exception on Azure - segments.* file not found in AzureDirectory
Issue context
Environment
.NET 6.0
Lucene.Net 4.8.0-beta0016
Lucene.Net.QueryParser 4.8.0-beta16
Lucene.Net.Store.Azure 4.8.0-beta16 (I upgraded to beta16 manually to be consistent)
Exception
When querying the index stored in Azure Blob Storage after modification, the following exception is thrown:
Error occurred while searching keywords: Lucene.Net.Index.IndexNotFoundException: no segments* file found in AzureDirectory
More details about the issue
When the index is created for the first time, the following files are generated:
When querying the indexes, there are no issues.
A second run modifies the index to delete all documents and re-add them and add a new document to the index. The index directory in blob storage now looks like the following screenshot:
When querying the index, the exception is thrown:
Error occurred while searching keywords: Lucene.Net.Index.IndexNotFoundException: no segments* file found in AzureDirectory@39b5dcc lockFactory=NativeFSLockFactory@: files: [] at Lucene.Net.Index.SegmentInfos.FindSegmentsFile.Run(IndexCommit commit) at Lucene.Net.Index.StandardDirectoryReader.Open(Directory directory, IndexCommit commit, Int32 termInfosIndexDivisor) at Lucene.Net.Index.DirectoryReader.Open(Directory directory)
Root issue
segments.gen
file was deleted when modifying indexes.
When I looked into the AzureDirectory lib I am using, it has not implemented all the functions properly:
//TODO