Search moodle.org's
Developer Documentation

See Release Notes
Long Term Support Release

  • Bug fixes for general core bugs in 4.1.x will end 13 November 2023 (12 months).
  • Bug fixes for security issues in 4.1.x will end 10 November 2025 (36 months).
  • PHP version: minimum PHP 7.4.0 Note: minimum PHP version has increased since Moodle 4.0. PHP 8.0.x is supported too.

Differences Between: [Versions 401 and 402] [Versions 401 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