[Xapian-discuss] Postgres connection

James Aylett james-xapian at tartarus.org
Tue Feb 20 16:00:28 GMT 2007


On Tue, Feb 20, 2007 at 02:24:52PM +0000, Olly Betts wrote:

> > Is there any way to connect postgres with Xapian?
> 
> It certainly would be nice to see some sort of "connector" which
> allowed the SQL database to "push" changes to Xapian.

Presumably what most people want here is something that automatically
prod a Xapian application to index/re-index/remove a document (where
the data comes out of a number of rows in a number of tables, but is
indexed in some fairly straightforward way).

This can certainly be done in postgresql using triggers; probably the
best way we would be via PL/Python or PL/Perl (or PL/TCL :-). [1]

However depending on the application, and how your architecture works,
you may be better off putting it inside your ORM layer [2]. One very
common trend at the moment (particularly in programming systems for
the web) is to avoid using most sophisticated features of your RDBMS,
so things like triggers tend to get pulled up into the business logic
layer. Most people will additionally find this easier to write,
providing they don't have to implement that logic in more than one
programming language.

[1] <http://www.postgresql.org/docs/8.2/interactive/server-programming.html>
[2] <http://en.wikipedia.org/wiki/Object-relational_mapping>

J

-- 
/--------------------------------------------------------------------------\
  James Aylett                                                  xapian.org
  james at tartarus.org                               uncertaintydivision.org



More information about the Xapian-discuss mailing list