DROP INDEX (SAI, 2i)
Removes an existing index.
For Solr indexes, use DROP SEARCH INDEX.
|
When you |
Synopsis
DROP INDEX [ IF EXISTS ] [<keyspace_name>.]<index_name> ;
| Syntax conventions | Description |
|---|---|
UPPERCASE |
Literal keyword. |
Lowercase |
Not literal. |
|
Variable value. Replace with a user-defined value. |
|
Optional.
Square brackets ( |
|
Group.
Parentheses ( |
|
Or.
A vertical bar ( |
|
Repeatable.
An ellipsis ( |
|
Single quotation ( |
|
Map collection.
Braces ( |
|
Set, list, map, or tuple.
Angle brackets ( |
|
End CQL statement.
A semicolon ( |
|
Separate the command line options from the command arguments with two hyphens ( |
|
Search CQL only: Single quotation marks ( |
|
Search CQL only: Identify the entity and literal value to overwrite the XML element in the schema and solrConfig files. |
- IF EXISTS
-
Optional. Drop the index if it exists, or silently do nothing if the named index doesn’t exist in the keyspace. Otherwise, an error is returned if the index doesn’t exist.
- keyspace_name
-
The name of the keyspace containing the index. If not specified, the current keyspace is used.
- index_name
-
The name of the index to drop.
Examples
- Drop SAI index
-
DROP INDEX IF EXISTS cycling.lastname_idx; DROP INDEX IF EXISTS cycling.age_idx; DROP INDEX IF EXISTS cycling.country_idx; DROP INDEX IF EXISTS cycling.registration_idx; - Drop 2i index
-
DROP INDEX IF EXISTS cycling.teams_idx;