Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DRAFT Allows indexing to continue if an index error occurs, and add log. #3

Draft
wants to merge 4 commits into
base: pulls/v3-backport
Choose a base branch
from

Conversation

adunn49
Copy link

@adunn49 adunn49 commented Oct 9, 2024

These changes allow indexing to continue even when an individual document might fail to index and return an error. In this case, here we want the error to be clearly logged but the index process to continue.

@@ -206,6 +206,11 @@ private function buildIndexedDocumentsList(): ArrayList
$query->where('ShowInSearch = 1');
}

// where appropriate, make sure we only show database total for this index
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

On a project with indexing for subsites, it was noted that the total documents in the database didn't take into account the subsite (and index) to which the document related to.

@@ -598,6 +598,11 @@ public function testEvents(): void
$mock->expects($this->exactly(2))
->method('markIndexed');

$dataObject = DataObjectFakeVersioned::create(['Title' => 'Document']);
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was failing - a document is needed.


$this->expectExceptionMessage('Testing failure');
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Change in behaviour - rather than throw an exception, we now log the error and continue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant