Important

You are browsing the documentation for version 3.1 of OroCommerce, OroCRM and OroPlatform, which is no longer maintained. Read version 5.1 (the latest LTS version) of the Oro documentation to get up-to-date information.

See our Release Process documentation for more information on the currently supported and upcoming releases.

ORM Search Engine

OroSearchBundle provides ORM search engine out of the box. It stores index data in DB tables and uses fulltext index to perform search. Bundle supports search index for both MySQL and PostgreSQL DBMS. ORM engine is used by default.

Configuration

ORM engine configuration is stored in Oro/Bundle/SearchBundle/Resources/config/oro/search_engine/orm.yml and does not require any additional engine parameters.

ORM search engine has a straightforward implementation - it simply stores index data in appropriate tables: separate tables for text, datetime, decimal and integer value, and another table to store general information. The table that stores text data has fulltext index.

 1parameters:
 2    oro_search.engine.class: Oro\Bundle\SearchBundle\Engine\Orm
 3
 4services:
 5    oro_search.search.engine:
 6        class: %oro_search.engine.class%
 7        arguments:
 8            - '@doctrine'
 9            - '@oro_entity.doctrine_helper'
10            - '@oro_search.mapper'
11        calls:
12            - [setLogQueries, [%oro_search.log_queries%]]

Each supported DBMS has its own driver that knows about specific search implementation and generates valid SQL.

1parameters:
2    oro_search.drivers:
3        pdo_mysql: Oro\Bundle\SearchBundle\Engine\Orm\PdoMysql
4        pdo_pgsql: Oro\Bundle\SearchBundle\Engine\Orm\PdoPgsql

Features

Currently, special characters are not supported in the ORM search engines. Every character that is not a unicode letter or a number is replaced with a whitespace before the query.

Another feature of ORM engine is fulltext index processing. Configuration defines fulltext manager Oro\Bundle\SearchBundle\Engine\FulltextIndexManager that is used during installation and inside a special listener - it allows the system to create fulltext indexes bypassing Doctrine processing.

Note for MySQL driver: MySQL has a lower limit to the string length for fulltext index called ft_min_word_len, i.e. if a string is shorter than this limit, the fulltext index will not be used. It is recommended to change this value to 3.