[Xapian-discuss] Seek help with simple writer/search using Perl

Jeff Anderson captvanhalen at gmail.com
Mon Apr 9 21:11:07 BST 2007


Thanks for the answers Olly (and Ralf).

Of course, now i have more questions. :)



On 4/9/07, Olly Betts <olly at survex.com> wrote:
> The document data is opaque as far as Xapian is concerned.  Store
> whatever you want there (typically you'd put things you need to display
> a match to the user, like the title, a sample of text, etc).

Great. In Lucene i was able to do this like so:

Plucene::Document::Field->Text($key => $value)

The key point is here is that i could add multiple key/value pairs,
and be able to retrieve them when it came time to display results to
the user. I would store the Title, URL, and a text blurb in this
manner.

However ... can i store key/values in Search::Xapian::Document::set_data() ??

According to the docs, it only takes a single argument called "data" :

"set_data <data>
    Set all document data. This can be anything you like."

How can i store fields such as URL AND title AND description so that i
can retrieve them from the objects returned in a successful match?

Thanks again,
-- 
jeffa



More information about the Xapian-discuss mailing list