Pause Index Operation



Overview

Which node is the index paused for?

  • When pausing the index from the client:
    The index will be paused for the preferred node only, Not for all database-group nodes.

  • When pausing the index from the Studio indexes list view:
    The index will be paused for the local node the browser is opened on, even if it is Not the preferred node.


What happens when an index is paused for a node?

  • A paused index performs no indexing for the node it is paused for.
    New data is indexed by the index on database-group nodes that the index is not paused for.

  • A paused index can be queried, but results may be stale when querying the node that the index is paused for.


Resuming the index:

  • Learn how to resume an index by a client here: Resume index

  • Learn to resume an index from Studio here: Indexes list view

  • Pausing the index is Not a persistent operation.
    This means the paused index 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.
  • Resetting a paused index will resume the normal operation of the index
    on the local node where the reset action was performed.

  • Modifying the index definition will resume the normal operation of the index
    on all the nodes for which it is paused.

Pause index example

# Define the resume index operation, pass the index name
pause_index_op = StopIndexOperation("Orders/Totals")

# Execute the operation by passing it to maintenance.send
store.maintenance.send(pause_index_op)

# At this point:
# Index 'Orders/Totals' is paused on the preferred node

# Can verify the index status on the preferred node by sending GetIndexingStatusOperation
indexing_status = store.maintenance.send(GetIndexingStatusOperation())

index = [x for x in indexing_status.indexes if x.name == "Orders/Totals"][0]
self.assertEqual(index.status, IndexRunningStatus.PAUSED)

Syntax

class StopIndexOperation(VoidMaintenanceOperation):
    # class name has "Stop", but this is ok, this is the "Pause" operation
    def __init__(self, index_name: str): ...
Parameters Type Description
index_name str Name of an index to pause