[Xapian-discuss] Re: Practical example/explanation using an existing database

James Aylett james-xapian at tartarus.org
Thu Jul 26 10:31:29 BST 2007


On Thu, Jul 26, 2007 at 09:36:32AM +0100, John Wards wrote:

> > Can I suggest that you use document data as a field store, rather than
> > document values? That way you can give them textual names, instead of
> > mapping to numbers.
> 
> How do you add data as a field store?

Document data is just a blob. Stick anything you want in there - XML,
YAML... we use a simple text format inside omega (name=value pairs,
one line each).

> Yes I could do some regular expression work when I get data but with
> defining my constants in an include file which I use on indexing and
> searching I have usable names to get/set values.

We've had lots of discussions about the document data, and the current
view is that we don't want to impose specific storage layouts. This
means you have to do some more work yourself, but it isn't a huge
amount. If you're using a dynamic language, it's usually pretty easy
to extract things quickly from it (indeed, in most dynamic languages
you can set things up so you don't have to think about it, by fiddling
with the classes directly).

The thing about values is that they aren't designed to do what you
want, so you may get unexpected performance impacts from using them
like that. There are also constraints on them, although you're
unlikely to hit them in most cases.

J

-- 
/--------------------------------------------------------------------------\
  James Aylett                                                  xapian.org
  james at tartarus.org                               uncertaintydivision.org



More information about the Xapian-discuss mailing list