Pause Indexing Operation
-
Use
StopIndexingOperation
to pause indexing for ALL indexes in the database. -
To pause only a specific index use the pause index operation.
-
In this page:
Overview
On which node indexing is paused:
-
When pausing indexing from the client:
Indexing will be paused on the preferred node only, and Not on all the database-group nodes. -
When pausing indexing from the Studio (from the database list view):
Indexing will be paused on the local node the browser is opened on, even if it is Not the preferred node.
When indexing is paused on a node:
-
No indexing will take place on the node where indexing has paused.
New data will be indexed on other database-group nodes where indexing is not paused. -
You can query any index,
but results may be stale when querying the node where indexing has paused. -
New indexes can be created in the database,
however, they will also be in a 'pause' state on the node where you paused indexing,
until indexing is resumed on the node. -
When resetting indexes, or editing index definitions, then re-indexing on the node
where indexing has paused will only be triggered when indexing is resumed on the node.
How to resume indexing:
-
To resume indexing for all indexes from the client - see resume indexing.
-
To resume indexing for all indexes from the Studio - go to the database list view.
-
Pausing indexing is Not a persistent operation.
This means that all paused indexes will resume upon either of the following:- The server is restarted.
- The database is re-loaded (by disabling and then enabling the database state).
Toggling the database state can be done from database list view in Studio,
or from the client by sending the ToggleDatabasesStateOperation.
Pause indexing example
// Define the pause indexing operation
var pauseIndexingOp = new StopIndexingOperation();
// Execute the operation by passing it to Maintenance.Send
store.Maintenance.Send(pauseIndexingOp);
// At this point:
// All indexes in the default database will be 'paused' on the preferred node
// Can verify indexing status on the preferred node by sending GetIndexingStatusOperation
var indexingStatus = store.Maintenance.Send(new GetIndexingStatusOperation());
Assert.Equal(IndexRunningStatus.Paused, indexingStatus.Status);
// Define the pause indexing operation
var pauseIndexingOp = new StopIndexingOperation();
// Execute the operation by passing it to Maintenance.SendAsync
await store.Maintenance.SendAsync(pauseIndexingOp);
// At this point:
// All indexes in the default database will be 'paused' on the preferred node
// Can verify indexing status on the preferred node by sending GetIndexingStatusOperation
var indexingStatus = await store.Maintenance.SendAsync(new GetIndexingStatusOperation());
Assert.Equal(IndexRunningStatus.Paused, indexingStatus.Status);
Syntax
// class name has "Stop", but this is ok, this is the "Pause" operation
public StopIndexingOperation()