MCPcopy Create free account
hub / github.com/django-haystack/django-haystack / clear

Method clear

haystack/indexes.py:340–351  ·  view source on GitHub ↗

Clears the entire index. If ``using`` is provided, it specifies which connection should be used. Default relies on the routers to decide which backend should be used.

(self, using=None)

Source from the content-addressed store, hash-verified

338 backend.remove(instance, **kwargs)
339
340 def clear(self, using=None):
341 """
342 Clears the entire index.
343
344 If ``using`` is provided, it specifies which connection should be
345 used. Default relies on the routers to decide which backend should
346 be used.
347 """
348 backend = self.get_backend(using)
349
350 if backend is not None:
351 backend.clear(models=[self.get_model()])
352
353 def reindex(self, using=None):
354 """

Callers 1

reindexMethod · 0.95

Calls 2

get_backendMethod · 0.95
get_modelMethod · 0.95

Tested by

no test coverage detected