Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Store Lucene index file to remote location

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

like image 848
Ehsan Avatar asked Jan 10 '11 07:01

Ehsan


2 Answers

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).

like image 137
sisve Avatar answered Sep 18 '22 02:09

sisve


  1. I'm not sure how you're connecting to the "remote location", but if you can mount PC(B) as part of your filesystem you can put your index there without doing anything special.
  2. That being said, remote filesystems are slower than local ones
like image 22
Xodarap Avatar answered Sep 21 '22 02:09

Xodarap