Skip to content

Commit 904f50b

Browse files
committed
Update primary index functionality
1 parent 6c8875d commit 904f50b

File tree

3 files changed

+12
-9
lines changed

3 files changed

+12
-9
lines changed

modules/n1ql/pages/n1ql-language-reference/createprimaryindex.adoc

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ include::partial$n1ql-language-reference/horizontal-style.adoc[]
1919

2020
The `CREATE PRIMARY INDEX` statement allows you to create a primary index.
2121
Primary indexes contain a full set of keys in a given keyspace.
22-
Primary indexes are optional and are only required for running ad hoc queries on a keyspace that is not supported by a secondary index.
22+
Primary indexes are optional -- they enable you to run ad hoc queries on a keyspace that is not supported by a secondary index.
2323

2424
== Purpose
2525

@@ -62,7 +62,7 @@ image::n1ql-language-reference/create-primary-index.png["Syntax diagram: refer t
6262
[horizontal]
6363
index-name::
6464
(Optional) A unique name that identifies the index.
65-
If a name is not specified, the default name of `#primary` is applied. [small]##[<<note-index-name>>]##
65+
If a name is not specified, the default name of `#primary` is applied.
6666
+
6767
Valid GSI index names can contain any of the following characters: `A-Z` `a-z` `0-9` `&num;` `&lowbar;`, and must start with a letter, [`A-Z` `a-z`].
6868
The minimum length of an index name is 1 character and there is no maximum length set for an index name.
@@ -77,9 +77,6 @@ Refer to <<index-using>> below.
7777
index-with:: (Optional) Specifies options for the index.
7878
Refer to <<index-with>> below.
7979

80-
[[note-index-name,note]]
81-
NOTE: You can drop unnamed primary indexes using the `DROP PRIMARY INDEX` statement, and named primary indexes using the `DROP INDEX` statement.
82-
8380
[[if-not-exists]]
8481
=== IF NOT EXISTS Clause
8582

modules/n1ql/pages/n1ql-language-reference/dropindex.adoc

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,11 @@
1313
include::partial$n1ql-language-reference/horizontal-style.adoc[]
1414

1515
{description}
16-
Dropping an index that has replicas will also drop all of the replica indexes too.
17-
You can drop unnamed primary indexes using the {drop-primary-index}[DROP PRIMARY INDEX] statement.
16+
Dropping an index that has replicas will drop all of the replica indexes too.
17+
18+
[NOTE]
19+
To drop a primary index, use the {drop-primary-index}[DROP PRIMARY INDEX] statement.
20+
For compatibility with legacy versions of Couchbase Server, you can also use the DROP INDEX statement to drop a named primary index.
1821

1922
== Prerequisites
2023

modules/n1ql/pages/n1ql-language-reference/dropprimaryindex.adoc

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
= DROP PRIMARY INDEX
2-
:description: The DROP PRIMARY INDEX statement allows you to drop an unnamed primary index.
2+
:description: The DROP PRIMARY INDEX statement allows you to drop a primary index.
33
:page-topic-type: reference
44
:imagesdir: ../../assets/images
55

@@ -13,7 +13,7 @@ include::partial$n1ql-language-reference/horizontal-style.adoc[]
1313

1414
{description}
1515

16-
IMPORTANT: Named primary indexes that are created using CREATE PRIMARY INDEX can only be dropped using the DROP INDEX command.
16+
NOTE: For compatibility with legacy versions of Couchbase Server, you can also use the DROP INDEX statement to drop a named primary index.
1717

1818
== Prerequisites
1919

@@ -35,6 +35,9 @@ image::n1ql-language-reference/drop-primary-index.png["Syntax diagram: refer to
3535
// TODO: Automatic links in EBNF.
3636

3737
[horizontal]
38+
index-name:: (Optional) A unique name that identifies the index.
39+
If you don't specify a name, the index with the default name of `#primary` is deleted.
40+
3841
keyspace-ref:: (Required) Specifies the keyspace where the index is located.
3942
Refer to <<keyspace-ref>> below.
4043

0 commit comments

Comments
 (0)