Pause Indexing Operation



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 Studio,
      or from the client by sending the ToggleDatabasesStateOperation.

Pause indexing example

// Define the pause indexing operation 
const pauseIndexingOp = new StopIndexingOperation();

// Execute the operation by passing it to maintenance.send
await 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
const indexingStatus = await store.maintenance.send(new GetIndexingStatusOperation());
assert.strictEqual(indexingStatus.status, "Paused");

Syntax

// class name has "Stop", but this is ok, this is the "Pause" operation
const pauseIndexingOp = new StopIndexingOperation();