Views: 13789
Last Modified: 24.06.2015

External full text search Sphinx is available in Bitrix products v. 14.0.0. It ensures fast and efficient search on site, reduces the server load, and is fully integrated in Search module components.

If for any reason the reference environment Bitrix Virtual Appliance v. 4.3 and higher containing Sphinx is not applied, you can set it up by yourself according to the following recommendation.

  1. First of all, you need to install the Sphinx package in your environment. See documentation the section Installation on the official website for the procedure description.

    For example, suppose the default Sphinx settings file directory is /etc/sphinxsearch/.

  2. You have to set up Sphinx using the configuration file /etc/sphinxsearch/sphinx.conf.

    Minimal configuration code
  3. The basic directives that can be changed depending on the server settings and that must be considered are:

    Section searchd:
    • listen – indicate IP, port, Unix-domain socket path or protocol listened by search daemon (in this case, these are ports 9312 and 9306 with MySQL protocol);
    • log – name of log-file governing Sphinx operation and its location;
    • query_log – name of log-file governing Sphinx search requests and its location;
    • binlog_path – path to binary logs location (this parameter is important since if you indicate the directory without permission to its log the search daemon is not started);
    • binlog_max_log_size – maximum size of binary log file after which new file is created.

    Section indexer:
    • lemmatizer_cache – maximum the size of morphological search vocabulary cache;
    • lemmatizer_base – directory to store language vocabularies (ru.pak, en.pak, de.pak) for morphological search that you must preliminarily download and put into the present directory.

    Section index bitrix:
    • path – index files path and names;
    • charset_type – site code:
      • for UTF – utf-8;
      • for others – sbcs.
  4. Restart Sphinx.
  5. Go to Bitrix product page Search module settings (Control Panel > Settings > System settings > Module settings > Search) ) and set up the Sphinx connection as a search engine:

    • Use full text search engine – select Sphinx;
    • Connection string for index control (MySql protocol) – indicate IP and connection port for indexing using MySql protocol;
    • Index ID – indicate index name (e.g. bitrix);
    • This page also contains a sample of the configuration file for the Sphinx index in Bitrix products (only for reference).
  6. After the settings are applied in the Search module, click the button Re-index website now in the Administration section to reindex the site:

    Note. If Bitrix products have the Social Network module installed, indexing using the search module must be followed by the reindexing of the social network in the public section. To do this, go to any section of the social network in development mode (where socialnetwork, socialnetwork_group, socialnetwork_user components are installed) and click Reindex in Tools:

Now, the minimal set up of Sphinx as the Bitrix products search engine is finished.

Note. For more information on the Sphinx search engine tuning, see the official documentation on this product.

Courses developed by «Bitrix», Inc.