MDL-60720 core_search: Indexing halts on failed get_document
authorsam marshall <s.marshall@open.ac.uk>
Tue, 7 Nov 2017 12:14:06 +0000 (12:14 +0000)
committersam marshall <s.marshall@open.ac.uk>
Tue, 7 Nov 2017 16:36:37 +0000 (16:36 +0000)
commit4b0facc98448226cc7aec9e9762571a3d919d73b
tree77e0a276e92f931dacdd21017edd0f33f2dcbbb3
parent159b4e5d8c773fc1c71cb97e728d05f4cbb9d49e
MDL-60720 core_search: Indexing halts on failed get_document

The recordsets used for search indexing sometimes return results
which are invalid (e.g. cannot be found in database). When this
happens, the result in the iterator for the recordset will be
false. Due to a bug, the iterator used to stop when it encountered
a false value, which prevented indexing from getting past the
problematic record.

In addition, the iterator that skips future data resulted in the
current() function of its parent indicator being called twice per
entry, which meant that search indexing called get_document()
twice as many times.
search/classes/skip_future_documents_iterator.php
search/tests/skip_future_documents_iterator_test.php [new file with mode: 0644]