Query NoSQL Index

Catalyst enables you to query a NoSQL index and retrieve data by identifying the items using the primary keys of the index. Indexing allows you to execute alternate queries on the table data without making use of the primary keys of the main table. You can configure indexes from the Catalyst console. You can therefore use just the partition key or a combination of the partition key and sort key of the index to retrieve an item.

Note: Catalyst enables you to retrieve a maximum of 100 items in bulk from a NoSQL table with pagination from a single SDK operation.

You can define the key condition that identifies the item by specifying the attributes, their required values, and the supported operator to be used. Refer to the help section on a list of supported operators and help on querying from the Catalyst console.

To query the data with ZCNoSQLTable Instance, the below can be used.

    
copy
//public ZCNoSQLResponseBean queryIndex(Long indexID, ZCNoSQLPartitionKeyCondition partitionKeyCondition, boolean forwardScan, int limit) throws Exception; table.queryIndex(<indexID>, <ZCNoSQLPartitionKeyCondition>, <true/false>, <limit>);

To query with ZCNoSQLQueryHelper

ZCNoSQLQueryHelper

This class can be used to query data from the index and also specifiy other conditions, sorting order, limit etc. This can be obtained from ZCNoSQLTable instance.

    
copy
//public ZCNoSQLQueryHelper getQueryHelper(ZCNoSQLPartitionKeyCondition partitionKeyCondition, boolean forwardScan, int limit) throws Exception; //public ZCNoSQLResponseBean queryTable() throws Exception; table.getQueryHelper(<ZCNoSQLPartitionKeyCondition>, <true/false>, <limit>).queryIndex(<indexID>);

ZCNoSQLPartitionKeyCondition

The same Partition Key Condition described above can be reused here too. Other methods available in ZCNoSQLQueryHelper

Required Attributes

The same Required Attributes described above can be reused here too.

Consistence

Catalyst NoSQL also lets you define other elements of the query, such as using consistent_read to indicate if the read operation must be done using the master or a slave cluster, limiting the number of rows to be returned, and specifying the sorting order as ascending.

Note: In the master-slave replication, the master contains all the data of the database, and the slave contains copies from the master. Performing a read operation from the slave can reduce the overall cost with the trade-off being a minor delay in the updated data being reflected.

Secondary Key Condition

The same Secondary Key Condition described above can be reused here too with the exception that additionalSort key cannot be used for index

Other Conditions

The other conditions mentioned for querying tables can be reused here too.

Start Key

The same Start Key described above can be used here too.

Index Query with all combinations

    
copy
table.getQueryHelper(ZCNoSQLPartitionKeyCondition>, <true/false>, <limit>) .withSecondaryKSeyCondition(<ZCNoSQLSecondaryKeyCondition>, false) .withOtherCondition(<ZCNoSQLCondition>) .withRequiredAttributes(<List of ZCNoSQLAttributes>) .withConsistency(true/false) .withStartKey(<ZCNoSQLItem>) .queryIndex(<indexID>);

Last Updated 2025-06-20 16:21:48 +0530 +0530

ON THIS PAGE

RELATED LINKS

NoSQL NoSQL API