0
votes

I'm trying to modify the simple search behaviour for the promotions. I want to search only on the 'name' field. I did this:

<context type="PromotionSourceRule" component="simple-search">
    <yss:simple-search xmlns:yss="http://www.hybris.com/cockpitng/config/simplesearch">
        <yss:field name="name"/>
    </yss:simple-search>
</context>

but the problem is that the field 'name' is localized and my simple search now is searching only for the english language.

I have also german and dutch localization and I would to search also in these languages.

Any idea?

1
do you use Backoffice Solr Search or Flexible Search ?Nomade
@Nomade how can I check this?sharkbait

1 Answers

1
votes

You can't use simple-search for localized fields. You have to configure your language, see com.hybris.cockpitng.editor.localized.LocalizedSimpleEditor and use advanced-search widget.

LocalizedSimpleEditor

Description

A drop-down list version of the Localized Editor applied in the Advanced Search widget.

Type

Reference to any type which must be provided in the following format LocalizedSimple( ), for example:

LocalizedSimple(java.lang.String) LocalizedSimple(java.lang.Integer) LocalizedSimple(Reference(Product))

Example :

<as:field editor="com.hybris.cockpitng.editor.localized(com.hybris.cockpitng.editor.defaulttext)"  .../>

Advanced search widget example

<context type="Product" component="advanced-search">
<as:advanced-search xmlns:as="http://www.hybris.com/cockpitng/config/advancedsearch" connection-operator="AND">
    <as:field-list disable-attributes-comparator="false" disable-subtypes-checkbox="false">
        <as:field name="code" operator="equals" selected="true"/>
        <as:field name="approvalStatus" operator="equals" selected="false"/>
        <as:field editor="com.hybris.cockpitng.editor.defaultlong" name="pk" operator="less" selected="true" sortable="false"/>
        <as:field name="modifiedtime" operator="greaterOrEquals" selected="true"/>
    </as:field-list>
<as:sort-field name="code" asc="false" />
</as:advanced-search>