Skip to content

Latest commit

 

History

History
134 lines (87 loc) · 6.55 KB

File metadata and controls

134 lines (87 loc) · 6.55 KB

Disable Index


{NOTE: }

{NOTE/}


{PANEL: Overview}

Which node is the index disabled on?

  • The index can be disabled either:

    • On a single node, or
    • Cluster wide - on all database-group nodes.
  • When disabling the index from the client API on a single node:
    The index will be disabled on the preferred node only, and Not on all the database-group nodes.

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

  • When disabling the index manually:
    The index will be disabled on the preferred node only, and Not on all the database-group nodes.


What happens when the index is disabled?

  • No indexing will be done by a disabled index on the node where index is disabled.
    However, new data will be indexed by the index on other database-group nodes where it is not disabled.

  • You can still query the index,
    but results may be stale when querying a node on which the index was disabled.

  • Disabling an index is a persistent operation:

{PANEL/}

{PANEL: Disable index from the Client API}

Disable index - single node:

{CODE-TABS} {CODE-TAB:csharp:Sync disable_1@ClientApi\Operations\Maintenance\Indexes\DisableIndex.cs /} {CODE-TAB:csharp:Async disable_1_async@ClientApi\Operations\Maintenance\Indexes\DisableIndex.cs /} {CODE-TABS/}


Disable index - cluster wide:

{CODE-TABS} {CODE-TAB:csharp:Sync disable_2@ClientApi\Operations\Maintenance\Indexes\DisableIndex.cs /} {CODE-TAB:csharp:Async disable_2_async@ClientApi\Operations\Maintenance\Indexes\DisableIndex.cs /} {CODE-TABS/}


Syntax:

{CODE:csharp syntax@ClientApi\Operations\Maintenance\Indexes\DisableIndex.cs /}

Parameter Type Description
indexName string Name of index to disable
clusterWide bool true - Disable index on all database-group nodes
false - Disable index only on a single node (the preferred node)

{PANEL/}

{PANEL: Disable index manually via the file system}

  • It may sometimes be useful to disable an index manually, through the file system.
    For example, a faulty index may load before DisableIndexOperation gets a chance to disable it.
    Manually disabling the index will ensure that the index is not loaded.

  • To manually disable an index:

    • Place a file named disable.marker in the index directory.
      Indexes are kept under the database directory, each index in a directory whose name is similar to the index's.
    • The disable.marker file can be empty,
      and can be created by any available method, e.g. using the File Explorer, a terminal, or code.
  • Attempting to use a manually disabled index will generate the following exception:

         Unable to open index: '{IndexName}', 
         it has been manually disabled via the file: '{disableMarkerPath}.  
         To re-enable, remove the disable.marker file and enable indexing.`
    
  • To enable a manually disabled index:

    • First, remove the disable.marker file from the index directory.
    • Then, enable the index by any of the options described in: How to enable an index.

{PANEL/}

Related Articles

Indexes

Operations