Restricted query routing 

For expert users only, restricted query routing supports restricting common queries to a single partition.

DSE Search restricted query routing is designed for applications that have a data model that supports restricting common queries to a single partition. This feature is for use by experts only and should be used with care. You can restrict queries based on a list of partition keys to a limited number of nodes. You can also restrict queries based on a single token range. Use token range routing only if you thoroughly understand cluster token placement.

Partition key routing

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 Solr 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

Or, in CQL:

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

Token range routing

For simplicity, routing queries by partition range is recommended over 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.