You can manage primary indexes and global secondary indexes through the Couchbase Web Console.
To access the Indexes screen, click on the tab in the left-hand navigation bar:
An index list, showing a summary of all indexes, is displayed in table format.
To change the index view, open the view by drop-down list and choose a view.
index displays all the available indexes in a single list.
bucket groups the indexes by bucket.
server node groups the indexes by server.
To filter the indexes, type a filter term in the filter indexes box.
Only indexes whose definition contains the filter term are shown.
To remove the filter and display all indexes, click the cross icon ⊗ at the end of the filter indexes box.
The index list displays the following information about each index:
- index name
The name of the index or replica.
There may also be one or more indicators after the index name, giving further information:
The number of requests per second.
- resident ratio
The percentage of the data held in memory.
The number of items currently indexed.
- data size
The size of indexable data that is maintained for the index or replica.
(Only displayed if viewing the indexes by index, or by server node.) The bucket for which the index or replica was created.
(Only displayed if viewing the indexes by bucket.) The server node on which the index or replica is stored, or a list of the nodes on which index partitions are stored.
The current state of the index service on the node on which this index is stored: ready, pause, or warmup.
The color of the left margin of the index row also reflects the current state of the index. For example, the left margin of the index row is green when the index is ready, orange when the index is in warmup, and so on.
To work with an index, click the index row in the indexes list to expand the index row. The index row is a toggle — click the row again to collapse it.
When the index row is expanded, the following extra information is displayed.
The N1QL statement used to define the index.
- Storage Mode
The storage mode used by the index service on the node on which this index is stored.
(Only displayed for partitioned indexes.) The nodes on which the index partitions are stored, and the number of partitions stored on each node.
- Last Scanned
The time and data of the last scan request received for this index. If the index service cannot determine when this index was last scanned, this statistic is not displayed. This may be useful for determining whether this index is currently unused.
This statistic is persisted to disk every 15 minutes, so it is preserved when the indexer restarts.
In addition, when the index row is expanded, the Index Stats heading is also displayed, along with the Open in Workbench and Drop buttons.
To see statistics for the index, click the Index Stats heading in the expanded index row.
The Index Stats heading is a toggle — click the heading again to hide the statistics.
For details of the index statistics, refer to Index Statistics.
To open the index definition:
Click the Open in Workbench button in the expanded index row.
The index definition is displayed in the Query workbench.
Modify the index definition as required. (You cannot change the definition of the existing index, but you can create a new index with the modified definition.)
The defining and editing of indexes is performed by means of N1QL. See the N1QL Language Reference for information.
To drop the index from the bucket:
Click the Drop button in the expanded index row.
A pop-up message appears, asking if you are sure you want to drop the index.
Click Drop Index to drop the index, or Cancel to cancel.
Summary statistics for the index service are displayed in the footer of the Indexes screen.
For details of the index summary statistics, refer to Index Service Statistics.
You can manage some index service settings using the CLI. Refer to Index Storage Settings via CLI.
Note that there is no CLI support for the administration of specific indexes. However, you can get index information from the system catalog. Refer to Querying Indexes.
You can also edit or remove indexes using N1QL. Refer to N1QL Language Reference for more details.
You can manage some index service settings using the REST API. Refer to Index Settings via REST.
Note that there is no REST API support for the administration of specific indexes.