[Xapian-discuss] Multiple Databases on the same port

Eddie Drapkin eddie at frameweld.com
Fri Jul 31 16:43:50 BST 2009


On Fri, Jul 31, 2009 at 4:12 AM, Tom<tom at lemurconsulting.com> wrote:
> 2009/7/31 Olly Betts <olly at survex.com>:
>> On Thu, Jul 30, 2009 at 03:13:15PM -0400, Eddie Drapkin wrote:
>>> Specifically, we're using the PHP Bindings and I've managed to get
>>> xapian to listen on a single port with all of the 200 odd databases
>>> that we need to index.  I can't find documentation anywhere about how
>>> to select a database to search from here:
>>>
>>> $foo = Xapian::remote_connect($host, $port);
>>
>> I think you mean "remote_open" here.
>>
>> What you are trying to do isn't supported, I'm afraid - the search will
>> be over all 200-odd databases combined, just as it would be if you
>> opened the same database locally.
>>
>> If you want to be able to open them separately, you need to run a server
>> for each, all on different ports.
>
> Or, I guess you could add a database ID term to each document and use
> a filter query. Though that may not be practical post hoc.
>
> Tom
>

Thanks for the responses!

Let me elaborate a little more on what we're using xapian for.  We
host separate sites for each client, sometimes several sites per
client, and each site needs it's own database to search against.  It's
not really an option to search all databases at once, as there is
definitely relevant data to client A that people at client B's site
don't need to see.  The suggestion to add a database ID or a site ID
field in the databases doesn't seem too practical, as we have a
type-ahead search and even that piece of overhead could turn out to be
more costly than we'd expect, not to mention making the entire search
process harder to manage.  As far as running a xapian-tcpsrv instance
per database, that's a management and security nightmare, not to
mention putting a very real limit on how far we can scale out.

It's not really practical to switch search engines right now, not that
we're not happy with Xapian, but I do know that Sphinx has the
capability of serving on a single port and having multiple "indexes."
Is there another, alternative, way to set up our datasets so that
they're uniquely searchable without being in separate databases or
having to search based on DatabaseID all the time?

Thanks again,
Eddie



More information about the Xapian-discuss mailing list