Create a widget
The following procedures describe how to create widgets in Sitecore Search. New widgets have a Default variation that you can name when you create the widget. New widget variations do not have any rules.
In a multi-entity implementation, by default, widget variation rules are configured to apply when searching all entities. You can change the rule to apply to a single entity.
If you want a widget to appear on a specific page, you must add it to that page before your developer can add it to your application.
Search results widget
Use a search results widget to display full-page search results after a visitor has entered a keyphrase in the search box and run the search.
A search results widget is configured for you when your domain is created. However, if you need to create any additional search results widgets, you can use the following process to do so.
To create a search results widget:
-
On the menu bar, click Widgets.
-
On the Widgets tab, click Add widget.
-
Click Search results.
-
Enter or select values for the Widget name, RFK ID, Variation name, and Will be used in form fields, and then click Next.
-
Review your choices. Then, to complete creating the widget, click Save.
-
To deploy your new widget, click Publish.
Preview search widget
Use a preview search widget to create a pop-up search experience that gives visitors suggested content based on their search. This can include auto-completed and auto-corrected suggestions.
When your domain is created, a single preview search widget that is common across all pages is configured. However, if you want to use different analyzers to provide different types of suggestions on different pages, you can create your own preview search widgets and add them to specific pages.
To create a preview search widget:
-
On the menu bar, click Widgets.
-
On the Widgets tab, click Add widget.
-
Click Preview search.
-
Enter or select values for the Widget name, RFK ID, Variation name, and Will be used in form fields. Then, click Next.
-
Review your choices. Then, to complete creating the widget, click Save.
-
To deploy your new widget, click Publish.
Recommendation widget
Use a recommendation widget to display customized recommended content to visitors.
The most important part of the recommendation widget is the recipe, which determines the type of recommendations given.
For example, recommendation widgets can display content that is:
-
Popular among visitors to your site.
-
Recently viewed by the visitor.
-
Similar to the content on the current page.
To create a recommendation widget:
-
On the menu bar, click Widgets.
-
On the Widgets tab, click Add widget > Recommendation.
-
On the Setup Widget screen, enter or select values for the Widget name, RFK ID, Variation name, and Will be used in fields, and then click Next.
-
To select a recipe to use with this widget, on the Choose Recipes screen, from the Entities drop-down menu, select an entity or All.
-
On the desired recipe card, click Choose.
ImportantWhen selecting a recipe, make sure it is valid for the entity you intend to use it with. All entities supported by a particular recipe have a green checkmark next to them on the recipe card.
To help you choose a recipe, you can filter recipes by:
-
Name - enter text in the Search input field.
-
Creator - select Domain or Sitecore in the drop-down menu.
-
-
To change a selected recipe, click Choose another or, to select another recipe for a different entity or entities, at the bottom of the screen, click Add.
-
For each recipe added, to change the entity or entities you want to use that recipe for, select the check box beside the entity name.
TipAn entity must have one recipe assigned for the widget to display recommendations for that entity.
-
When you have assigned all desired recipes, click Next.
-
Review your choices. To complete creating the widget, click Save. Then, to deploy your new widget, click Publish.