Rewrite the document indexer to allow single index rebuilds,
less locks and improve performance. Signed-off-by: Roberto Rosario <roberto.rosario.gonzalez@gmail.com>
This commit is contained in:
@@ -116,7 +116,7 @@ class IndexTestCase(BaseTestCase):
|
||||
), ['', '0003']
|
||||
)
|
||||
|
||||
# Document deleted from, index structure should update
|
||||
# Document deleted, index structure should update
|
||||
self.document.delete()
|
||||
self.assertEqual(
|
||||
list(
|
||||
@@ -162,7 +162,7 @@ class IndexTestCase(BaseTestCase):
|
||||
self.assertEqual(list(IndexInstanceNode.objects.all()), [])
|
||||
|
||||
# Rebuild all indexes
|
||||
IndexInstanceNode.objects.rebuild_all_indexes()
|
||||
Index.objects.rebuild()
|
||||
|
||||
# Check that document is in instance node
|
||||
instance_node = IndexInstanceNode.objects.get(value='0001')
|
||||
|
||||
@@ -5,7 +5,7 @@ from user_management.tests import (
|
||||
TEST_USER_USERNAME, TEST_USER_PASSWORD
|
||||
)
|
||||
|
||||
from ..models import Index, IndexInstanceNode
|
||||
from ..models import Index
|
||||
from ..permissions import (
|
||||
permission_document_indexing_create, permission_document_indexing_delete,
|
||||
permission_document_indexing_edit, permission_document_indexing_view
|
||||
@@ -128,7 +128,7 @@ class IndexViewTestCase(GenericDocumentViewTestCase):
|
||||
)
|
||||
|
||||
# Rebuild indexes
|
||||
IndexInstanceNode.objects.rebuild_all_indexes()
|
||||
Index.objects.rebuild()
|
||||
|
||||
return index
|
||||
|
||||
|
||||
Reference in New Issue
Block a user