Skip to content

Commit ce0e689

Browse files
committed
Adding TOC
1 parent 4ad3ef5 commit ce0e689

File tree

1 file changed

+10
-7
lines changed

1 file changed

+10
-7
lines changed

articles/cosmos-db/cassandra-secondary-index.md

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ It's not advised to create index on a frequently updated column. It is prudent t
2828
### Create a table
2929
Use the following commands to create a key space and a table:
3030

31-
```
31+
```shell
3232
CREATE KEYSPACE sampleks WITH REPLICATION = { 'class' : 'SimpleStrategy'}
3333
CREATE TABLE sampleks.t1(user_id int PRIMARY KEY, lastname text) WITH cosmosdb_provisioned_throughput=400;
3434
```
@@ -37,7 +37,7 @@ CREATE TABLE sampleks.t1(user_id int PRIMARY KEY, lastname text) WITH cosmosdb_p
3737
3838
Insert the following user data into the table:
3939
40-
```
40+
```shell
4141
insert into sampleks.t1(user_id,lastname) values (1, 'Nishu');
4242
insert into sampleks.t1(user_id,lastname) values (2, 'John');
4343
insert into sampleks.t1(user_id,lastname) values (3, 'Bat');
@@ -52,21 +52,21 @@ insert into sampleks.t1(user_id,lastname) values (9, 'Jagan');
5252
5353
If you try executing the following statement, you will run into an error that asks you to use allow filtering:
5454
55-
```
55+
```shell
5656
select user_id, lastname from gks1 .t1 where last_name='Nishu';
5757
```
5858
5959
### Create an index
6060
6161
Create an index with the following command:
6262
63-
```
63+
```shell
6464
CREATE INDEX ON sampleks.t1 (lastname)
6565
```
6666
6767
Next you can run queries with filter on the indexed field:
6868
69-
```
69+
```shell
7070
select user_id, lastname from gks1.t1 where user_id=1;
7171
```
7272
@@ -76,9 +76,12 @@ With Cassandra API in Azure Cosmos DB, you do not have to provide an index name.
7676
7777
You need to know the index name is to drop the index. Run the `desc schema` command to get the description of your table. The output of this command includes the index name. You can then use the index name to drop the index as shown in the following example:
7878
79-
```
79+
```shell
8080
desc schema;
8181
drop index sampleks.t1_lastname_idx;
8282
```
8383
84-
## Next steps
84+
## Next steps
85+
86+
* Learn how [automatic indexing](index-overview.md) works in Azure Cosmos DB
87+
* [Apache Cassandra features supported by Azure Cosmos DB Cassandra API](cassandra-support.md)

0 commit comments

Comments
 (0)