[Xapian-discuss] Using multiple remote databases
Olly Betts
olly at survex.com
Wed Dec 20 03:47:37 GMT 2006
On Wed, Dec 20, 2006 at 12:09:15AM -0300, Sebastian wrote:
> That's fine. But I express myself the wrong way... suppose I have
> three databases per country, like these paths, in one remote server:
>
> /var/lib/xapian
> |_ ar
> | |_ operation
> | |_ hs-tariff
> | |_ regulation
> |_ uy
> |_ operation
> |_ hs-tariff
> |_ regulation
>
> and I need to search database ar/operation (to scavage an import or
> export movement). Is it possible to achieve this with a stub file?i
Oh I see. Sorry, I misunderstood what you were asking and answered a
different question. So stub databases aren't the answer for you.
(Actually, now I think about it more you don't need a stub database to
achieve what I thought you meant - you can just specify multiple
databases on the command line to xapian-tcpsrv!)
Currently you need to run xapian-tcpsrv once, and on a unique port, for
each database which you want to be able to access using it.
It would be feasible to extend the remote protocol to allow multiplexing
access to one of several databases via one xapian-tcpsrv, with the
client sending a database name to choose which database to open.
There are some security concerns - you probably don't want anyone to be
able to open any database readable by the user that ran xapian-tcpsrv.
Perhaps the best approach is something like Omega's approach of allowing
a relative pathname from a database directory with vetting to prevent
".." in the relative path.
However, nobody has implemented this multiplexing feature so far.
Depending on your setup, you might be able to use xapian-progsrv over
ssh instead. For example:
Xapian::Database db = Xapian::Remote::open("ssh",
"otherhost xapian-progsrv /var/lib/xapian/ar/operation");
You'll want to set up public/private keys (or perhaps ssh-agent) so that
a password isn't required for the calling user to connect to the remote
host.
Cheers,
Olly
More information about the Xapian-discuss
mailing list