[Xapian-discuss] Saving multiple fields within one Xapian document

James Aylett james-xapian at tartarus.org
Mon Nov 11 18:48:22 GMT 2013


On 11 Nov 2013, at 18:07, "Ciaccio, Mauro" <Mauro.Ciaccio at ghxeurope.com> wrote:

> I am experimenting with substituting a SQL Server Full Text Catalogue search with Xapian.
> 
> I am not sure what is the correct / best way to build the Xapian index. In my code I have tried two approaches
[snip]

So the two you've tried are:

 * using document data
 * using document values

Usually, document data is what you want here. There's an example (in python, but should be readable to all) at <http://getting-started-with-xapian.readthedocs.org/en/latest/practical_example/indexing/writing_the_code.html> which serialises a bunch of different pieces of information using JSON, and stores that in the document data.

You can read more about document data & document values here: <http://getting-started-with-xapian.readthedocs.org/en/latest/concepts/indexing/index.html> — document values are intended for use during search, while document data is generally used when displaying search results, but not when evaluating every possible matching document during a search. (Which roughly translates as: avoid storing document values that you aren't going to use.)

Hopefully the various worked examples in that getting started guide are helpful in understanding how to tackle various problems with Xapian.

Best,
James

-- 
 James Aylett, occasional trouble-maker
 xapian.org




More information about the Xapian-discuss mailing list