Search moodle.org's
Developer Documentation

See Release Notes

  • Bug fixes for general core bugs in 3.11.x will end 14 Nov 2022 (12 months plus 6 months extension).
  • Bug fixes for security issues in 3.11.x will end 13 Nov 2023 (18 months plus 12 months extension).
  • PHP version: minimum PHP 7.3.0 Note: minimum PHP version has increased since Moodle 3.10. PHP 7.4.x is supported too.

Differences Between: [Versions 311 and 402] [Versions 311 and 403]

Search engine for testing purposes.

Copyright: David Monllao {@link http://www.davidmonllao.com}
License: http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
File Size: 153 lines (4 kb)
Included or required: 1 time
Referenced: 0 times
Includes or requires: 0 files

Defines 1 class


Class: engine  - X-Ref

is_installed()   X-Ref
No description

is_server_ready()   X-Ref
No description

add_document($document, $fileindexing = false)   X-Ref
No description

execute_query($data, $usercontexts, $limit = 0)   X-Ref
No description

delete($areaid = null)   X-Ref
No description

to_document(\core_search\base $searcharea, $docdata)   X-Ref
No description

get_course($courseid)   X-Ref
No description

get_search_area($areaid)   X-Ref
No description

get_query_total_count()   X-Ref
No description

set_add_delay($seconds)   X-Ref
Sets an add delay to simulate time taken indexing.

param: float $seconds Delay in seconds for each document

get_and_clear_added_documents()   X-Ref
Gets the list of indexed (added) documents since last time this function
was called.

return: \core_search\document[] List of documents, in order added.

update_schema($oldversion, $newversion)   X-Ref
No description

get_and_clear_schema_updates()   X-Ref
Gets all schema updates applied, as an array. Each entry has an array with two values,
old and new version.

return: array List of schema updates for comparison

delete_index_for_course(int $oldcourseid)   X-Ref
Records delete of course index so it can be checked later.

param: int $oldcourseid Course id
return: bool True to indicate action taken

delete_index_for_context(int $oldcontextid)   X-Ref
Records delete of context index so it can be checked later.

param: int $oldcontextid Context id
return: bool True to indicate action taken

get_and_clear_deletes()   X-Ref
Gets all course/context deletes applied, as an array. Each entry is an array with two
values, the first is either 'course' or 'context' and the second is the id deleted.

return: array List of deletes for comparison