Search Functionality in Elastic Path Commerce
The Elastic Path Search Server processes search requests from the storefront and the Commerce Manager. Search Server uses the capabilities of Solr, which is an open source search platform built on Apache Lucene™ that provides scalable indexing, searching, and faceting. Solr provides faceted API responses for search queries. With these capabilities the Search Server indexes searchable entities, such as categories, customers, products, and SKUs. For more information about Search Server technologies, see the Search Server section.
Elastic Path supports two types of search operations:
Keywords search without facets
Searches for the keywords and returns all results matching the keywords. All SKUs associated with a product are listed as separate products in the search result. The shopper must navigate through the results until the required item is found. The keywords search does not provide facets to refine the search result.
Faceted offer search:
Groups similar SKUs and returns offers with SKUs. The shopper can view all variants grouped at an offer level in search results page. The faceted offer search result consists of the available facets to refine the search result to view the exact match for the query. A shopper can view only the blue shirts in small size from all brands by selecting small in size and blue in color facets.
You can also search for a specific category and refine the search results by selecting multiple facet values in multiple facets. For example, a shopper can refine the search for summer shirts to display only red shirts and white shirts. When the shopper selects the desired colors from the color facet, the product results are updated to display shirts available in those colors.
Cortex sends the search keywords for offers search and keywords search to the search server for processing and the search server returns the results to Cortex. The storefront retrieves the results from the API for shoppers to view. The Figure 1 illustrates this workflow. Related Information:
Search Terms and Conventions
Product
A collective group of SKUs or variants available for shoppers to view. Each product or product bundle is represented as an offer in Cortex.
For example a shirt is a product and each SKU option, such as red, blue, or white in color, in shirt has an associated SKU.
Offer
A collection of tangible or non-tangible entities for sale in store. Each offer has an offer code, availability, price, and list of constituents. An offer represents a product or product bundle defined in Commerce Manager.
For example, shirts is an offer that consists of shirts in different colors, sizes, or fabric.
Item
A purchasable entity, such as shirt, movie, song, or subscription. An offer consists of items corresponding to each SKU associated with the offer.
For example , the SKU, SHIRT-SM-RD
, might correspond to a small, red shirt. A SKU and corresponding item represent the same purchasable entity in Commerce Manager and Cortex respectively.
SKU
A Stock Keeping Unit is a number or code assigned to an exact variant of a product in the store. A SKU corresponds a purchasable entity, such as shirt, movie, song, or subscription.
For example, for the small, red shirt, the SKU might be SHIRT-SM-RD
.
SKU options
A variant of SKU used to identify its association within a product, such as style, color, size, or format.
For example, for shirt corresponding to the SKU SHIRT-SM-RD
in each brand corresponds to a SKU option.
Facet
The arrangement of search results into categories based on the indexed terms. For example, size, brand, or color.
Facet value
The name of each value in a facet category. For example, for the size facet, the facet values are small, medium, or large.
List price
The price at which the manufacturer recommends that the store sell the product. For example, shirt list price might be $20-$60.
Sale or purchase price
The price at which a shopper can buy an item. This price might or might not be same as the list price. For the list price $20-$60, the sale price might be $10-$40.
Faceted Navigation
Navigation API provides facets where shoppers can also filter product listings on category pages. For example, a shopper can refine results in a category by applying facets, such as, price or brand.
Faceted Search Architecture
Overview
This section provides details of the faceted search architecture and describes the end-to-end workflow of a search query, showing where facets are configured and processed.
Faceted Search Workflow and Architecture
Business users can configure facets in Commerce Manager and shoppers can use these facets to refine the search results. The following diagram illustrates the faceted search workflow for:
The business users who configure facets (shown in red)
The shoppers initiating search and the end-to-end data flow of the search query processing (shown in green)
Facet Configuration Workflow
Business users and merchandisers configure facets in Commerce Manager.
The following workflow lists the steps for facet configuration:
Business users identify and configure facets in the Facet Configuration tab using the product attributes, SKU attributes, SKU options, or other attributes for the store.
Commerce Manager sends the facet configurations through Elastic Path Core to save in the database.
For more information on configuring facets, see the Store Configuration > Facet Search section in the Commerce Manager guide.
Faceted Offer Search Retrieval Workflow
This section provides an overview of the end-to-end data flow and sequence of events for a search query initiated by a shopper, shown in the faceted architecture diagram above.
The following data flow lists the steps for facet search retrieval:
Shopper enters shirt in the storefront’s search field.
The
offersearchAPI
receives the request call to Cortex.Cortex sends the API call to Elastic Path Core.
Elastic Path Core queries the database for facet configuration.
The database returns all enabled faceted attributes to Elastic Path Core.
Elastic Path Core creates the search request and sends it to the Search Server.
The Search Server returns offers with the relevant facets and facet values to Elastic Path Core.
Elastic Path Core filters the facets with zero facet value and sends the list of relevant facets and facet values to the Cortex API.
The
offersearchAPI
returns offers with the relevant facets to the shopper.The shopper can use the facets and facet values to filter the search results further.
Faceted Navigation Workflow
This section provides an overview of the end-to-end data flow and sequence of events for a faceted navigation. Business users and merchandisers configure category facets in Elastic Path Commerce Manager. For more information on configuring facets see the Store Configuration > Facet Search section in the Elastic Path Commerce Manager guide.
The following data flow lists the steps for facet retrieval and display:
- Shopper enters accessories in the search field or navigates to the category.
- Storefront gets the offers and shows the products in the accessories category.
- Storefront creates a faceted navigation menu with offers grouped by:
- Category
- Price
- Brand
- Attributes
- Shopper selects a facet, such as, Price: $50-$100, in the category.
- Storefront displays the list of offers from faceted navigation in the $50-$100 price range.
- Storefront updates the browser URL to include the filter, such as
https://reference.elasticpath.com
. - Storefront updates the faceted navigation menu to show the facets as selected.
Enabling Searchability for Attributes
Merchandisers can set a facet as searchable if the corresponding attribute’s indexed
property is set to true in the product.schema.xml
file. With attribute or field searchability property, Solr can return more accurate search results.
However, even with indexed property set to true, searchability property of an attribute can be disabled by clearing the Searchable field selection in Commerce Manger.
Best Practices
For developers: Set the indexed
property of all attributes to true in the product.schema.xml
file.
For merchandisers: Configure all facets as searchable in Commerce Manager.
Navigate to the
ep-commerce/commerce-engine/search/ep-search/src/main/resources/solrHome/cores/product/conf
directory.In the
product.schema.xml
file, set theindexed
property of the appropriate attributes totrue
.<field name="brand" type="string" indexed="true" multiValued="false"/>
For example, to configure the optical zoom facet searchable for all camera products in the product catalog of a store:
In the
product.schema.xml
file, enter the following settings:<field name="Optical Zoom" type="string" indexed="true" multiValued="false"/>
With this setting, the Searchable field for the Optical Zoom facet is made available in Commerce Manger and merchandiser can set this facet searchable. With searchable Optical Zoom facet, when a shopper searches for Camera with zoom 50x, Solr returns only the cameras with 50x optical zoom.