Documentation

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

FunctionDescriptionAvailable from version
stemmingReturns an array of constant keyword stems.
stemming_defaultFunction of text morphological parsing, applied by default.
stemming_stop_defaultStopword function, applied by default.
stemming_letter_defaultFunction returns alphabet by default.
tags_prepareReturns an array of tags.
InputTagsReturns HTML code to input tags with autocompletion support by default.

Search module classes

ClassDescriptionAvailable from version
CSearchClass to index site and index search.
CSearchCustomRankSorting rules support class.
CSiteMapGoogle Sitemap support class.
CSearchTagsTags support class.

Search module events

EventDescriptionAvailable from version
BeforeIndexCalled prior to element indexing.
OnSearchCalled prior to executing search queries.
OnReIndexCalled when building the search index.
OnSearchGetFileContentCalled during the main module data indexing.
OnSearchGetURLCalled when formatting an element in the search results.
OnSearchGetTagCalled during tag string parsing.
OnBeforeFullReindexClearCalled at the first step for full re-indexing, directly before deleting all search index data.
OnBeforeIndexDeleteCalled before deleting portion of the search index.
OnBeforeIndexUpdateCalled before updating the search index.
OnAfterIndexAddCalled after adding new data in the search index.
OnSearchCheckPermissionsCalled when building a search query.

© «Bitrix24», 2001-2024
Up