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 (from the indexes list view):
      The index is reset on the local node the browser is opened on, even if it is Not the preferred node.
  • If index is disabled or paused then resetting the index will put it back to the normal running state
    on the local node where action was performed.

  • In this page:


Reset index

// Define the reset index operation, pass index name
var resetIndexOp = new ResetIndexOperation("Orders/Totals");

// Execute the operation by passing it to Maintenance.Send
// An exception will be thrown if index does not exist
store.Maintenance.Send(resetIndexOp);
// Define the reset index operation, pass index name
var resetIndexOp = new ResetIndexOperation("Orders/Totals");

// Execute the operation by passing it to Maintenance.SendAsync
// An exception will be thrown if index does not exist
await store.Maintenance.SendAsync(resetIndexOp);

Syntax

public ResetIndexOperation(string indexName);
Parameters
indexName string Name of an index to reset