Understanding the Search Pipeline

When indexes are created, the storefront must include the controls that access a search pipeline that uses the indexes. You can create your own pipeline for processing search queries or use the Search pipeline provided in the SiteGenesis application.

The Search pipeline allows configuration of recursive search, paging models, and error handling, among other options. You can extend the Search pipeline to include any additional logic you want for query processing. The Search pipeline returns a results page using templates defined in UX Studio. Different templates are used to present product results, content results, and a no matches found page.

Sorting is the arranging of items in a sequence based on one or more characteristics. Sorting methods are site-wide and override other methods of presenting search results, because they are typically selected by the customer. You can specify a specific sorting rule for keyword searches. You can create sorting rules that are associated with specific categories. You can also create sorting rules that are used only for a call to the search pipeline in a content asset or slot. For example, if you wanted to let users search for items related to a specific promotion.

Salesforce B2C Commerce returns a result set, which is then sorted. If no sorting rule is specified in the call to the Search pipeline, then results are sorted based on the sorting rule used for the keyword search, which is associated with the root category of the navigation catalog for the site. If no sorting rules are configured, then results are returned in the order of most to least frequent use of the query term in the indexed fields of the product or content.

The storefront includes a keyword search box and category navigation links. When a customer clicks a category link, a query is generated against the category and submitted to the Search pipeline. When a customer enters a search term, this also generates a query that is submitted to the Search pipeline.

The Search pipeline processes the query and accesses the index files and ranking criteria. The Search pipeline returns the results to the storefront.

If the Search pipeline finds a merchant-defined redirect, it returns the page specified in the redirect definition. If no redirect is found and search results are found, it returns the search results. By default, in the SiteGenesis application, if both products and contents are found, the product search results are shown, with a link to the content search results. The following graphic shows how content appears in the SiteGenesis application search results. You can see this link by searching on "customer support" in SiteGenesis.

In the SiteGenesis application, if no results are found, the nohits.isml template checks for a spelling suggestion. If one exists, it shows a "Did you mean?" message. If there are no spelling suggestions, then it shows a message indicating that there are no results. You can change the spelling suggestion settings so that the message for no results is never shown, or so that only reasonable spelling suggestions are shown.

Configurable querying features include:

  • Search redirects: the merchant can redirect searches for a specific term to a landing page or category page, rather than performing a product search. For example, if a customer searches for "customer service" they can be directed to a customer service page or if they search for "jobs" they can be directed to a career opportunities page.
  • Search refinements: the merchant can configure a refinement bar that lets customers refine results based on an attribute. For example, they might want to only see items in red or with a specific size.
  • Orderable Products Only: this setting excludes unorderable products (having an inventory record with ATS=0) from search results.
  • Availability Low Ranking Threshold: the percentage of availability from which products are to be ranked lower and pushed to the end of search results.