You are browsing the documentation for version 4.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.

Search Index



Root Node



The search.yml file is used to configure how your entities are indexed to make them usable by the internal search engine of OroPlatform. A fully working example can look like this:

 1# src/Acme/DemoBundle/Resources/config/oro/search.yml
 3    Acme\DemoBundle\Entity\Product:
 4        alias: demo_product
 5        search_template: AcmeDemoBundle:result.html.twig
 6        label: Demo products
 7        route:
 8            name: acme_demo_search_product
 9            parameters:
10                id: id
11        mode: normal
12        title_fields: [name] # deprecated since 2.0
13        fields:
14            -
15                name: name
16                target_type: text
17            -
18                name: description
19                target_type: text
20                target_fields: [description, another_index_name]  parameter.
21            -
22                name: manufacturer
23                relation_type: many-to-one
24                relation_fields:
25                    -
26                        name: name
27                        target_type: text
28                        target_fields: [manufacturer, all_data]
29                    -
30                        name: id
31                        target_type: integer
32                        target_fields: [manufacturer]
33            -
34                name: categories
35                relation_type: many-to-many
36                relation_fields:
37                    -
38                        name: name
39                        target_type: text
40                        target_fields: [all_data]


type: string

An alias used in the from keyword in advanced search.


type: sequence

The list of fields that will be added to the search index. Each entry must be a map that can use the following keys to configure how the property value will be indexed:


type: string

The name of the entity property. This option is required.


type: sequence

When the field represents an association (i.e. a value is configured for relation_type), this is a list of fields from the target entity to index. For each entry all the options of the parent fields option apply.


type: string

When the property denotes an association with another entity, the type of association (one of one-to-one, many-to-many, one-to-many, or many-to-one) must be configured with this option.


type: sequence

The target_fields option list the named indexes to which the property value will be added.

For example, a contact may have the properties firstName, lastName, and namePrefix and all three properties should be searched when the user is loooking for a value in the virtual name field (when using the advanced search API). In this case, all three properties will list the name field in target_fields:

 2    Acme\ContactBunde\Entity\Contact:
 3        fields:
 4            - name: firstName
 5              target_type: text
 6              target_fields: [name]
 7            - name: lastName
 8              target_type: text
 9              target_fields: [name]
10            - name: namePrefix
11              target_type: text
12              target_fields: [name]

If the target_type is text, the data will also be stored in the all_data field implicitly.

If the target_fields option is not given, the data is added to a virtual field whose name is the name as the field’s name (i.e. what is specified under the name key).


type: string

The type of the virtual search field (possible values are datetime, double, integer, and text). This option is required.


type: string

A human readable label to identify the entity in the search results. The configured string will be passed to the translator.


type: string default: normal

The entity behavior for inheritance. For possible values and what they mean, have a look at the constants of the Mode class.


type: map

The route for which a URL is generated when linking from the search result to a concrete entity. The available options are:


type: string

The name of the route.


type: map

The routing parameters, each key is the name of the routing parameter and the value is the name of one of the configured fields.


type: string


type: sequence

Note: Usage of this field is deprecated since 2.0. Register an EntityNameProvider instead. The list of fields to build the title for the result set. The value used here denote to the configured fields.