Reset Index Operation
-
Use
ResetIndexOperation
to rebuild an index:- All existing indexed data will be removed.
- All items matched by the index definition will be re-indexed.
-
Indexes scope:
- Both static and auto indexes can be reset.
-
Nodes scope:
- When resetting an index from the client:
The index is reset only on the preferred node only, and Not on all the database-group nodes. - When resetting an index from the Studio indexes list view:
The index is reset on the local node the browser is opened on, even if it is Not the preferred node.
- When resetting an index from the client:
-
If the index is disabled or paused, resetting the index will put it back to the normal running state on the local node where the action was performed.
-
In this page:
Reset index
// Define the reset index operation, pass index name
const resetIndexOp = new ResetIndexOperation("Orders/Totals");
// Execute the operation by passing it to maintenance.send
// An exception will be thrown if index does not exist
await store.maintenance.send(resetIndexOp);
Syntax
const resetIndexOp = new ResetIndexOperation(indexName);
Parameters | Type | Description |
---|---|---|
indexName | string |
Name of an index to reset |