Skip to content

Commit

Permalink
Merge branch 'MDL-68776' of https://github.com/paulholden/moodle
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewnicols committed Mar 1, 2023
2 parents 31aed9a + 5021b3a commit cd53dbb
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 20 deletions.
22 changes: 2 additions & 20 deletions search/classes/manager.php
Original file line number Diff line number Diff line change
Expand Up @@ -1289,15 +1289,8 @@ public function index($fullindex = false, $timelimit = 0, \progress_trace $progr
if ($batches !== $numdocs + $numdocsignored) {
$batchinfo = ' (' . $batches . ' batch' . ($batches === 1 ? '' : 'es') . ')';
}
} else if (count($result) === 5) {
// Backward compatibility for engines that don't return a batch count.
[$numrecords, $numdocs, $numdocsignored, $lastindexeddoc, $partial] = $result;
// Deprecated since Moodle 3.10 MDL-68690.
// TODO: MDL-68776 This will be deleted in Moodle 4.2.
debugging('engine::add_documents() should return $batches (5-value return is deprecated)',
DEBUG_DEVELOPER);
} else {
throw new coding_exception('engine::add_documents() should return $partial (4-value return is deprecated)');
throw new \coding_exception('engine::add_documents() should return 6 values');
}

if ($numdocs > 0) {
Expand Down Expand Up @@ -1454,19 +1447,8 @@ public function index_context($context, $singleareaid = '', $timelimit = 0,
if ($batches !== $numdocs + $numdocsignored) {
$batchinfo = ' (' . $batches . ' batch' . ($batches === 1 ? '' : 'es') . ')';
}
} else if (count($result) === 5) {
// Backward compatibility for engines that don't return a batch count.
[$numrecords, $numdocs, $numdocsignored, $lastindexeddoc, $partial] = $result;
// Deprecated since Moodle 3.10 MDL-68690.
// TODO: MDL-68776 This will be deleted in Moodle 4.2 (as should the below bit).
debugging('engine::add_documents() should return $batches (5-value return is deprecated)',
DEBUG_DEVELOPER);
} else {
// Backward compatibility for engines that don't support partial adding.
list($numrecords, $numdocs, $numdocsignored, $lastindexeddoc) = $result;
debugging('engine::add_documents() should return $partial (4-value return is deprecated)',
DEBUG_DEVELOPER);
$partial = false;
throw new \coding_exception('engine::add_documents() should return 6 values');
}

if ($numdocs > 0) {
Expand Down
5 changes: 5 additions & 0 deletions search/upgrade.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
This files describes API changes in /search/*,
information provided here is intended especially for developers.

=== 4.2 ===

* Support for optional final element returned by engine `add_documents()` implementations is now removed, all
six expected returned array elements must be present

=== 3.10 ===

* Search indexing now supports sending multiple documents to the server in a batch. This is implemented
Expand Down

0 comments on commit cd53dbb

Please sign in to comment.