[Xapian-discuss] best practices - combining sql database and xapian, size of database?

Per Jessen per at computer.org
Fri Apr 16 19:12:46 BST 2010

Peter Karman wrote:

>> - each of my documents come with a set of attributes. These are
>> easily stored and indexed in a sql database, but I'm not quite sure
>> how I
>> would combine a sql database lookup with a xapian query?  AFAICT,
>> xapian also has mechanism for associating attributes with a document,
>> might that be the right approach?
> I typically store attributes I want to be able to sort on or collapse
> on as a Xapian value[0]. Values are not what you search for, but are
> attributes associated with a document that you can sort by, fetch,
> etc.
> I usually store my db primary key as a term[1] because I know it is
> unique and I want to be able to search for it.

Time to read the manual.  Sounds like I should be storing my attributes
as terms. 

> If you want one example of prior art that implements the above, you
> can look at the swish_xapian code[2] (part of Swish3). The assumption
> in that code is that you have serialized each db record into a XML doc
> (which allows for joins, etc), and created a config file that calls
> out each field/column as a MetaName and/or PropertyName. MetaNames are
> terms in a context (in a field) so you can limit a search to a
> specific field. PropertyNames are stored values. A field can be both
> (as with a date, for example).

Okay, thanks.

/Per Jessen, Zürich

More information about the Xapian-discuss mailing list