Cedric Jeanneret | 11 Nov 14:47

[python indexer] add meta informations

Hello,

I'm trying to index some blog stuff through python bindings.

I'd like to know how to add some informations (url, title, date, and so on) so that I can reach them through a
xapian.Enquire object..
I believe it's something to be set in xapian.TermGenerator(), but... I can't manage to find which
function. I'm waiting for something like :
xtermgen.add_meta('url', 'value')

but.. well, as you imagine, I can't find which function to use.

Thanks in advance

C. Jeanneret

PS: I prefere not to use scriptindex nor omega, as it's all in a pylon application...

--

-- 
Cédric Jeanneret                 |  System Administrator
021 619 10 32                    |  Camptocamp SA
cedric.jeanneret <at> camptocamp.com  |  PSE-A / EPFL
_______________________________________________
Xapian-discuss mailing list
Xapian-discuss <at> lists.xapian.org
http://lists.xapian.org/mailman/listinfo/xapian-discuss
Tom | 11 Nov 14:57
Gravatar

Re: [python indexer] add meta informations

2009/11/11 Cedric Jeanneret <cedric.jeanneret <at> camptocamp.com>:
> Hello,
>
> I'm trying to index some blog stuff through python bindings.
>
> I'd like to know how to add some informations (url, title, date, and so on) so that I can reach them through a
xapian.Enquire object..
> I believe it's something to be set in xapian.TermGenerator(), but... I can't manage to find which
function. I'm waiting for something like :
> xtermgen.add_meta('url', 'value')
>
> but.. well, as you imagine, I can't find which function to use.

Hi Cedric,

Since you're using Python, you might want to take a look at Xappy,
which provides a higher-level interface to Xapian and lets you work
with named fields rather than terms etc.

http://code.google.com/p/xappy/

regards,
Tom
Olly Betts | 12 Nov 00:37
Favicon
Gravatar

Re: [python indexer] add meta informations


On Wed, Nov 11, 2009 at 02:47:59PM +0100, Cedric Jeanneret wrote: > I'd like to know how to add some informations (url, title, date, and so on) > so that I can reach them through a xapian.Enquire object..
At index time, serialise the data you want to store to get a string (in Python, you'd probably just pickle it) and the store it with Document.set_data(). Then at search time, you unpickle the string retrieved by get_data() on the Document object. Cheers, Olly
Cedric Jeanneret | 12 Nov 08:24

Re: [python indexer] add meta informations

Oh, thank you, Olly.

Best regards,

C.

On Wed, 11 Nov 2009 23:37:06 +0000
Olly Betts <olly <at> survex.com> wrote:


> On Wed, Nov 11, 2009 at 02:47:59PM +0100, Cedric Jeanneret wrote: > > I'd like to know how to add some informations (url, title, date, and so on) > > so that I can reach them through a xapian.Enquire object.. > > At index time, serialise the data you want to store to get a string (in Python, > you'd probably just pickle it) and the store it with Document.set_data(). > > Then at search time, you unpickle the string retrieved by get_data() on the > Document object. > > Cheers, > Olly
-- -- Cédric Jeanneret | System Administrator 021 619 10 32 | Camptocamp SA cedric.jeanneret <at> camptocamp.com | PSE-A / EPFL
_______________________________________________
Xapian-discuss mailing list
Xapian-discuss <at> lists.xapian.org
http://lists.xapian.org/mailman/listinfo/xapian-discuss

Gmane