[Xapian-discuss] Simulating Fields

Luis Alberto Zarrabeitia Gomez kyrie at uh.cu
Sat May 2 22:19:56 BST 2009


I'm very new with Xapian.

I'm trying to index a set of documents (pretty big). They have titles,
categories, tags, and of course, the document bodies themselves. I would like to
be able to query for any of those "fields". In particular, in the case of the
titles, I'd like to be able to retrieve the document with _this exact title_.

First, am I right to assume that Xapian has no concept of "fields" and that they
must be simulated with term prefixes? I couldn't find a lot of documentation
about it...

If they must be simulated, what's the best way to do it? Currently, I'm indexing
the documents:

=== python ===
       indexer.set_document(doc)
       indexer.index_text_without_positions(page.text)
       indexer.index_text(page.title)
       indexer.index_text(page.title,1,"XTITLE")
===

delve shows the title terms indexed with the XTITLE prefix, but, how do I write
a query to search for those? How can I write a query to retrieve a document
given the title (but not those with similar titles)?

-- 
Luis Zarrabeitia
Facultad de Matemática y Computación, UH
http://profesores.matcom.uh.cu/~kyrie





-- 
Participe en Universidad 2010, del 8 al 12 de febrero de 2010
La Habana, Cuba 
http://www.universidad2010.cu




More information about the Xapian-discuss mailing list