Skip to main content
Version: 1.28 (Current)

Perform Search

Audience: Low-code Engineers

Skill Prerequisites: Actions, Tokens, JSON, Search

Runs a search on the index of a search behavior and stores one page of results as JSON in a token. It's the same search engine the search input and results modules use, so the behavior's search settings apply.

Use it to build your own search experience, for example a lookup on a form or an API that returns matching records. To get the results into tokens or a list, parse the JSON with Parse JSON Into Tokens and Create List from JSON.

note

This action requires the Search feature (Standard) to be licensed. If it isn't, the action fails with a message that the feature is unlicensed.

Typical Use Cases​

  • Look up records from a database indexing rule as the user types, for example customers by name or number
  • Return search results from an API endpoint as JSON
  • Show a custom results page, with your own paging, from a form
  • Find records that match a filter, such as a category or status stored as custom data

Don't use it to​

Action NameDescription
Parse JSON Into TokensTurns the results JSON into tokens, for example the total number of results.
Create List from JSONLoads the results array into a list.
Execute Actions for each List EntryRuns actions once for each result in the list.
List to JSONTurns a list back into a JSON array, for example to return a trimmed-down result.
Index BehaviorIndexes all content sources of a behavior.
Index RuleIndexes one database indexing rule right away.
Remove RecordsDeletes records from a behavior's index.

Input Parameter Reference​

ParameterDescriptionSupports TokensDefaultRequired
Behavior IDThe search behavior whose index is searched. Pick it from the list or enter its numeric ID, for example [BehaviorId]. See Set Up Search Behaviors.Yesempty stringYes
Page SizeHow many results to return, for example 20. An empty or non-numeric value uses 10. 0 makes the action fail.Yes10No
Page NumberWhich page of results to return, starting at 1. If it's higher than the last page, the last page is returned.No1No
Search TermsOne or more rows with the words to search for, for example [SearchText]. The rows are joined with spaces. Empty rows are skipped. See How the terms are matched.YesemptyYes
FiltersRows of Name and Value that results must match. Put several values for one name on separate lines. See Filters.Values onlyemptyNo

Output Parameters Reference​

ParameterDescription
Results OutputThe name of the token that receives the results as JSON, for example SearchResults. Enter it without brackets. See The results JSON.

How the terms are matched​

The terms are searched in the fields turned on in the behavior's Search Settings, such as titles, descriptions and content. The behavior also decides how several words are combined (all, any or the exact phrase), and whether fuzzy and wildcard search are used.

  • Put words in double quotes to search for a phrase, for example "annual report".
  • Start a word with + to require it, or with - to exclude it, for example invoice -draft.
  • Words shorter than two characters and common stop words are ignored.
  • The terms aren't Lucene query syntax. Something like status:open is searched as the two words status and open.
  • If every term is empty, no words are searched and all records that pass the filters are returned.

Results are sorted by relevance. The behavior's sorting settings aren't used by this action. Only records in the current language, or with no language, are returned.

Filters​

Filters narrow the results to records with an exact value. Different names must all match. The values of one name are alternatives, so any of them can match.

NameMatches
TypeThe kind of record, for example rule for a database indexing rule, mod for page content, doc for a file or url for a crawled URL.
SubTypeFor a database indexing rule, the rule name.
IdThe record's search key. For a database indexing rule it's avtsb.<Rule Name>-<ID>, for example avtsb.Customers-42.
Title, Keywords, OriginalNameThe whole value, in lower case, for example acme ltd.
Path, ContainerPath, ContainerParentPathThe item or container path.
datefrom, datetoThe published date range, for example 2026-01-01. Only the first value is used. Without dateto, the range ends now.
Any other nameA custom data field of the record, for example status. The value must match exactly, including case. Numbers are compared as numbers.

Names aren't case-sensitive. The behavior's own filters, set in the Settings tab, are applied too. A filter with no values is skipped.

The results JSON​

The token holds an object with metadata and results:

{
"metadata": {
"executionTime": 12,
"currentResultsPage": 1,
"totalResultsPages": 3,
"totalResults": 25,
"firstResult": 1,
"lastResult": 10,
"pageSize": 10,
"maxScore": 2.31
},
"results": [
{
"orderIndex": 1,
"title": "Acme Ltd",
"description": "Acme Ltd, 12 Main Street, Denver",
"url": "https://example.com/customers?id=42",
"type": "rule",
"subType": "Customers",
"searchKey": "avtsb.Customers-42",
"relevance": 100,
"datePublished": "2026-09-01T10:00:00",
"customData": { "status": "Active", "region": "West" },
"categories": [ { "title": "Customers", "path": "Customers", "count": 1 } ]
}
]
}

Each result also has docId, score, containerPath, itemPath, source, keywords, originalDescription, portalId, tabId, moduleId, authorId, authorName, roleNames, ignoreSecurity, originalId, originalName, originalPath, targetUrl, urlHash, contentSourceId, urlWithReporting and guid.

  • Property names are in camel case, including the keys of customData.
  • When nothing matches, totalResults is 0, firstResult is 0, lastResult is -1 and results is empty.
  • If term highlighting is on in the behavior, title and description can contain <span class='highlight'> tags.

Security​

The results are trimmed to what the current user may see, based on the roles stored with each record when it was indexed:

  • Users in the portal's Administrators role see all records.
  • Other users see records allowed for their roles or for them, and not denied to them. Anonymous visitors see records allowed for Unauthenticated Users or All Users.
  • Records indexed while the behavior's Ignore DNN Security setting was on are visible to everyone.

For database indexing rules, the roles come from the rule's permission settings. Check them before you expose results to users. See Search Index Rules.

caution

Trimming only works when the action runs in a web request, such as a form, listing or API endpoint. In workflows and scheduled jobs, which run as Automation jobs in the background, results aren't trimmed at all, so every matching record is returned. A search with terms may also fail there. Don't pass search results from an Automation job to users without checking them yourself.

Considerations​

  • Validate the Behavior ID. A non-numeric or unknown ID makes the action fail before searching.
  • Page Number doesn't take tokens. A token in it is ignored and page 1 is returned. Enter a fixed number.
  • Filter names don't take tokens. Only filter values are tokenized in this action. Don't repeat the same filter name in two rows; the action fails. Put the values on separate lines instead.
  • Numeric built-in fields. Filtering ModuleId, TabId, Author or ContainerId by a number doesn't match anything. Use Type, SubType or a custom data field instead.
  • Keep the JSON on the server. The raw results include internal details such as roleNames, itemPath and portalId. Pick the properties you need before you send them to a browser, for example with List to JSON.
  • Errors. If the search itself fails, administrators see Something went wrong while performing a search on the '#<ID> <Name>' Behavior. and other users see a generic error. Check the logs for the cause. Catch errors with the On Error actions of Execute Actions.
  • Fresh content. Only indexed content can be found. New content shows up after the next indexing. See Index Behavior.

Additional Resources​

Examples​

tip

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

1. Search and read the total​

This action searches behavior 1 for the text in the SearchText token and stores the first 10 results in SearchResults.

{
"Title": "Perform Search",
"ActionType": "SearchBoost.PerformSearch",
"Description": "Search customers",
"Parameters": {
"BehaviorId": "1",
"PageSize": "10",
"PageNumber": "1",
"SearchTerms": [
{
"SearchTerm": "[SearchText]"
}
],
"Filters": [],
"ResultsOutputTokenName": "SearchResults"
}
}

Then this action creates tokens such as [Search:metadata.totalResults] and [Search:results].

{
"Title": "Parse JSON Into Tokens",
"ActionType": "ParseJsonIntoTokens",
"Description": "Read the search metadata",
"Parameters": {
"JsonString": "[SearchResults]",
"BaseTokenName": "Search"
}
}

2. Filter by custom data and loop over the results​

This action returns up to 50 records of the Customers database indexing rule whose status custom data is Active or Pending.

{
"Title": "Perform Search",
"ActionType": "SearchBoost.PerformSearch",
"Description": "Find active customers",
"Parameters": {
"BehaviorId": "1",
"PageSize": "50",
"PageNumber": "1",
"SearchTerms": [
{
"SearchTerm": "[SearchText]"
}
],
"Filters": [
{
"FilterName": "SubType",
"FilterValues": "Customers"
},
{
"FilterName": "status",
"FilterValues": "Active\nPending"
}
],
"ResultsOutputTokenName": "CustomerResults"
}
}

After Parse JSON Into Tokens with Base Token Name set to Customers, this action loads the results into the CustomersList list, but only when there are results. Each item has properties such as title, url and customData.status, which you can use in Execute Actions for each List Entry, for example [CustomersList:title].

{
"Title": "Create List from JSON",
"ActionType": "LoadEntitiesFromJson",
"Description": "Load the results",
"Condition": "[Customers:metadata.totalResults] != \"0\"",
"Parameters": {
"JsonModel": "[Customers:results]",
"EntityName": "CustomersList",
"EnforceISODateTime": false,
"OnError": []
}
}

Revised 09/27/2026