[Xapian-devel] GSoC xapian node binding

Olly Betts olly at survex.com
Thu Jun 14 13:25:00 BST 2012


On Wed, Jun 13, 2012 at 03:06:03PM -0700, Liam wrote:
> WritableDatabase::ReplaceDocument()
>   might providing an empty term string '' be valid? if not, maybe we should
> let Xapian throw an error?

In most places, an empty string passed for a term acts as a special
"virtual" term which indexes all documents, but not for
replace_document() or delete_document().  I think this inconsistency is
probably better than removing all existing documents if someone passes
in an empty string by mistake to either method, though I don't think
it is actually the result of a deliberate decision.

So it isn't currently valid, but Xapian will throw an exception if you
try to do it, so there's probably not a lot of point duplicating that
check.

Cheers,
    Olly



More information about the Xapian-devel mailing list