Closed Shazwazza closed 4 years ago
@Shazwazza hi did you amend this in your examine with azure directory code? does seem odd and i'm tempted to fix it as i doubt it's intended.
@yohsii Hi! yeah i've more or less overhauled the whole thing in my examine project. This _name should definitely not be null. I've found that trying to use a "native" blob storage lease for the lock was causing some issues and that just using a simple file based lock was more resilient (ironically).
You can find my latest code here: https://github.com/Shazwazza/Examine/tree/master/src/Examine.AzureDirectory
There's other features in there like ReadOnlyAzureDirectoryFactory
in cases where you might have multiple servers asking for the index - but of course you cannot have multiple servers writing to the index, so this would work for readonly front-end servers while you would have a 'master' read/write server responsible for writing to the index.
There's a lot of other stuff fixed up in the AzureDirectory.cs main class. Feel free to copy/re-use/backport/etc... I had a note in a commit to backport these changes here but I never got around to it unfortunatley.
Cheers Shazwazza, I've included the _name fix in my pr which updates the project for .net standard 2.0 lucene 4.8 and latest azure blob library
i've also created SyncDirectory which offers another strategy for using Lucene.Net with Azure.
This seems a bit odd but maybe it's by design but in the ctor of AzureIndexOutput the first line is:
but the _name will always be null in this case because it hasn't been initialized yet. Is this intended?