Search box widget
You use the built-in ASP.NET Core search widgets to display a search box and search results on your website. You use the Search box and Search results widgets to enable the users of your website to search for content.
PREREQUISITES: You created at least one search index. For more information, see Create search indexes.
Place the widget on the page
You can place a Search box widget only inside a Section widget.
To do this, perform the following:
- Inside a column from the Section widget, click Add widget here…
- Select the Navigation & Search tab.
- Click the SEARCH BOX widget.
The widget is placed inside the selected column of the Section widget.
- Click Set where to search.
- In Specify content to search in, select the search index that you want to use for this search box.
The search index is a predefined set of search content. For example, you can create a search index that contains all news. When a user enters a search word, it is applied to all news items on your website.
NOTE: ASP.NET Core search widget does not search the HTML of the page.
- Under Search results page, click (Select page) and select a page from your website that will display the search results.
NOTE: You can select the page where the Search box is located, as well as any other page.
IMPORTANT: You must add the ASP.NET Core Search results widget to the page that will display the search results.
- In Display suggestions after typing..., select the minimum number of characters that the user must enter, after the search box displays search result suggestions.
Select between the predefined values of None, 2, 3, 4.
NOTE: In the advanced settings, you can configure the which fields to use for the search suggestions.
Boost search results
PREREQUISITES: You see the Boost search results section only when you are using Azure Search.
You use the Boost search results section to configure additional parameters for Azure Search:
You manage the scoring profiles and parameters in the Azure portal.
- Scoring profile
Scoring profiles are part of the search index and consist of weighted fields, functions, and parameters.
Use scoring profiles to boost search results by customizing the way different fields are ranked.
- Scoring parameters
Scoring parameters are part of the scoring functions within a scoring profile.
Add scoring parameters to boost content to appear higher in the search results by specifying the parameter's name and value.
For more information, see Add scoring profiles to a search index.
In Display setting section, you can do the following:
Save your changes.
Advanced widget settings
To open the advanced settings, in the upper-right corner of the Search box page, click (Advanced settings).
Labels & Messages
In the Labels & Messages section, you can do the following:
- In Search box placeholder text, you can enter some text to orientate the user that this is a search box.
For example, you can enter
Search….This text is only a guidance for the user and is not submitted as a search term.
- In Search button, enter the label foe the search button that the user clicks to submit the search keyword.
Save your changes.