Pause Indexing Operation



Overview

Which node is indexing paused for?

  • 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 database list view:
    Indexing will be paused on the local node the browser is opened on, even if it is Not the preferred node.


What happens when indexing is paused for a node?

  • No indexing takes place on a node that indexing is paused for.
    New data is indexed on database-group nodes that indexing is not paused for.

  • All indexes, including paused ones, can be queried, but results may be stale when querying nodes that indexing has been paused for.

  • New indexes can be created for the database.
    However, the new indexes will also be paused on any node that indexing is paused for,
    until indexing is resumed for that node.

  • When resetting indexes or editing index definitions, re-indexing on a node that indexing has been paused for will only be triggered when indexing is resumed on that node.


Resuming indexing:

  • Learn to resume indexing for all indexes by a client, here: resume indexing

  • Learn to resume indexing for all indexes via Studio, here: 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 it).
      Toggling the database state can be done using the Studio database list view,
      or using ToggleDatabasesStateOperation by the client.

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()