Skip to content
Branch: master
Find file Copy path
Find file Copy path
3 contributors

Users who have contributed to this file

@yshyshkin @ASKozienko @rhoman
55 lines (42 sloc) 2.24 KB

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.


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

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

    oro_search.engine.class: Oro\Bundle\SearchBundle\Engine\Orm

        class: %oro_search.engine.class%
            - @doctrine
            - @oro_entity.doctrine_helper
            - @oro_search.mapper
            - [setLogQueries, [%oro_search.log_queries%]]

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

        pdo_mysql: Oro\Bundle\SearchBundle\Engine\Orm\PdoMysql
        pdo_pgsql: Oro\Bundle\SearchBundle\Engine\Orm\PdoPgsql


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

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

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

You can’t perform that action at this time.