Setting up search suggestions in 1C-Bitrix

Our company is engaged in the development, support and maintenance of Bitrix and Bitrix24 solutions of any complexity. From simple one-page sites to complex online stores, CRM systems with 1C and telephony integration. The experience of developers is confirmed by certificates from the vendor.
Our competencies:
Development stages
Latest works
  • image_website-b2b-advance_0.png
    B2B ADVANCE company website development
    1177
  • image_bitrix-bitrix-24-1c_fixper_448_0.png
    Website development for FIXPER company
    811
  • image_bitrix-bitrix-24-1c_development_of_an_online_appointment_booking_widget_for_a_medical_center_594_0.webp
    Development based on Bitrix, Bitrix24, 1C for the company Development of an Online Appointment Booking Widget for a Medical Center
    564
  • image_bitrix-bitrix-24-1c_mirsanbel_458_0.webp
    Development based on 1C Enterprise for MIRSANBEL
    747
  • image_crm_dolbimby_434_0.webp
    Website development on CRM Bitrix24 for DOLBIMBY
    655
  • image_crm_technotorgcomplex_453_0.webp
    Development based on Bitrix24 for the company TECHNOTORGKOMPLEKS
    976

Search Suggestions Setup for Bitrix CMS

Search suggestions — a dropdown list with options when typing in the search field. In Bitrix, suggestions are implemented through the bitrix:search.suggest component and work via AJAX request to the search controller. Without proper setup, suggestions either don't appear or show irrelevant results.

How Suggestions Work

With each character input (with debounce), the browser sends a GET request to /bitrix/components/bitrix/search.suggest/ajax.php with parameters q (query) and lang (language). Response is JSON with a list of suggestions.

The source of data for suggestions is the search index b_search_content — the same data as for main search. Therefore, suggestions only work with a built index.

Including the Suggestions Component

In the search form template:

$APPLICATION->IncludeComponent('bitrix:search.suggest', '', [
    'SITE_ID'              => SITE_ID,
    'START_SEARCH_FORM_ID' => 'searchForm',  // search form ID
    'SUGGEST_MAX_COUNT'    => 10,             // maximum suggestions
    'MIN_QUERY_LENGTH'     => 3,             // minimum characters for query
    'SUGGEST_CACHE_TIME'   => 3600,          // response cache
    'FILTER_NAME'          => 'arrFILTER',
    'arrFILTER'            => [
        ['MODULE_ID' => 'iblock', 'PARAM1' => 'catalog', 'PARAM2' => 5],
    ],
]);

The search form must have a field named q and ID specified in START_SEARCH_FORM_ID.

Customizing Suggestions Appearance

The component template is located at /bitrix/components/bitrix/search.suggest/templates/.default/. For customization — copy to /local/components/bitrix/search.suggest/templates/custom/ and edit.

The standard template outputs only title text. Often required to add product images and prices — implemented via custom template with additional query to catalog by found element IDs.

Search by Trade Offers (SKU)

By default, search and suggestions work on main products, not SKUs. To search by SKU codes, enable indexing of trade offers:

Settings → Search → Additional settings — enable indexing of trade offer properties, specify offers infoblock.

AJAX Request Performance

With high traffic, suggestion AJAX requests can load the server. Solutions:

  • Increase SUGGEST_CACHE_TIME — suggestions are cached in Bitrix file cache
  • Enable managed cache for the component
  • For high-load sites — deliver suggestions via separate cached endpoint with TTL

Implementation Timeline

Basic suggestions setup with component connection — 1–2 hours. Custom template with images and prices — 3–5 hours.