Search
Prior to installing the Search module, check whether it was already installed and connect it via the following structure:
<?
if(CModule::IncludeModule("search"))
{
//here you can use the module functions
}
?>
The Search module performs pre-indexing and subsequent retrieval of information as per user query. Indexing includes saved text, owner module, element code, language, web-address, title, text and two arbitrary parameters of the indexed element, as well as the list of codes for user group, that have access permissions for 'read' instruction (as a minimum) for this element. Search is resulting in retrieval of list of results, satisfying the inputted query string (processed with account of the query language), as well as the set of defined constraints (owner module, element code, site, two arbitrary parameters)
The Search module internal logic does not contain any data on specifics and structure of the data for other modules. When indexing is in progress, modules themselves are passing the information that must be indexed based on queries. This transfer occurs as an array of a specified structure. The connection between the search module and other system modules is made via the message system.
Special constants.
Public functions and returned values
Function | Description | Available from version |
---|---|---|
stemming | Returns an array of constant keyword stems. | |
stemming_default | Function of text morphological parsing, applied by default. | |
stemming_stop_default | Stopword function, applied by default. | |
stemming_letter_default | Function returns alphabet by default. | |
tags_prepare | Returns an array of tags. | |
InputTags | Returns HTML code to input tags with autocompletion support by default. |
Search module classes
Class | Description | Available from version |
---|---|---|
CSearch | Class to index site and index search. | |
CSearchCustomRank | Sorting rules support class. | |
CSiteMap | Google Sitemap support class. | |
CSearchTags | Tags support class. |
Search module events
Event | Description | Available from version |
---|---|---|
BeforeIndex | Called prior to element indexing. | |
OnSearch | Called prior to executing search queries. | |
OnReIndex | Called when building the search index. | |
OnSearchGetFileContent | Called during the main module data indexing. | |
OnSearchGetURL | Called when formatting an element in the search results. | |
OnSearchGetTag | Called during tag string parsing. | |
OnBeforeFullReindexClear | Called at the first step for full re-indexing, directly before deleting all search index data. | |
OnBeforeIndexDelete | Called before deleting portion of the search index. | |
OnBeforeIndexUpdate | Called before updating the search index. | |
OnAfterIndexAdd | Called after adding new data in the search index. | |
OnSearchCheckPermissions | Called when building a search query. |