Skip to main content
Version: 1.28 (Current)

Index Rule

Audience: Low-code Engineers

Skill Prerequisites: Actions, SQL, Search

Indexes one database indexing rule of a search behavior right now. The rule's SQL query runs, and each row it returns is added to the behavior's index or updated there.

Database indexing rules are set up in the Database Indexing Rules section of the Search Content Sources Tab. The rule defines the query and which columns hold the ID, title, description, URL, dates and permissions.

Unlike Index Behavior, this action does the work before it finishes. The following actions run once the rows are indexed.

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. Indexing database rules also needs the Data Integration feature. Without it, the action does nothing and doesn't report an error.

Typical Use Cases​

  • Update the index right after a record is saved, so a search finds the change straight away
  • Index rows added by an import or a workflow
  • Remove records that were soft-deleted, using the rule's Is Deleted Column

Don't use it to​

  • Index pages, files or URLs. Use Index Behavior.
  • Delete specific records from the index when the rows no longer exist. Use Remove Records, or run this action with Full Reindex.
Action NameDescription
Index BehaviorIndexes all content sources of a behavior, in the background.
Remove RecordsDeletes records from a behavior's index.
Perform SearchSearches a behavior's index.
Execute Actions AsynchronouslyRuns actions in the background, so users don't wait for the indexing.

Input Parameter Reference​

ParameterDescriptionSupports TokensDefaultRequired
Behavior IDThe search behavior that uses the rule. Pick it from the list or enter its numeric ID, for example [BehaviorId].Yesempty stringYes
Rule IDThe database indexing rule to index. The list shows the rules of the selected behavior. You can also enter the rule's numeric ID. The rule must be used by the behavior.Yesempty stringYes
ScopeIncremental or Full Reindex. See Incremental and full reindex.NoIncrementalYes

Output Parameters Reference​

This action has no output parameters.

Incremental and full reindex​

Incremental runs the rule's query for rows that changed since the rule was last indexed. For this, the rule needs a Last Modified Date Column or a Created Date Column. Without one, every run reads all rows. The query can also use the [LastQueryDate] token.

Full Reindex runs the same query, then removes the rule's records from the index whose rows the query didn't return. This is how rows deleted from the table leave the index.

warning

Full Reindex removes every record of the rule that isn't in the query result. If the rule has a date column and was indexed before, the query only returns changed rows, so unchanged records can be removed too. To rebuild a rule completely, use Index Behavior with Full Reindex.

How rows are indexed​

  • Each row is stored with the search key avtsb.<Rule Name>-<ID>, from the rule's ID column. A row that's indexed again replaces its record, so there are no duplicates.
  • If the rule has an Is Deleted Column and it's true for a row, the row's record is removed.
  • The record's permissions come from the rule's roles settings. Perform Search and the search modules use them to decide who sees the record. See Search Index Rules.
  • When it's done, the rule's last indexed time is set to the time the query ran. The next incremental run starts from there.

Considerations​

  • It runs while you wait. A query that returns many rows makes the action slow. On a form, run it in Execute Actions Asynchronously so the user doesn't wait.
  • Keep the query incremental. Set the rule's Last Modified Date Column, so each run only reads the rows that changed.
  • Errors. A non-numeric or unknown ID, or a rule that isn't used by the behavior, makes the action fail. Administrators see a message such as Something went wrong while trying to index the '#5' Rule., followed by the reason. Rows that can't be indexed, or a missing column, are written to the log and don't make the action fail.
  • Web farms. Only the server that holds the index writer, usually the master server, can write to the index. On another server, rows may not be stored.

Examples​

tip

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

1. Index the changes after saving a record​

This action indexes the rows of rule 5 in behavior 1 that changed since the last run.

{
"Title": "Index Rule",
"ActionType": "SearchBoost.IndexRule",
"Description": "Index the saved customer",
"Parameters": {
"BehaviorId": "1",
"RuleId": "5",
"ScopeType": "incremental"
}
}

2. Remove deleted rows from the index​

This action runs the rule and removes the records whose rows no longer exist. The rule's query has no date column, so it returns all rows. See the warning in Incremental and full reindex.

{
"Title": "Index Rule",
"ActionType": "SearchBoost.IndexRule",
"Description": "Clean up deleted customers",
"Parameters": {
"BehaviorId": "[BehaviorId]",
"RuleId": "[RuleId]",
"ScopeType": "full-reindex"
}
}

Revised 09/27/2026