I have a question regarding thread safety and concurrency for indexing. Is it possible to have multiple clients open the same index add files to that index using the Add method?
The reason I ask is because I created a test application that uses multiple threads, and each thread opens the same existing index. I then use the Add method to add files to the index one at a time to simulate a user uploading a file to my file storage service that I want to index the files. However, I’ve noticed this causes issues with files already existing (temp files):
System.IO.IOException: ‘The process cannot access the file ‘C:\SearchIndexes\GroupDocs.Search\1.temp’ because it is being used by another process.’
What’s the best way of allowing users to upload a file to my network drive and then index that file? Multiple users will be accessing the index and a lot of files can be uploaded to the network drive.