8 Manage Search Settings

The Search page in the administration interface contains a read-only table that lists all properties that are searchable or serve as facets. You can use the Search page to configure the searchable field rankings that determine how searches work in your store.

The Search page also lets you create synonyms for shoppers’ search terms in a thesaurus or create keyword redirects for search terms. You can see the Search page only if you have been assigned the Admin or Search role.

The topics in this section describe how to set up and manage search settings.

Understand Index Fields

A catalog property must be indexed before it can be considered when a shopper searches in your store.

To add a property to the index, select either or both of the following options in the property’s configuration in the catalog:
  • Allow property to be searched
  • Allow property to be a search facet
After you publish this change, the property is added to the index, where it is represented by an index field.

In order for a shopper’s search term to be matched against an index field’s contents, the field must be configured as searchable in the catalog, (the first option previously described), and must be added to the searchable field ranking list. Searchable field ranking changes take effect after the next time you publish.

View Index Fields

The Index Fields page displays a read-only list of all the index fields for your site.

To display the list, click Index Fields on the Search page. The list provides the following information for each index field:

  • Searchable

    If this field is selected, shoppers can search on values entered for this property.

  • Facet

    If this field is selected shoppers can use this property as a refinement when filtering search results.

  • Multi-select

    If this field is selected, shoppers can use this property as a refinement and make multiple selections to filter search results. For example, shoppers could filter results by selecting several colors.

Understand the Searchable Field Ranking List

Every place where a shopper uses search on your site is associated with a searchable field ranking list.

The searchable field ranking list determines which records are returned in search results - matches, and influences the order of these search results - rank.

The searchable field ranking list is composed of an ordered list of fields:

  • These fields are considered when a search term entered by a shopper is matched against records.
  • The order of these fields in the list affects the ranking of results.

You can view, add or delete fields from this list. Your site has at least two searchable field ranking lists:

  • All is the default searchable field ranking list for catalog searches.
  • TypeAhead is a separate, auto-suggest searchable field ranking list.

For example, TypeAhead can return results in a type-ahead format when a shopper types into a dropdown box.

Your site might have additional searchable field ranking lists for other types of searches.

Note:

In addition to the user interfaces described in this chapter, Retail Digital Commerce also provides search REST APIs that you can use to manage your searchable field ranking. In the APIs, the searchable field ranking is known as a search interface. See Use the REST APIs for more information.

Cross-field Matching

Cross-field is the priority that is assigned to a matching record if the match is split across multiple fields. A cross-field match can be configured to appear higher in the results than some single-field matches.

Cross-field matching example

Consider two exact matches. One is product name + product color; the other match is product description. The record that displays first depends on whether or not you use and how you use cross-field matching.

A shopper enters “blue suede shoes” in the search box. Two records are matches, but which one should have the higher priority? Here are the two records:

Record product.name product.color product.description
One Suede shoes Blue Customer favorite
Two Suede shoes Red Tired of your blue suede shoes? Try these!

Record One is a match where “blue suede shoes” is split across multiple fields. Record Two is a match where “blue suede shoes” occurs in a single product.description field. Record One is the better match and should have the higher priority, but it will only display first if the following conditions are met:

  • Your searchable field ranking list uses cross-field matching.
  • Cross-field matches have a higher priority than a single product.description field match.

There are no rules for which fields in a searchable field ranking list should be given a higher priority than cross-field matches, but you likely want to consider structured fields such as category, brand, color, or features. Fields that allow more unstructured or free-form content, such as a product description, should be given a lower priority and should display after cross-field matches.

Cross-field matching is enabled by default for each searchable field ranking list. To disable cross-field matching, you must use the search REST APIs.

Relevance Ranking

Search field ranking is taken into account by configurable modules that sort the records in search results as part of a relevance ranking strategy. For information about how to configure the sorting of search results, see Specify which index fields are included in searches.

Add Fields to the Searchable Field Ranking List

To make a field searchable, it must be configured as searchable in the catalog and be a member of a searchable field ranking list.

Follow these steps to add a field to a searchable field ranking list.

  1. Click the Search icon in the dashboard.
  2. On the Search page, click Searchable Field Ranking.
  3. Click the searchable field ranking list to which you want to add a field.

    The searchable field ranking list displays index fields that are searchable. The order of the fields in the searchable field ranking list affects the ranking of search results. Fields higher up in the list have a greater ranking and search requests that match values in these fields appear first in your search results.

  4. Under Add Field, select the index field that you want to add to the searchable field ranking list. You can also type the name of an index field in the box, and Retail Digital Commerce filters the list to match what you have typed. The match is not case sensitive.

    If you cannot find the field, you must find the associated property in the catalog, click “Allow property to be searched,” and then publish your changes. See Create and edit product types for more information. Note that it might be several minutes after publishing completes for the new index field to appear.

  5. The field is added to the bottom of the list of index fields.
  6. Click the field and then click and drag it to the position in the list that reflects its rank.
  7. Click Save.

Changes to the searchable field ranking list do not affect your store until after you publish.

Configure Cross-Field Matching

If cross-field matching is enabled for this searchable field ranking list, you can configure where you want cross-field matches to display in a list of search results. To learn more about cross-field matching, see Cross-field matching.

  1. On the Search page, click Searchable Field Ranking.
  2. Click the searchable field ranking list in which you want to configure cross-field matching.

    The searchable field ranking list displays a slider next to the list of index fields. If the slider is disabled you cannot configure cross-field matching. To enable cross-field matching, use the search REST APIs.

    Moving the slider handle up or down changes where cross-field matches display in your search results. Matches for index fields above the slider handle have a higher priority. These matches appear before any cross-field matches. The index fields below the slider handle have a lower priority than cross-field matches.

  3. Move the slider handle up to give cross-field matches a higher priority, or down to give them a lower priority.
  4. Click Save.

Edit the Searchable Field Ranking List

The order of the fields in the searchable field ranking list affects the ranking of search results.

You can change the rank of index fields or remove them altogether from the searchable field ranking list.

  1. On the Search page, click Searchable Field Ranking.
  2. Click the searchable field ranking list that you want to edit.
  3. To change a field’s priority in search results, click the field and then click and drag it to the position in the list that reflects the priority you want.
  4. If you want to remove an index field so it is no longer considered for matches in search results in this ranking, click the delete icon.
  5. Click Save.
    If you want to stop using a field for search in all searchable field ranking lists, you can deselect “Allow property to be searched,” in the catalog and then publish your changes. See Create and edit product types for more information. Retail Digital Commerce recommends removing the index field from all searchable field ranking lists.

Understand the Thesaurus

The thesaurus provides a way to include alternate terms for a shopper’s search query.

The thesaurus lets you create the synonyms that capture other ways of expressing queries relevant to your store.

You can add two kinds of synonyms to your thesaurus:

  • One-way thesaurus entries provide alternate ways of expressing query words or phrases that apply in a single direction only.

    For example, you could define a one-way mapping so that all queries for computer would also return matches containing laptop, but queries for laptop would not return results for the more general computer. You can add an unlimited number of synonyms to a one-way entry, and Commerce expands the query to search for each synonym with the same one-way relationship.

  • Equivalent thesaurus entries establish a mutual equivalence relationship between words or phrases. The words and phrases are interchangeable. A query for one term would also return results for all other terms.

    For example, an equivalent might specify that the phrase “notebook” is interchangeable with the phrase “laptop.”

    In the Rest API an equivalent thesaurus entry is known as a multi-way entry. See Configure a thesaurus.

In addition to the user interfaces described in this section, Retail Digital Commerce also provides search REST APIs that you can use to manage your thesaurus. See Configure a thesaurus for more information.

Tips on using the Thesaurus

The thesaurus can help customers find products in your store, but poorly conceived entries might not be useful. To maximize the potential of the thesaurus, review the following tips:

  • Do not create thesaurus entries for common spelling corrections. Digital Retail Commerce fixes misspelled words automatically.
  • Do not create equivalent entries with different cases of the same word. The thesaurus is not case sensitive.

    For example, entries such as Tartan = tartan are unnecessary.

  • Do not create an equivalent entry for a word with multiple meanings.

    For example, “khaki” can refer to a color as well as to a style of pants. If you create an equivalent synonym for khaki = pants, then a shopper’s search for khaki towels could return irrelevant results for pants.

  • Do not create an equivalent synonym between a general and several more-specific terms, such as top = shirt = sweater = vest. This increases the number of results the shopper has to go through while reducing the overall accuracy of the items returned. In this instance, if a shopper searches for “vest,” the shopper also gets results for “sweater.”

    You get better results by creating individual one-way entries between the general term “top” and each of the more-specific terms. In that case a search for vests would only return vests, not sweaters, too. Only a search for “top” would return both sweaters and vests.

  • Do not create an entry that includes a term that is a substring of another term in the entry.

    For example, consider an equivalent entry of “tackle” and “bait and tackle.” If shoppers type “tackle,” they get results for “tackle” or “bait and tackle.” These are the same results they would have received for “tackle” without the thesaurus. If shoppers type “bait and tackle,” they get results for “bait and tackle” or “tackle,” causing the “bait and” part of the query to be ignored.

  • Avoid multiple word entries where single-word entries are appropriate.

    In particular, avoid multiple word forms that are not phrases that shoppers are likely to type, or to which phrase expansion is likely to provide relevant additional results. For example, the equivalent entry “King Aethelbert of Wessex” = “King Athelbert of Wessex” should be replaced with the single-word entry Aethelbert = Athelbert.

Create and Edit Thesaurus Entries

You create synonyms for shoppers’ search terms by adding them to the thesaurus, which you access from the Search page in the administration interface.

You must be assigned the Admin or Search role to create or edit thesaurus entries. Changes to the thesaurus do not affect your store until after you publish. See Publish Changes.

You can see how your thesaurus entries behave when shoppers search for items by previewing your store. Click Preview and then search for items that you expect to trigger the thesaurus entries that you want to test. For more information about previewing your store, see Preview your changes.

View the List of Thesaurus Entries

The thesaurus page displays a list of all the thesaurus entries that have been added to your store. Each entry displays the following information:

  • Search terms for one-way entries with an arrow that point to a list of synonyms. Equivalent entries show synonyms only.
  • The type of entry: one-way or equivalent.
  • The last modified date, and the user that modified the entry.

The list can be sorted by clicking Sort By and selecting the type of entry, modified by user, or date modified. Sorting always resets your view of the list to the first page. You can filter the list by starting to type a search term, synonym, or user name in the Filter list box.

Create one-way Thesaurus Entries

One-way thesaurus entries apply in a single direction only. When a shopper enters the specified search term, the search results include the results for all of the synonyms for the entry.

  1. On the Search page, click Thesaurus.
  2. Click New Entry.

    The New Entry dialog displays with the default One-way option selected.

  3. In the Search Term field, enter the word or phrase that a shopper might enter as a query.
  4. In the Synonyms field, enter all the words or phrases to which a shopper’s search term might map. The search results for the search term include the results for all the synonyms. Press Enter or Tab between entries.

    Note that the entries in this field do not map to one another or back to the term in the Search Term field. If a shopper enters a term in the synonym list, the search results only include the results for that term.

  5. Click Create.

Create Equivalent Thesaurus Entries

Equivalent thesaurus entries are mutually related words or phrases. When a shopper enters any of the terms in a query, the search results include the results for all of the other synonym terms.

  1. On the Search page, click Thesaurus.
  2. Click New Entry.
  3. Click Equivalent.
  4. In the Synonyms field, enter all the mutually related words or phrases that a shopper might enter into a Search box. Press Enter or Tab between entries.

    Note that the entries in this field are equivalent. This means that each of the entries in this field produce the same search results when entered by a shopper. The entries are interchangeable.

  5. Click Create.

Edit an Entry

You can edit an existing thesaurus entry as follows:

  1. On the Search page, click Thesaurus.
  2. Click the entry in the list.
  3. If necessary, change the entry type.

    If you change the entry from one-way to equivalent, the existing search term automatically moves to the beginning of the synonyms list.

    If you change the entry from equivalent to one-way, the existing synonyms remain intact, and a blank Search Terms field appears.

  4. Update a synonym by deleting it and re-entering it.
  5. Click Save.

Delete an Entry

To delete an entry from the thesaurus:

  1. On the Search page, click Thesaurus.
  2. Type a synonym or a search term for the entry that you want to delete into the Filter By field.
  3. Click the trash can icon next to the entry.
  4. When the confirmation appears, click Delete.

Understand Keyword Redirects

You can configure a keyword redirect to send shoppers to a location in your store or an external site when they enter a specified search term. This lets you display a relevant promotional page or product category page instead of a typical list of search results.

A keyword redirect is triggered by one or more search terms; the target of a keyword redirect is a URL in your store or an external site. For example, a keyword redirect with the search term “delivery” and the URL “http://shipping.example.com” redirects shoppers to “http://shipping.example.com” if they use “delivery” as a search term.

Site-specific Keyword Redirects

You can define a keyword redirect that applies to all sites or one or more specific sites only. The same search term, entered on different sites, can redirect shoppers to different pages. For example, if Site A and Site B have different policies for returns, you can set up the term “returns” to take shoppers to different pages depending on the site where they are shopping.

You can filter the list of keyword redirects by site to easily find all of the keyword redirects defined for a specific site.

Match Modes

The keyword redirect has three match modes. You can set the match mode to a non-default setting by using the search REST APIs. See Configure the ranking of records in search results for more information.

  • Exact

    Default match mode. A search query triggers a redirect only if the shopper’s search query matches the keyword or a close variant exactly. The search query cannot include additional words before or after the matching terms.

    For example, if the keyword is “support” and the shopper enters “support,” then the shopper is redirected. If the shopper enters “customer support,” then she is not redirected.

  • Phrase

    A search query triggers a redirect if the terms in a shopper’s query match all the terms in a keyword or a close variant in the same order. The search query might include additional words before or after the matching terms.

    For example, if the keyword is “customer support” and the shopper enters “customer support telephone number” then the shopper is redirected. If the shopper enters “support customer” or just “support,” she is not redirected.

  • All

    A search query triggers a redirect if the terms in a shopper’s query match all the terms in a keyword or a close variant, but not necessarily in the same order. The search query might include additional words before or after the matching terms.

    For example, if the keyword is “customer support” and the shopper enters “telephone support customer number,” then the shopper is redirected. If the shopper enters “telephone support number,” then she is not redirected.

Integration with the Thesaurus

If you create a thesaurus entry that corresponds to a search term for a keyword redirect, the keyword redirect has priority over the thesaurus entry.

For example, you might have a keyword redirecting “curtains” to http://example.com/fallsale/curtains.

If you have a one-way thesaurus entry, with a search term of “curtains” and synonyms of “drapes, shades” then the following occurs:

  • A shopper who enters “curtains” as a search term is redirected to http://example.com/fallsale/curtains.
  • A shopper who enters “drapes” or “shades” as a search term is not redirected.

If you have an equivalent thesaurus entry, with synonyms of “curtains, drapes, shades” then the following occurs:

  • A shopper who enters “curtains” as a search term is redirected to http://example.com/fallsale/curtains.
  • A shopper who enters “drapes” or “shades” as a search term is not redirected.

Create and edit keyword redirects

You can create and edit keyword redirects for shoppers’ search terms on the Keyword Redirects page.

Open the Keyword Redirects page from the Search page. You must be assigned the Admin or Search role. Changes to the keyword redirects do not affect your store until after you publish. See Publish Changes.

You can see how your keyword redirect entries behave when shoppers search for items by previewing your store. Click Preview and then search for items that you expect to trigger the keyword redirect entries that you want to test. For more information about previewing your store, see Preview your changes.

View the List of Keyword Redirects

The Keyword Redirects page displays a list of keyword redirects that have been added to your store. Each entry displays the following information:

  • Keywords that the shopper enters.
  • A redirect page which is the absolute or relative URL to which the shopper gets redirected.
  • A clickable icon that displays the redirect page in a new tab or window.
  • The read-only match mode field.
  • The last modified date, and user.

By default all keyword redirects are displayed. You can filter the list of keyword redirects by site.

The list can be sorted by clicking the Sort By list and selecting keyword, redirect page, modified by user order, or date modified order. Sorting always resets your view of the list to the first page. You can filter the list by starting to type a keyword, redirect URL, match mode, or user name in the Filter terms box.

Work with Redirect URLs

Retail Digital Commerce recommends using relative URLs for redirecting shoppers to internal pages within the store and only using absolute URLs for redirecting shoppers to external pages outside of the store. Relative URLs are especially important for internal pages because your preview storefront and production storefront have different hostnames. Using relative URLs in this case allows you to preview and test your keyword redirects before you publish.

Create a Keyword Redirect

All keyword redirects that you add using the administration interface have a match mode of Exact.

  1. On the Search page, click Keyword Redirects.
  2. Check to see if the keyword has already been entered. If a keyword has multiple entries with different redirect URLs, you might get unexpected results.
  3. Click New Entry.
  4. By default, the keyword redirect you create is global, that is, it applies to all sites. To create a keyword redirect that applies to one or more specific sites, deselect Global under Sites, click the Select items box and select the site or sites.
  5. In the Keyword field, enter the term to be redirected to a page.
  6. In the Redirect field, enter the absolute or relative URL for the page to which you want the shopper to be redirected. The entry must begin with http://, https://, or a forward slash (/).
  7. Click Create.
  8. Verify the redirect URL by clicking the redirect icon next to the URL.

    The URL displays the redirect page in a new tab or window.

Edit a Keyword Redirect

You can modify the keywords or the redirect URLs for keyword redirect entries.

  1. On the Search page, click Keyword Redirects.
  2. Click the keyword entry in the list.

    You can update an existing keyword or the redirect URL, or the site it applies to.

  3. Click Save.
  4. If you edited the redirect URL, verify it by clicking the redirect icon next to the URL.

    The URL displays the redirect page in a new tab or window.

Delete a Keyword Redirect

  1. On the Search page, click Keyword Redirects.
  2. Click the trash can icon next to the entry.
  3. When the confirmation appears, click Delete.

Refine and Order Search Results

There are several ways to influence the ordering of the search results your shoppers see in your store: specifying dynamic curation criteria, boosting and burying products, and using facets.

Use Dynamic Curation

Dynamic curation allows you to influence the ordering of search results when the shopper navigates to a category (collection) or enters a search term. With this feature, you can create dynamic curation rules. Each rule has a destination (a collection or search terms), a set of criteria for ordering the search results, and an importance level for each criterion. Search uses your prioritization and blends the criteria to generate a sort order.

For example, in collections within Women’s, you can prioritize products that are newest, bestselling, and in stock; whereas within Men’s, you can prioritize bestselling, in stock, and most viewed. As another example, you can display in-stock and on-sale items near the top of the search results.

The dynamic curation feature does not replace the configuring Searchable Field Ranking feature, but rather supplements it. For text searches, it is best to configure Searchable Field Ranking to return the most relevant results first, and use dynamic curation rules sparingly. Otherwise, you might not display the most relevant results consistently.

You cannot test views and sales in Dynamic Curation in your staging or test environment.

Dynamic curation rules apply to all search-driven pages (where another dynamic curation rule does not apply), and not to collection pages driven by the repository. For example:

  • If your storefront is customized such that the category pages accessed from the top-level collections are search-driven, the curated ordering applies on those pages.
  • If the shopper uses guided navigation to navigate to a category page, the curated ordering applies on that page.
  • If your storefront is not customized, the collection pages accessed from the top-level collections are repository-driven, and dynamic curation rules do not apply to them.

In addition, with the default search settings in Commerce, consider the following:

  • When a curation rule has search terms as a destination, the rule serves only as a tiebreaker - that is, it takes effect only when two or more products that have the same relevance need to be ordered.
  • When a curation rule has a collection as a destination, the criteria in the rule have a more direct effect, since relevance is not a consideration in the ordering. A rule defined for a collection applies to all sub-collections, except for any sub-collections that have their own rules.

Also be aware that because the underlying algorithm blends the criteria, predicting the search results order exactly may not always be possible.

Implement Dynamic Curation

This section describes how you can use the dynamic curation feature to influence the ordering of search results. Any changes you make will take effect in production after you publish them.

Create a curation rule

Follow these steps to create a new curation rule:

  1. On the Search page, click Dynamic Curation.
  2. Click New Curation Rule.
  3. Select the site the rule applies to.
  4. Select a collection or enter one or more search terms to define which search results will be ordered.
  5. Click Add Criteria to select the criteria.

    Note:

    If you choose Newness as a criterion, it will only apply to products that are less than 100 days old. In addition, if Arrival Date is not populated for a product, Creation Date will be used instead.

    Note:

    The In Stock criterion only uses the default inventory; location-level inventories are not supported.
  6. Use sliders to rate the importance of each criterion you have selected.
  7. If you selected Product type, select and order the product types.
  8. Click Create.

Update a curation rule

Follow these steps to edit an existing curation rule:

  1. On the Search page, click Dynamic Curation.
  2. Click on the curation rule you want to edit from the list of dynamic curation rules.
  3. Update the collection or search terms to define which search results will be ordered.
  4. Click Edit Criteria.
  5. Use sliders to rate the importance of each criterion you have selected.
  6. Click Save.
  7. Optionally click Save and Preview to preview the search results you just curated. For site-specific rules, click the preview button on the header of the administration interface.

Delete a curation rule

Follow these instructions to delete a curation rule:

Note:

The default rule cannot be deleted.
  1. On the Search page, click Dynamic Curation.
  2. Click on the curation rule you want to delete from the list of dynamic curation rules.
  3. Click Delete.
  4. When the confirmation appears, click Delete.

Boost and Bury Products

In addition to specifying the dynamic curation criteria, you can promote (boost) products to the top of the search results and move products to the bottom of the search results (bury).

Follow these instructions to boost or bury products:

  1. On the Search page, click New Curation Rule.
  2. Select the site the rule applies to.
  3. Select a collection or enter one or more search terms to define which search results will be ordered.
  4. Click Add Products under Select products to boost or Select products to bury to search for, select, and add products to be boosted or buried, respectively. In the grid of boosted or buried products, you can reorder products using drag and drop or the context menus. Alternatively, switch to the list view to edit the products' sequence numbers.
  5. Click Create.
  6. Optionally click Create and Preview to preview the search results you just curated. For site-specific rules, click the preview button on the header of the administration interface.

Note:

You can boost a maximum of 200 products and bury a maximum of 200 products.

Order Facets

You can select and order the facets that appear in the Guided Navigation widget when the shopper views search results or navigates to a search-driven collection.

  • You can specify the default facets. These facets appear in the Guided Navigation widget on any search-driven page that does not have its own explicitly defined list of facets.
  • You can create an ordered list of facets for a specific collection. These facets appear in the Guided Navigation widget when the shopper views the collection’s search-driven page.
  • You can create an ordered list of facets for one or more search terms. These facets appear in the Guided Navigation widget when the shopper enters any of the search terms.

Follow these instructions to add facets:

  1. On the Search page, click Facet Ordering and then New Facet Ordering Rule.
  2. Select the site the rule applies to.
  3. Select a collection or enter one or more search terms to define which search results whose facets you want to order.
  4. Click the Add facet field to add facets.
  5. Click Create and then Save.

Understand the Behavior when a Collection is Created in two Catalogs

If you create a collection in two catalogs on the same site, with the same path in each catalog, the collection will appear once in Dynamic Curation and Facet Ordering, under the site’s default catalog. A rule created for this collection will apply in both catalogs.

If you create a collection in two catalogs on different sites, or in two catalogs on the same site, but with a different path in each catalog, the two collections will both appear in the collection picker in Dynamic Curation and Facet Ordering. If you want the same rule to apply to both collections, you must create the rule twice, once for each collection.

Multiple Sites and Search

If you run multiple sites within a single instance of Retail Digital Commerce, these sites share a single search configuration.

Your sites share the following search features:

  • All searchable field ranking lists
  • A single thesaurus

Configure Dynamic Content

With Dynamic Content, merchandisers can return dynamic content alongside products and navigation.

For one or more search terms, or for any collection, you can choose dynamic media from the media library. When a shopper enters one of the search terms, or navigates to the collection, the metadata for the image along with the search results are returned. For example, a search containing the term "sale" may display a clickable banner with "Click here to go to our sale page".

Open the Dynamic Content page from the Search page. You must be assigned the Admin or Search role. Changes to the dynamic content do not affect your store until after you publish.

You can see how your dynamic content rules behave when shoppers search for terms or view a collection by previewing your store by clicking Save and Preview. If a widget has been created and placed on the Search Results or Collection layout, you can see the destination and that the image you specified is displayed.

Create a Dynamic Content Rule

Follow these steps to create a new dynamic content rule:

  1. On the Search page, click Dynamic Content.
  2. Click New Content Rule.
  3. Select the site the rule applies to.
  4. Select a collection or enter one or more search terms to define the search results where you want to spotlight your content. Or you can select All destinations on the selected sites.
  5. Click Select Media to select or add an image to display. Multiple image selection is not supported.
  6. Optionally enter URL information in the Link URL field. A shopper who clicks on the image will be taken to this URL.
  7. Click Create.

Update a Dynamic Content Rule

Follow these steps to edit an existing dynamic content rule:

  1. On the Search page, click Dynamic Content.
  2. Click to open the dynamic content rule you want to edit from the list of dynamic content rules.
  3. Update the site, destination or media.
  4. Click Save.
  5. Optionally click Save and Preview to preview the search results. For site-specific rules, click the preview button on the header of the administration interface.

Delete a Dynamic Content Rule

Follow these steps to delete a dynamic content rule:

  1. On the Search page, click Dynamic Content.
  2. Click to open the dynamic content rule you want to delete from the list of dynamic content rules.
  3. Click Delete.
  4. When the confirmation appears, click Delete.

Create Dynamic Content Widgets

To display dynamic content, you create a dynamicContentList widget. The widget can be added to the Search Results layout or the Collection layout of Storefront or Agent. The widget also ensures that a shopper who clicks on the image is redirected to the URL specified in the rule.

In the search response, the dynamic content is returned in the additional content property and this is mapped to the additional content property in the searchResultsDetails view model. The widget instances interact with the view model to retrieve and display the image.

A dynamicContentList widget could be created in a way similar to the following example, which you could store in a file named dynamiccontent-widget.js:

define(
  ['jquery', 'knockout', 'ccLogger', 'pubsub'],
  function($, ko, CCLogger, pubsub) {
    'use strict';
    return {
       
    onLoad : function(widget) {
      widget.dynamicContentList = ko.observableArray();
      widget.searchSuccess = function(result) {
        if(this.dynamicContent && this.dynamicContent.contents && this.dynamicContent.contents.length>0){
          widget.dynamicContentList(this.dynamicContent.contents);
        } else {
          widget.dynamicContentList([]);
        }
      };
      $.Topic(pubsub.topicNames.SEARCH_RESULTS_UPDATED).subscribe(widget.searchSuccess);
      $.Topic(pubsub.topicNames.SEARCH_RESULTS_FOR_CATEGORY_UPDATED).subscribe(widget.searchSuccess);
       }
    }
  }
);

Once you have retrieved the dynamic content image URL, you can display it using your widget template. The display.template file might contain the following:

<div id="cc-dynamic-content">
<!-- ko if: dynamicContentList().length > 0 -->
<h3> Displaying dynamic content </h3>
<!-- ko foreach: dynamicContentList-->
<!-- ko if: $data['@type'] == "Media" -->
<div id="banner" >
<a data-bind="attr:{href: $data['linkURL']}">
<img class="img-responsive center-block" data-bind="ccResizeImage: {
          isSrcSetEnabled : true,
          source: $data['imageUrl'] }"/>
</a>
<br/>
</div>
<!-- /ko -->
<!-- /ko -->
<!-- /ko -->
</div>

Use the Search REST APIs

Some search-related tasks cannot be done through the administration interface and can only be completed using the search REST APIs.

The following tasks must be completed through the REST APIs:

  • Create and delete a searchable field ranking list
  • Enable and disable cross-field matching
  • Enable different types of partial matching
  • Specify snippet sizes
  • Select modules that sort search results as part of a relevance ranking strategy
  • Configure locales, search term wildcards, and spelling dictionaries

See Use the REST APIs for more information.