Pascal Opitz
2009-Oct-26 23:26 UTC
[Xapian-discuss] replace_document and delete_document with string UID not working in PHP bindings?
Hello, new to the list, but I couldn't find info on this by using the search. I am currently trying to index documents using the replace_document method, and am passing a string instead of a docid: $this->xapian_write_db->replace_document((string) self::XAPIAN_PREFIX_UNIQUE . $row['item_guid'], $doc); In this example, the term will end up as 'Q' plus a guid like '1744e18c4d37c8294d5a682e885c13dc'. If I run this again, the document gets added again, and not replaced, and I end up with multiple matches on the same search term. Also, when I use delete_document with a string as UID, there seems to be no match and my document will still be in place. Is this a known quirk/bug, and is there a workaround for this, or will I have to run a query for the string UID and extract the docid for each match?
Pascal Opitz
2009-Nov-03 11:04 UTC
[Xapian-discuss] replace_document and delete_document with string UID not working in PHP bindings?
Sorry, tried to ask this question before, not sure why it went in as reply to another thread: http://lists.xapian.org/pipermail/xapian-discuss/2009-October/007249.html Apologies for the confusion. Not really used to mailing lists. So here it is again: I am currently trying to index documents using the replace_document method, and am passing a string instead of a docid: $this->xapian_write_db->replace_document((string) self::XAPIAN_PREFIX_UNIQUE . $row['item_guid'], $doc); In this example, the term will end up as 'Q' plus a guid like '1744e18c4d37c8294d5a682e885c13dc'. If I run this again, the document gets added again, and not replaced, and I end up with multiple matches on the same search term. Also, when I use delete_document with a string as UID, there seems to be no match and my document will still be in place. Is this a known quirk/bug, and is there a workaround for this, or will I have to run a query for the string UID and extract the docid for each match? I might add that this is using the latest ubuntu packages. For now I am using a numeric foreign ID, and that works fine, but it means that I will have to alter a very large table in a live environment, which I'd like to avoid. Best Pascal Opitz