on 2021 Mar 22 7:34 PM
I am trying to customize backoffice text search to use solr for Orders. Order has a code attribute and Order has entries, those entries have a vendorName. I need to be able to type in a name and then the solr index would form a query to search in code an orderEntryVendorName (this is how I called it when creating the impex script to set up the solr index). However, the query only takes into account code even though I am doing something like this.
<context component="myextension-order-fulltext-search" type="Order" principal="customersupportmanagerrole">
<fs:fulltext-search>
<fs:field-list>
<fs:field name="code" selected="true"/>
<fs:field name="orderEntryVendorName"/>
</fs:field-list>
<fs:preferred-search-strategy>solr</fs:preferred-search-strategy>
<fs:operator>OR</fs:operator>
</fs:fulltext-search>
</context>
NOTE: The solr index part is already taken care of, my index of orders contains orderEntryVendorName it is just a matter of configuring myextension-backoffice-config.xml correctly to take into account orderEntryVendorName when searching in the solr index
Request clarification before answering.
As shown in your configuration, you add the orderEntryVendorName in the field-list, this is used for the filters, you can choose this filed in the filters and then this field will take effect in solr search.
But from your description, i suppose you want to this field take effect in simple search, so, there are two ways you can try:
1. Configure the simple-search field in your config.xml for Order type, something like below:
<context merge-by="type" type="Order" component="simple-search" >
<ss:simple-search xmlns:ss="http://www.hybris.com/cockpitng/config/simplesearch">
<ss:field name="code"/>
<ss:field name="orderEntryVendorName"/>
</ss:simple-search>
</context>
2. Enable the Free Text Query for orderEntryVendorName in backoffice administration cockpit
Find the index property orderEntryVendorName in Admin cockpit->Search and Navigation -> Indexed Types, open detail view of orderEntryVendorName, and navigate to FREE TEXT QUERY tab, choose True for Free Text Query.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
| User | Count |
|---|---|
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.