[Xapian-discuss] remote backend

Michael Lewis mal at icginc.com
Fri Apr 26 15:42:33 BST 2013


So, given what I've read in the documentation I would create a text file named document_database.txt that might have the following:



remote 192.168.1.10:30000

chert /var/lib/xapian_database/segment1

remote 192.168.1.10:30000 chert /var/lib/xapian_database/segment2

remote 192.168.1.10:30000 chert /var/lib/xapian_database/segment3

etc.



I would then in my PHP program open document_database.txt as the database and then perform normal Xapian calls. The same with Omega, I would, in my template, change the database name to document_database.txt.



Given the above, it appears that I do not have to refer to each segment (segment1, segment2, etc.) for my calls, as it appears they are aggregated and treated as a single database and Xapian takes care of which actual database segment to search. IE, searching all the segments for my search terms.



Michael



-----Original Message-----

From: simon.roe at gmail.com<mailto:simon.roe at gmail.com> [mailto:simon.roe at gmail.com] On Behalf Of Sym Roe

Sent: Friday, April 26, 2013 9:26 AM

To: James Aylett

Cc: Michael Lewis; xapian-discuss at lists.xapian.org<mailto:xapian-discuss at lists.xapian.org>

Subject: Re: [Xapian-discuss] Converting MySQL database to Xapian



On Fri, Apr 26, 2013 at 2:22 PM, James Aylett <james-xapian at tartarus.org<mailto:james-xapian at tartarus.org>> wrote:

> On 26 Apr 2013, at 14:12, Michael Lewis <mal at icginc.com<mailto:mal at icginc.com>> wrote:

>

>> My first question is: On ServerY and the Web Server how do I set-up Xapian for access. In the PHP code do I have to actually know where the databases are located or is that the function of some kind of stub database? In an ideal world the stub database file would contain a xapian db segment name and a host address and port where the actual segment resides.

>

>

> Michael, you should check out:

>

>  * http://xapian.org/docs/remote.html (remote backend documentation)

>  * http://xapian.org/docs/overview.html#specifying-a-database (talks

> about stub databases, which you'll want to use with the remote

> backend)



Also the API doc for database:



http://xapian.org/docs/apidoc/html/classXapian_1_1Database.html#2fc5aa368a7097ca787a831211a2e3bc



Just call add_database for each db you have, and then a search will work over all of them (I think)



--

E: sym.roe at talusdesign.co.uk<mailto:sym.roe at talusdesign.co.uk>

M: 07742079314

@symroe



More information about the Xapian-discuss mailing list