Search box widget
Overview
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.
Search setup
- 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 items. 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 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:
- 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.
You manage the scoring profiles and parameters in the Azure portal.
For more information, see Add scoring profiles to a search index.
Display settings
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).
Filter expressions
NOTE: This feature is available as of Sitefinity CMS 15.4.8631 and works only with Azure AI Search and Elasticsearch. It is compatible with search facets: search facets are applied on the filtered results. For more information about search facets, see Search facets.
In Filter expressions, you can create a custom filter by manually entering a filter expression in JSON format. This filter expression is a serialized hierarchical JSON structure that limits the content the Search box widget includes in its search results.
This filter accepts the following operators:
"eq" – equals
"ne" – does not equal
"gt" – greater than (for numbers)
"lt" – less than (for numbers)
"ge" – greater than or equal (for numbers)
"le" – less than or equal (for numbers)
"any+or" – contains any of the collection
"any+and" – contains all of the collection
"not+(any+or)" – does not contain any of the collection
"startswith" – starts with (for strings)
"not+(startswith)" – does not start with (for strings)
The above filters have the following properties:
- FieldName maps to the name of the field in the search index.
- Operator maps to the logical operator.
- FieldValue maps to the value with which to execute the logical operation.
NOTE: The fields you use in filter expressions must be included in the search index that you chose for this search box.
Filter examples
Basic filter by content type
Only returns search results whose ContentType matches a specific type. Use this when the search box should surface only a single content type, such as news articles.
Filter by URL prefix
Limits results to content whose URL starts with /blog. Ideal for section-scoped search on a multi-section site.
Exclude a URL subtree
Excludes all content under /internal from appearing in search results.
Filter by numeric value
Returns only items with a price greater than zero. Useful for product catalogs where free/unpublished items should be hidden.
Boolean filter
Restricts search to featured content only.
Match and of several values
Returns items in any of the three STEM categories.
Filter by tag (collection field)
Matches items whose Tags collection contains the value breaking-news. Works with choice fields, classification fields, and any multi-value property.
Exclude a tag
Excludes items tagged as archived from results.
Date range filter
Scopes search to content published in 2026 only. The date value must be in ISO format. Supported formats include:
yyyy-MM-dd'T'HH:mm:ss.fffK
yyyy-MM-dd'T'HH:mm:ssK
yyyy-MM-dd'T'HH:mm:ss'Z'
yyyy-MM-dd
Complex filter (AND / OR)
Use a complex filter to combine multiple conditions. The complex filter is recursive and can contain child complex filters. The Operator property can be "AND" or "OR", which determines how the child filters are combined.
Example – AND: both conditions must be true:
Returns only English news articles.
Example – OR nested inside AND: items must match the outer condition and at least one inner condition:
Returns only products under /products that belong to the Hardware or Accessories category.
Complex nesting
A real-world e-commerce scenario: search only shows featured, premium-priced items that are tagged "premium" but not "archived".
Labels & Messages
In the Labels & Messages section, you can do the following:
- In Search box placeholder text, you can enter some text to guide the user that this is a search box.
For example, you can enter Search….This text is only guidance for the user and is not submitted as a search term.
- In Search button, enter the label for the search button that the user clicks to submit the search keyword.
Save your changes.