[Xapian-discuss] Newbie Question: Indexing and searching multiple fields

Bira u.alberton at gmail.com
Thu Dec 4 13:24:44 GMT 2008


I've recently heard of Xapian and was taking a look at it in my spare
time. I have some experience with Ferret, a Ruby IR library, and I
have some questions about Xapian.

Ferret's indexes are similar to Lucene's, and support multiple fields
per document. Now, from reading Xapian's documentation, I know it can
do something similar through values. However, I wasn't able to find
clear instructions for how to search by these values.

For example, let's say I'm indexing documents with authors, titles and
potentially long bodies. In Ferret, each one would be a separate
field, and if I wanted to find all documents written by author "A", I
could pass it an "author:A" query, and it would return those to me.

Now, I know this is possible in Xapian, because I've googled up a few
messages that alude to it, but I haven't found clear instructions on
how to do it. I imagine title and author would be saved as values in a
Xapian docuent, and the body would be the document's data. But how
should I set up the index and Enquires so that it's possible to use
queries like "author:A"?

If this is documented somewhere, I probably missed it. I would
appreciate a pointed to the right documentation :).

-- 
Bira
http://compexplicita.wordpress.com
http://compexplicita.tumblr.com



More information about the Xapian-discuss mailing list