Full-Text Search Setup for Bitrix CMS
Site search in Bitrix operates through the search module. During initial configuration, search either finds nothing (index not built), finds everything including service pages, or works slowly with large content volumes.
How Bitrix Search Works
The search module builds a full-text index in tables:
-
b_search_content— indexed content (titles, tags, body) -
b_search_content_stem— stem index (word roots for morphology) -
b_search_tag— search tags
Indexing happens automatically when saving elements (infoblocks, pages) through the OnSearchIndex event handler. Force reindexing via the administrative interface or an agent.
Configuring Search Sources
Settings → Search → Module Settings:
- Save search history — useful for analytics
- Morphology — enable for searching word forms ("buy", "bought", "purchase")
- Characters in index — minimum word length for indexing (3 recommended)
Configuring indexed sources (Settings → Search → Reindexing):
- Select infoblocks for indexing
- Specify which properties to index
- Exclude technical pages and service content
Search Component
$APPLICATION->IncludeComponent('bitrix:search.page', '', [
'SITE_ID' => 's1',
'SEARCH_CACHE_TIME' => 3600,
'DEFAULT_WORD' => '',
'MINIMAL_QUERY_LEN' => 3,
'USE_SUGGEST' => 'Y', // suggestions on input
'arrFILTER' => [ // search sources
['MODULE_ID' => 'iblock', 'PARAM1' => 'catalog', 'PARAM2' => 5],
['MODULE_ID' => 'iblock', 'PARAM1' => 'content'],
],
]);
Morphology and Relevance
Bitrix uses built-in stemming for Russian language. With morphology enabled, a query for "красные платья" (red dresses) will find "красное платье" (red dress) and "красный платья" (red dresses). The morphological index is built in b_search_content_stem.
Result relevance is managed by weights:
- Word in title — high weight
- Word in body — medium weight
- Word in tag — medium weight
Weight settings: b_search_content.PARAM1 stores additional source parameters.
Reindexing and Performance
With a large catalog (50,000+ products), full reindexing takes significant time. Solutions:
- Use incremental indexing (only changed elements)
- Split reindexing into batches via an agent
- For high-load projects, switch to an external solution (Elasticsearch + custom module)
Index status monitoring:
$rsSearch = CSearch::GetList('s1', ['SITE_ID' => 's1'], false, ['nTopCount' => 1]);
// Date of last index update
Implementation Timeline
Basic search setup with catalog and content indexing — 2–4 hours. Fine-tuning morphology, weights, and exclusions — 4–8 hours. Elasticsearch integration — 2–5 days.







