[Xapian-discuss] Python binding and Xapian fields

Olly Betts olly at survex.com
Thu Sep 15 00:32:41 BST 2005


On Wed, Sep 14, 2005 at 11:55:39PM +0200, David Levy wrote:
> I am using Xapian 0.9.2 with Python bindings and Xapwrap (Python wrapper for 
> xapian) on Fedora Core 3. I have added custom fields like 'uri', 'title', 
> etc and I wish to view them in my Omega results.

Xapwrap is a third party wrapper around Xapian's python bindings.  I've
not studied it in great detail, but I think the author reads this list.

> I am also using an Omega XML customized XML template with these fields. 
> Searching with Xapian and Omega works great ... but those fields appears as 
> empty in my resultset! I can not make it work, whether using Index or 
> SmartIndex from Xapwrap.
> 
> What did I miss ? How Omega fields are considered regarding Xapian documents 
> textfields/sortkeys/keywords ?

Xapian allows you to attach a chunk of data to each document (called the
document data!) which it treats as opaque.  It's up to you how you use
this - you could use it to store XML, or a packed binary format, or
an ID for an RDBMS or whatever you like.

Omega uses it to store NAME=VALUE pairs, one per line.  So $field{foo}
looks for a line foo=<value> in the document data and returns <value>.

> I have tried to add my fields as textfields, sortkeys and keyworks, but 
> nothing works.

My guess would be that Xapwrap stores fields in a different way to
Omega, so Omega doesn't find a matching line.

Cheers,
    Olly



More information about the Xapian-discuss mailing list