Hi
Is there a way to store lucene index files to remote location for example I'm on PC(A) and want to index my documents but store the result to remote location like some directory on PC(B) is it supported internally or i should write custom code to support it ?
many thanks to accurate response
There are several options available, depending on your network setup.
You can work directly against a remote filesystem published as a network shares with FSDirectory.Open(@"\\server\index")
, but as already been noted, network latency and speed will affect your indexing.
You could also index it locally, either using a FSDirectory
or a RAMDirectory
, and call Directory.Copy(src, dest, closeDirSrc)
to transfer it via a network share to your remote location. This will be faster than working directly against a remote directory since there's no network overhead during indexing.
If speed is of no concern, or you're feeling adventurous, try building a custom directory implementation (inherit from Directory
) which uses whatever transfer technique you need (ftp, email, carrier pigeons, etc).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With