Modified:
/trunk/ChangeLog
/trunk/xappy/indexerconnection.py
=======================================
--- /trunk/ChangeLog Tue Mar 30 09:41:07 2010
+++ /trunk/ChangeLog Tue Mar 30 10:09:23 2010
@@ -1,3 +1,8 @@
+Tue Mar 30 17:08:58 GMT 2010 Richard Boulton <ric...@tartarus.org>
+
+ * xappy/indexerconnection.py: If a document is replaced with
+ store_only set, remove it from the cache.
+
Tue Mar 30 16:40:31 GMT 2010 Richard Boulton <ric...@tartarus.org>
* xappy/unittests/spell_correct_1.py: Enable an old test for a bug
=======================================
--- /trunk/xappy/indexerconnection.py Wed Jan 27 07:29:29 2010
+++ /trunk/xappy/indexerconnection.py Tue Mar 30 10:09:23 2010
@@ -413,13 +413,18 @@
xapdoc = document.prepare()
if self._index.get_metadata('_xappy_hascache'):
- # Copy any cached query items over to the new document.
- olddoc, olddocid = self._get_xapdoc(id, xapid)
- if olddoc is not None:
- for value in olddoc.values():
- if value.num < self._cache_manager_slot_start:
- continue
- xapdoc.add_value(value.num, value.value)
+ if store_only:
+ # Remove any cached items from the cache - the document is
no
+ # longer wanted in search results.
+ self._remove_cached_items(id, xapid)
+ else:
+ # Copy any cached query items over to the new document.
+ olddoc, olddocid = self._get_xapdoc(id, xapid)
+ if olddoc is not None:
+ for value in olddoc.values():
+ if value.num < self._cache_manager_slot_start:
+ continue
+ xapdoc.add_value(value.num, value.value)
if xapid is None:
self._index.replace_document('Q' + id, xapdoc)