mirror of
https://github.com/moodle/moodle.git
synced 2025-04-21 16:32:18 +02:00
MDL-68776 search: remove support for optional add_documents return.
All six returned array elements must now be present.
This commit is contained in:
parent
0780e87f06
commit
5021b3a5b5
@ -1289,15 +1289,8 @@ class manager {
|
||||
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) {
|
||||
@ -1454,19 +1447,8 @@ class manager {
|
||||
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) {
|
||||
|
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user