[ Index ] |
PHP Cross Reference of Unnamed Project |
[Source view] [Print] [Project Stats]
Search subsystem manager.
Copyright: | Prateek Sachan {@link http://prateeksachan.com} |
License: | http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later |
File Size: | 719 lines (25 kb) |
Included or required: | 0 times |
Referenced: | 0 times |
Includes or requires: | 0 files |
manager:: (20 methods):
__construct()
instance()
is_global_search_enabled()
search_engine_instance()
get_engine()
get_area_classname()
get_search_area()
get_search_areas_list()
clear_static()
generate_areaid()
extract_areaid_parts()
get_areas_user_accesses()
paged_search()
search()
optimize_index()
index()
reset_config()
delete_index()
delete_index_by_id()
get_areas_config()
__construct($engine) X-Ref |
Constructor, use \core_search\manager::instance instead to get a class instance. param: \core_search\base The search engine to use |
instance() X-Ref |
Returns an initialised \core_search instance. return: \core_search\manager |
is_global_search_enabled() X-Ref |
Returns whether global search is enabled or not. return: bool |
search_engine_instance() X-Ref |
Returns an instance of the search engine. return: \core_search\engine |
get_engine() X-Ref |
Returns the search engine. return: \core_search\engine |
get_area_classname($areaid) X-Ref |
Returns a search area class name. param: string $areaid return: string |
get_search_area($areaid) X-Ref |
Returns a new area search indexer instance. param: string $areaid return: \core_search\base|bool False if the area is not available. |
get_search_areas_list($enabled = false) X-Ref |
Return the list of available search areas. param: bool $enabled Return only the enabled ones. return: \core_search\base[] |
clear_static() X-Ref |
Clears all static caches. return: void |
generate_areaid($componentname, $areaname) X-Ref |
Generates an area id from the componentname and the area name. There should not be any naming conflict as the area name is the class name in component/classes/search/. param: string $componentname param: string $areaname return: void |
extract_areaid_parts($areaid) X-Ref |
Returns all areaid string components (component name and area name). param: string $areaid return: array Component name (Frankenstyle) and area name (search area class name) |
get_areas_user_accesses($limitcourseids = false) X-Ref |
Returns the contexts the user can access. The returned value is a multidimensional array because some search engines can group information and there will be a performance benefit on passing only some contexts instead of the whole context array set. param: array|false $limitcourseids An array of course ids to limit the search to. False for no limiting. return: bool|array Indexed by area identifier (component + area name). Returns true if the user can see everything. |
paged_search(\stdClass $formdata, $pagenum) X-Ref |
Returns requested page of documents plus additional information for paging. This function does not perform any kind of security checking for access, the caller code should check that the current user have moodle/search:query capability. If a page is requested that is beyond the last result, the last valid page is returned in results, and actualpage indicates which page was returned. param: stdClass $formdata param: int $pagenum The 0 based page number. return: object An object with 3 properties: |
search(\stdClass $formdata, $limit = 0) X-Ref |
Returns documents from the engine based on the data provided. This function does not perform any kind of security checking, the caller code should check that the current user have moodle/search:query capability. It might return the results from the cache instead. param: stdClass $formdata param: int $limit The maximum number of documents to return return: \core_search\document[] |
optimize_index() X-Ref |
Merge separate index segments into one. |
index($fullindex = false) X-Ref |
Index all documents. param: bool $fullindex Whether we should reindex everything or not. return: bool Whether there was any updated document or not. |
reset_config($areaid = false) X-Ref |
Resets areas config. param: string $areaid return: void |
delete_index($areaid = false) X-Ref |
Deletes an area's documents or all areas documents. param: string $areaid The area id or false for all return: void |
delete_index_by_id($id) X-Ref |
Deletes index by id. param: int Solr Document string $id |
get_areas_config($searchareas) X-Ref |
Returns search areas configuration. param: \core_search\base[] $searchareas return: \stdClass[] $configsettings |
Generated: Thu Aug 11 10:00:09 2016 | Cross-referenced by PHPXref 0.7.1 |