[Xapian-discuss] Why is a "DocNotFoundError" when deleting a document a Fatal error in php?

Arjen van der Meijden acmmailing at tweakers.net
Fri Oct 28 08:45:04 BST 2005


Currently I've built a php-based indexer for a new set-up were we'd like 
to use Xapian as back-end. All works quite well, except deleting a 
document. It may occur that the index has not been synced before a 
document is to be deleted again.

I.e. a document is queued to be added, but also queued to be deleted. 
Now the prettiest way to handle that is just to remove the document from 
the queue, but that's a lot of extra checks for a few rare cases I don't 
really like to do.
So I basically just delete the document, if it doesn't exist well, 
that's perfectly ok for me. But Xapian considers it an error and throws 
the DocNotFoundError, which gets wrapped to a Fatal Error.
PHP cannot recover from such a situation as easily as C or Java can 
(try-catch doesn't exist in php4, nor would it work for such a situation 
in 5 I think).
Of course I can write my own error handler in php, but it may also be 
worth to consider to lower the severity of such a case?

Best regards,

Arjen



More information about the Xapian-discuss mailing list