Permalink
Browse files

Revert "Removed compatibility argument with pre-2.0 haystack"

This reverts commit d3f1e01.
  • Loading branch information...
1 parent f67036e commit 253c4c2898f16a5dee2c99324621a14e3e2a789b @claudep claudep committed May 18, 2017
Showing with 7 additions and 2 deletions.
  1. +7 −2 xapian_backend.py
View
@@ -239,14 +239,16 @@ def column(self):
self._update_cache()
return self._columns
- def update(self, index, iterable):
+ def update(self, index, iterable, commit=True):
"""
Updates the `index` with any objects in `iterable` by adding/updating
the database as needed.
Required arguments:
`index` -- The `SearchIndex` to process
`iterable` -- An iterable of model instances to index
+ Optional arguments:
+ `commit` -- ignored
For each object in `iterable`, a document is created containing all
of the terms extracted from `index.full_prepare(obj)` with field prefixes,
@@ -492,12 +494,15 @@ def add_datetime_to_document(termpos, prefix, term, weight):
finally:
database.close()
- def remove(self, obj):
+ def remove(self, obj, commit=True):
"""
Remove indexes for `obj` from the database.
We delete all instances of `Q<app_name>.<model_name>.<pk>` which
should be unique to this object.
+
+ Optional arguments:
+ `commit` -- ignored
"""
database = self._database(writable=True)
database.delete_document(TERM_PREFIXES[ID] + get_identifier(obj))

0 comments on commit 253c4c2

Please sign in to comment.