Solr in Simple Search and Reference Editors Search
Backoffice provides Solr Search in simple searching and in Reference Editors Search levels. You can use Solr features like Autosuggesions or Autocorrections.
Text Search
The text search is done when you enter some text in the search field, but you don't know the exact property that is to be searched (as opposed to the advanced search, where values are provided for each attribute). In Backoffice Application, text search happens when you use simple searching, and in Reference editors search. It depends on the configuration for the Solr indexed property.
Solr indexed property has the FreeTextSearch attribute. It defines if the indexed property is to be taken into account when text search is performed and what type of search is to be performed on this attribute (fuzzy search, phrase search etc.). Additionally, you can define boost, which means that you can specify for instance if the text matching the identifier property has a higher score than a fuzzy search in description property.
-
Navigate to .
-
Pick the indexed type of your interest to display it in the Editor Area.
-
Navigate to the INDEXED PROPERTIES tab and choose a property you want to change settings for. From the row menu
of the inline editor, choose the Edit Details option. -
A pop-up window appears where you can define your preferences:
_backofficeLabel
<context merge-by="type" parent="GenericItem" type="Product" component="base" module="platformbackoffice">
<y:base xmlns:y="http://www.hybris.com/cockpit/config/hybris" xmlns:advanced-search="http://www.hybris.com/cockpitng/config/advancedsearch" xmlns:df="http://www.hybris.com/cockpitng/component/dynamicForms" xmlns:dsb="http://www.hybris.com/cockpitng/config/dashboard" xmlns:editorArea="http://www.hybris.com/cockpitng/component/editorArea" xmlns:explorer-tree="http://www.hybris.com/cockpitng/config/explorertree" xmlns:grid-view="http://www.hybris.com/cockpitng/component/gridView" xmlns:list-view="http://www.hybris.com/cockpitng/component/listView" xmlns:na="http://www.hybris.com/cockpitng/config/notifications" xmlns:simple-search="http://www.hybris.com/cockpitng/config/simplesearch" xmlns:wz="http://www.hybris.com/cockpitng/config/wizard-config">
<y:labels>
<y:label>( name ?: '' ) + ' ['+ ( code ?: '' ) +'] - ' + @labelService.getObjectLabel(catalogVersion)</y:label>
<y:description>description != null ? description : @labelService.getObjectLabel(#this)</y:description>
</y:labels>
<y:preview urlQualifier="thumbnail?:picture"/>
</y:base>
</context>
The BackofficeValueResolver class has been introduced as responsible for returning search results that match the text entered. It allows to index the items' label representation as it is displayed on the list. It can be configured in the following way:
INSERT_UPDATE SolrIndexedProperty;name[unique=true];$solrIndexedType;type(code);localized[default=false];currency[default=false];multiValue[default=false];fieldValueProvider;ftsPhraseQuery;ftsPhraseQueryBoost;includeInResponse[default=false]; ;_backofficeLabel;;text;true;;;backofficeValueResolver;true;2.0;;
- Navigate to
- Open Solr Config for Backoffice in Editor Area.
- Go to INDEXED TYPES tab.
- Choose BackofficeProduct and choose Edit Details from the row menu.
- Go to INDEXED PROPERTIES tab.
- Select _backofficeLabel from the list of properties and choose Edit Details from the row menu.
For more information about the base configuration, see base Configuration.
Autocorrection (Did you mean...?)
Autocorrection (Did you mean...?) functionality can be enabled in simple search mode and in Reference Editors search.
Simple Searching
Enabling Autocorrection form simple searching
To use this feature, you need to enable spell checking functionality for BackofficeProduct Indexed Type:
-
In the Explorer Tree, navigate to .
-
Choose the BackofficeProduct type.
-
Choose an attribute you want the autocorrection enabled for, e.g. name, expand the inline editor menu
and choose Edit Details option. -
A pop-up window appears. Set the Use for spell checking option to True.
-
Navigate to
-
Open the Solr Config for Backoffice from the list.
-
Click the
icon to start the SolrIndexerOperationWizard. -
The Solr Indexer wizard appears. Select full as Operation values and click the START button to run indexing operation.
-
Now, while performing a search in the simple search, when you make a spelling mistake in the word you type in the search field and hit the Search button, the autocorrection mechanism provides a hint with the available correction from the index. See the example:
-
When you click the hint, the search is conducted for the valid keyword and the search results are restricted to the objects that meet the new criteria.
Reference Editors Search
Autocorrection works similarly in reference editors (reference/multireference). When the search engine detects a typo mistake in the search input text, it can return a hint with a corrected word (Did you mean...?).
Enabling Autocorrection in Reference Editors
To have this feature available, you need to enable the spell checking option and the referenced type must be indexed by Solr:
-
In the Explorer Tree, navigate to .
-
Choose the BackofficeProduct type.
-
Choose an attribute you want the autocorrection enabled for, e.g. name, expand the inline editor menu
in Properties section and choose Edit Details option. -
A pop-up window appears. Set the Use for spell checking option to True.
-
Navigate to
-
Open the Solr Config for Backoffice from the list.
-
Click the
icon to start the SolrIndexerOperationWizard. -
The Solr Indexer wizard appears. Select full as Operation values and click the START button to run indexing operation.
-
When you perform search in a reference editor and make a spelling mistake in the word you enter in the search field, the autocorrection mechanism provides available correction on the basis of the index. See the example (, select some Category and navigate to the Included Products section in Category Structure):
Autocorrection row pops up when some suggestion is available and no results can be found with the entered criteria. It means that when search with the typed criteria returns some results, the autocorrection would not be displayed.
Autocorrection text is delivered with search results. In reference editors, search operation is executed after each text change, so suggestions are available on the fly.
-
When you click the row with autocorrection, the suggested text is copied to the text search area and a next search operation is performed. When new results are available, the Did you mean...? row disappears and the new search results are displayed.
Autosuggestion
Autosuggestion feature is enabled for the simple search mode only.
Enabling Autosuggestion
You need to enable the auto-complete functionality for BackofficeProduct Indexed Type in Backoffice Application:
-
In the Explorer Tree, navigate to .
-
Choose the BackofficeProduct type.
-
Choose an attribute you want the autosuggestion enabled for, e.g. name, expand the inline editor menu
and choose Edit Details option. -
A pop-up window appears. Set the Use for auto-complete option to True.
-
Navigate to
-
Open the Solr Config for Backoffice from the list.
-
Click the
icon to start the SolrIndexerOperationWizard. -
The Solr Indexer wizard appears. Select full as Operation values and click the START button to run indexing operation.
-
Now, when you perform simple search, and you type at least three characters in the search box, the autosuggestion feature returns some suggestions generated by Solr.
When you type more than one keyword, suggestions are generated only for the last keyword entered - they are composed from the input provided in the search box, except for the last keyword as the suggestions are displayed for this last element. You can select one of the displayed suggestions and the search would be performed with the new criteria.

