Restricted query routing

This feature is for experts only and should be used with care.

DSE Search restricted query routing is designed for applications that have a data model that supports restricting common queries to a single partition.

route.partition and route.range filter only which endpoints to query.

To restrict queries to a token or partition, use the CQL solr_query instead.

For example:

SELECT aid, bkt, ts, rid, mt FROM tt.accounttransactions WHERE aid=1096 AND bkt=0 AND solr_query='
{"q":"*:*", "sort":"ts asc"}'

to filter:

';"

Partition key routing

You can restrict routing queries to a limited number of nodes based on a list of partition keys. You can also restrict queries based on a single token range. To specify routing by partition keys, use the route.partition query parameter and set its value to one or more partition keys. DSE Search queries only the nodes that own the given partition keys. The vertical line delimiter separates components of a composite key. The comma delimiter separates different partition keys.

For example:

route.partition=k1c1|k1c2,k2c1|k2c2 . . .

If the actual partition key value contains a delimiter character, use a backslash character to escape the delimiter.

Examples

You can route Solr HTTP API and CQL queries. This example shows how to use the route queries on a table with a composite partition key, where "nike" and "2" are composite key parts.

http://localhost:8983/solr/test.route/select?q=*:*&indent=true&shards.info=true&route.partition=nike|2,reebok|2

In CQL:

SELECT * FROM test.route WHERE solr_query='{"q" : "*:*", "route.partition" : ["nike|2","reebok|2"]}'

Token range routing

Only use token range routing if you thoroughly understand cluster token placement. For simplicity, DataStax recommends routing queries by partition range instead of routing by token range. To specify routing by token range, use the route.range query parameter and set its value to the two token values that represent the range, separated by comma.

For example:

route.range=t1,t2

DSE Search queries only the nodes in the given token range.

Was this helpful?

Give Feedback

How can we improve the documentation?

© 2024 DataStax | Privacy policy | Terms of use

Apache, Apache Cassandra, Cassandra, Apache Tomcat, Tomcat, Apache Lucene, Apache Solr, Apache Hadoop, Hadoop, Apache Pulsar, Pulsar, Apache Spark, Spark, Apache TinkerPop, TinkerPop, Apache Kafka and Kafka are either registered trademarks or trademarks of the Apache Software Foundation or its subsidiaries in Canada, the United States and/or other countries. Kubernetes is the registered trademark of the Linux Foundation.

General Inquiries: +1 (650) 389-6000, info@datastax.com