configConnection
which will be used as part of the vector store configuration.
endpoint:
, you many provide property datacenterID:
and optionally regionName:
.
cosine
(the default), dot_product
, and euclidean
similarity search; this is defined when the
vector store is first created, and specifed in the constructor parameter vectorType
, for example:
WHERE
filtering without specifying
the partition key, and allow for additional operator types such as non-equalities. You can define these with the indices
parameter, which accepts zero or more dictionaries each containing name
and value
entries.
Indices are optional, though required if using filtered queries on non-partition columns.
name
entry is part of the object name; on a table named test_table
an index with name: "some_column"
would be idx_test_table_some_column
.value
entry is the column on which the index is created, surrounded by (
and )
. With the above column
some_column
it would be specified as value: "(some_column)"
.options
entry is a map passed to the WITH OPTIONS =
clause of the CREATE CUSTOM INDEX
statement.
The specific entries on this map are index type specific.=
. For those fields that have an indices
entry, you may
provide an operator
with a string of a value supported by the index; in this case, you specify one or
more filters, as either a singleton or in a list (which will be AND
-ed together). For example:
value
can be a single value or an array. If it is not an array, or there is only one element in value
,
the resulting query will be along the lines of ${name} ${operator} ?
with value
bound to the ?
.
If there is more than one element in the value
array, the number of unquoted ?
in name
are counted
and subtracted from the length of value
, and this number of ?
is put on the right side of the operator;
if there are more than one ?
then they will be encapsulated in (
and )
, e.g. (?, ?, ?)
.
This faciliates bind values on the left of the operator, which is useful for some functions; for example
a geo-distance filter:
userid
and collectionid
, with
additional fields docid
and docpart
making an individual entry unique:
indices
for these columns; you do
not need to specify all partition keys, but must specify those in the key first. In the above example, you could
specify a filter of {userid: userid_variable}
and {userid: userid_variable, collectionid: collectionid_variable}
,
but if you wanted to specify a filter of only {collectionid: collectionid_variable}
you would have to include
collectionid
on the indices
list.
Parameter | Usage |
---|---|
maxConcurrency | How many concurrent requests will be sent to Cassandra at a given time. |
batchSize | How many documents will be sent on a single request to Cassandra. When using a value > 1, you should ensure your batch size will not exceed the Cassandra parameter batch_size_fail_threshold_in_kb . Batches are unlogged. |
withClause | Cassandra tables may be created with an optional WITH clause; this is generally not needed but provided for completeness. |