This document describes different options to get auto suggestions in the search box in the storefront. It describes the necessary steps to configure and create the specific search indexes and gives technical background on how the suggestions are retrieved.The index types are implemented within the Solr Search Adapter Cartridge.
The available search index services that provide the different search index types are managed services. You can enable the services for the organization in the Intershop Organization Management.
To use the enabled search service, it is necessary to create an appropriate service configuration in the context of the organization, a channel or an application respectively. The required location of the service depends mainly on the location of the business objects you want to build the search indexes for. For example: If products are edited in the channel, the search service configuration should be located in the channel. For content that is application-specific, the search service configuration must be located in the application.
Several search index services for the generation of suggestions to the user are available. These services behave differently.
The standard product search index type already includes suggest functionality based upon data that is indexed into this index. The current index is selected by the current request locale and its online flag. The index configuration is also checked if there are any attributes in the configuration that are marked with a custom value AutoSuggest
and the value true
.
... <attribute> <custom-values> <custom-value name="AutoSuggest" type="string"> <value>true</value> </custom-value> </custom-values> <name>ManufacturerName</name> <dataProviderName>ProductPO</dataProviderName> <description>The manufacturer name</description> ... </attribute>
The search index attributes that are used for suggest are manageable in the Commerce Management at the Tab Auto Suggest.
All the data from the index attributes that are marked for Auto Suggest are copied during the indexing into a hidden _suggest
field in the index. The suggest creates a query for the content of the _suggest
field, prefixed by the letters that the user has typed.
If a provided suggest result is selected in the front end, a search is triggered with the suggested term. Therefore the index attributes that are used for auto suggest are typically a subset of the index attributes that are used for search.
The maximum count of suggestions is set with the parameter maxAutoSuggestResults
in the ISML-module ISSearchBox
. That parameter is set in the template Header.isml (app_sf_responsive_cm)
to a default value of 10.
The SFProductSearchSuggest
is an alternative implementation of auto suggest. It uses a separate index, but the data is retrieved from the SFProductSearch
product index.
The configuration for the type relies on custom value attributes either configured in the index itself or in the underlying product index.
The custom values in the suggest index at search index configuration level can configure custom values with the prefix SuggestType_
followed by a type.
The values are attribute names of the underlying product index. Available types are category
, brand
, product
, content
. If an attribute is marked as auto suggest and the type cannot be determined, it is set to unspecified
.
<searchIndexConfiguration> ... <custom-values> <custom-value name="SuggestType_category" type="string"> <value>CategoryNameLevel0</value> <value>CategoryNameLevel1</value> </custom-value> <custom-value name="SuggestType_product" type="string"> <value>name</value> </custom-value> </custom-values> </searchIndexConfiguration>
You can also configure the type custom values in the suggested index custom attribute SuggestType
. The value is an available suggest type (see above).
... <attribute> <custom-values> <custom-value name="SuggestType" type="string"> <value>brand</value> </custom-value> <name>ManufacturerName</name> ... </attribute> ...
The following tables illustrate the content of the participating indexes:
Product Index Data: Each Row represents a product.
Category Display Name | Brand | Product Name | Content |
---|---|---|---|
Category 1 | Brand 1 | Name 1 | Term |
Category 1 | Brand 2 | Name 2 | Term |
Category 2 | Brand 1 | Name 3 | Term |
The suggest index build processes the configured index attributes for the suggest types, reads the data from the product index and writes the results into the suggest index.
Product Suggest Index Data: Each Row represents a potential suggestion.
QueryTerm | Type | HitCount | FieldName |
---|---|---|---|
Category 1 | category | 2 | Category Display Name |
Category 2 | category | 1 | Category Display Name |
Brand 1 | brand | 2 | Brand |
Brand 2 | brand | 1 | Brand |
Name 1 | product | 1 | Product Name |
Name 2 | product | 1 | Product Name |
Name 3 | product | 1 | Product Name |
Term | content | 3 | Product Name |
The suggest query uses a wildcard search on the QueryTerm
index attribute.
If an index of type SFProductSearchSuggest
is online for the current request locale, it precedes the suggest from SFProductSearch
index.
The Index Type is also an index of data that is collected from other indexes. In addition to the SFProductSearchSuggest
index, it can also collect data from SFContentSearch
index and it stores direct references to products, categories and content pages.
The configuration is controlled by specifying the index attributes of the underlying indexes (SFProductSearch
or SFContentSearch
) as custom values at the ISH-Config.xml
of the SFObjectSuggestSearch
together with marking the attribute as auto suggest in the underlying index.
The custom values of the ObjectSuggestType_<type>
attribute determine the set of attributes that are collectible and the index configuration auto suggest will determine the collected attributes out of that configured set.
The suggest query uses a wildcard search in the QueryTerm
index attribute prefixed with the user entered terms. In addition, it groups the result by the Type
index attribute to get results from each type. The result size per group is set to 5 by the Solr group.limit
parameter. The suggest result generates direct links to product, categories or content pages. For the suggest type brand
it generates a search with the suggested term.
SFObjectSuggestSearch
is online for the current request locale, it precedes the suggest from SFProductSearchSuggest
or SFProductSearch
indexes. The category suggestions are generated from the values that are indexed in the CategoryNameLevel<X>
index attributes. The category reference is derived from the content of the CategoryUUIDLevelMulti
index attribute. The values of the CategoryNameLevel<X>
index attributes are the category display names of the default category assignment of the product. So category suggestions are generated for the default categories that have products assigned.
The product suggestions that are indexed into the suggest index are collected from the SFProductSearch
index. The reference is based upon the value of the SKU
(the first value if it is a multiple value) or as a fallback of the sku
index attribute. The default configuration uses the name
index attribute to build suggestions based upon the product display names.
The content suggestions are collected from the SFContentSearch
index. The content references are generated from the index attribute PageletEntryPointID
and the query term values are taken from the title
(hard-coded) attribute. No configuration of the underlying content index is necessary.
The brand suggestions are collected from the ManufacturerName
index attribute of the SFProductSearch
index.
For search suggestions nothing is configured by default. To use existing index attributes as suggestions for search, you may add an additional attribute to the suggest index and select the data provider search
. An ObjectSuggestType_<type>
custom value has to be added by editing the configuration file where the custom values list the index attributes of the product index that you want to use as search suggestions. The storefront template (app_sf_responsive:inc/search/SuggestResult.isml) that renders the suggest search result currently does not display suggestions of type search. A search section needs to be added to the template to render results for the search suggestions.
The suggest collector data provider only supports single-valued index attributes.
SFProductSearch | SFProductSearchSuggest | SFObjectSuggestSearch |
---|---|---|
|
|
|
|
|
|
The information provided in the Knowledge Base may not be applicable to all systems and situations. Intershop Communications will not be liable to any party for any direct or indirect damages resulting from the use of the Customer Support section of the Intershop Corporate Web site, including, without limitation, any lost profits, business interruption, loss of programs or other data on your information handling system.