Skip to main content
Version: 1.28 (Current)

Advanced Search

Audience: Low-code Engineers

Skill Prerequisites: Actions, Tokens, Search

Builds the URL of a search results page for a search behavior, with the search terms and options in the query string, and saves it in a token. It doesn't search and it doesn't send the user anywhere. To show the results, redirect the user to the URL with Redirect to URL.

Use it to turn a form into a search form, for example one with a text box for the terms and a checkbox list for the fields to search. The search itself runs on the results page, in the behavior's search results module.

note

This action is part of the Advanced Search add-on (DnnSharp.SearchBoost.AdvancedSearch), which is installed separately. If you don't see the action, the add-on isn't installed. The action itself doesn't check the license, but the results page needs the Search feature (Standard) to be licensed to show results.

Typical Use Cases​

  • Send the user from a custom search form to the search results page
  • Search only some fields, such as titles and descriptions, based on what the user picks on the form
  • Let the user choose between matching all words or any word
  • Build a results link to show or email, instead of redirecting right away

Don't use it to​

  • Get the results into tokens or a list. Use Perform Search, which returns the results as JSON.
  • Search from an API endpoint, a workflow or an Automation job. It isn't available in API endpoints, and it fails without a web request. Use Perform Search.
  • Restrict what users can find. Everything the action adds ends up in the URL, and users can change it. See Security.
Action NameDescription
Redirect to URLSends the user to the results URL.
Perform SearchSearches a behavior's index and returns the results as JSON.
Index BehaviorIndexes all content sources of a behavior.

Input Parameter Reference​

ParameterDescriptionSupports TokensDefaultRequired
Behavior IDThe search behavior to search. Pick it from the list or enter its numeric ID, for example [BehaviorId]. It decides which results page is used. See Set Up Search Behaviors.Yesempty stringYes
Search Input FieldThe form field that holds the search terms, for example a SearchText text box. It's used only when Search Input Expression is empty.NoemptyNo
Search Input ExpressionThe search terms, when you need more control than one field, for example [FirstName] [LastName]. When it's not empty, it's used instead of Search Input Field.Yesempty stringNo
Multi Word SearchesHow several words are combined: All (results must contain every word) or Any (at least one word). Case doesn't matter. When empty or another value, the behavior's Multi-Word Searches setting is used. See Search Settings.Yesempty stringNo
Search FieldsA comma-separated list of the fields to search, for example Title,Description. Possible values are Title, Content, Keywords, Description, TabTitle, FolderName and AuthorName. Only the listed fields are searched, even if the behavior searches others. When empty, the behavior's Search Fields setting is used. A checkbox list field saves its selection comma-separated, so its token works here.Yesempty stringNo
FiltersRows of Filter Name and Value that results must match. See Filters.Values onlyemptyNo

Output Parameters Reference​

ParameterDescription
Output Token for results urlThe name of the token that receives the results URL, for example ResultsUrl. Enter it without brackets. If it's empty, the URL is built but not saved anywhere.

The results URL​

The URL points to the results page of the behavior:

  1. The behavior's Results Page, set in the Settings tab.
  2. If there's none, the behavior's custom results page URL.
  3. If there's none either, the first page with a search results module for the behavior. That page is then saved as the behavior's Results Page.

If no results page is found, the action fails with Please create a SearchBoost.Results module first!.

The options are added to the query string, for example:

https://example.com/search-results?sb-search=annual+report&sb-bhvr=1&sb-src=Title%2cDescription&sb-logid=...&sb-multiword=all
Query string parameterHolds
sb-searchThe search terms, trimmed. The name comes from the behavior's Name of Query String Param setting, so it can differ.
sb-bhvrThe behavior ID.
sb-srcThe Search Fields, if any.
sb-multiwordThe Multi Word Searches value in lower case, if any.
sb-logidThe ID of the search report entry. See Considerations.
sb-tabidThe current page, when the behavior uses a Dynamic Hierarchy Filter.
sbc-<name>One parameter per filter.

Filters​

caution

In this version, adding filter rows makes the action fail with a "Collection was modified" error. Leave Filters empty, or test your filters before you rely on them.

Each row becomes a sbc-<name> parameter that the results page applies as a filter:

  • Filter Name is changed to one lower-case word. Spaces are removed. Other characters that aren't letters, including digits, become _, and _ at the start or end is dropped. For example, Division Code becomes divisioncode and Region-2 becomes region.
  • Value can hold several values, separated by commas or semicolons, for example Active,Pending. Any of them can match. Empty values skip the row.
  • The names work like the filters of Perform Search, for example type, subtype or a custom data field such as status. Custom data values must match exactly, including case.

Security​

The search runs on the results page, for the user who opens it. The results are trimmed to what that user may see, like any search on the site. See Perform Search.

Everything the action sets is in the URL, including the behavior ID and the filters. Users can change or remove these values and open the page again. Don't use this action to limit which records a user can find. Set the permissions of the content or of the database indexing rules instead. See Search Index Rules.

Considerations​

  • Redirect after it. The action doesn't end the action list. Add Redirect to URL with the output token, for example [ResultsUrl], and turn off Escape URL special characters in tokens, since the URL is already encoded.
  • Set up the results page first. Add a search results module for the behavior to a page, or set the behavior's Results Page. Otherwise the action fails.
  • Validate the Behavior ID. A missing, non-numeric or unknown ID makes the action fail with a generic error.
  • Only in a web request. Forms and listings work. In workflows and Automation jobs, which run in the background, the action fails.
  • Each run is logged as a search. The action adds an entry to the behavior's search reports every time it runs, even if the user never opens the URL.
  • Exact phrase. Exact in Multi Word Searches isn't applied; the behavior's setting is used instead. To search for a phrase, put it in double quotes in the terms, for example "annual report".
  • Empty terms. If both the field and the expression are empty, the results page opens without search terms.

Examples​

tip

To understand how to use the below examples, please see Running Examples.

1. Search from a form​

This action builds the results URL for behavior 1, with the terms from the SearchText field, and saves it in ResultsUrl.

{
"Title": "Advanced Search",
"ActionType": "SbSearch",
"Description": "Build the search results URL",
"Parameters": {
"BehaviorId": "1",
"InputField": "SearchText",
"Input": "",
"MultiWordMethod": "",
"SearchFields": "",
"Filters": [],
"OutputTokenResultsUrl": "ResultsUrl"
}
}

Then this action sends the user to the results page.

{
"Title": "Redirect to URL",
"ActionType": "RedirectToUrl",
"Description": "Show the search results",
"Parameters": {
"Url": "[ResultsUrl]",
"EscapeUrl": false,
"OpenInPopup": false,
"PopupTitle": "",
"OpenInNewTab": false,
"ForceDownload": false
}
}

2. Let the user pick the fields and the word matching​

This action searches the fields picked in the SearchIn checkbox list, for example Title,Description, and combines the words as chosen in the MatchWords dropdown, All or Any. The terms are the first and last name from two fields.

{
"Title": "Advanced Search",
"ActionType": "SbSearch",
"Description": "Search people by name",
"Parameters": {
"BehaviorId": "[BehaviorId]",
"InputField": "",
"Input": "[FirstName] [LastName]",
"MultiWordMethod": "[MatchWords]",
"SearchFields": "[SearchIn]",
"Filters": [],
"OutputTokenResultsUrl": "ResultsUrl"
}
}

Revised 09/27/2026