Annotation Interface SaiIndexed


Identifies a Storage-Attached Indexing (SAI) index. You can create multiple secondary indexes on the same database table, with each SAI index based on any column in the table. All column date types except the following are supported for SAI indexes:
  • counter
  • non-frozen user-defined type (UDT)

The following columns of a Table type can be annotated with SaiIndexed:

  • Scalar data types
  • Frozen user-defined types
  • Collection types
  • Map type
  • Vector types

Map types distinguish between entry, key or value-level indexing.

 @Table
 class Person {

        Map<@SAIIndexed String, String> indexedKey; // allows CONTAINS KEY queries
        Map<String, @SAIIndexed String> indexedValue; // allows CONTAINS queries
 }
 
Since:
4.5
Author:
Mark Paluch
  • Optional Element Summary

    Optional Elements
    Modifier and Type
    Optional Element
    Description
    boolean
    When set to true, SAI converts alphabetic, numeric, and symbolic characters that are not in the Basic Latin Unicode block (the first 127 ASCII characters) to the ASCII equivalent, if one exists.
    boolean
    Enable case-sensitive matching.
    boolean
    When set to true, perform Unicode normalization on indexed strings.
    Vector search relies on computing the similarity or distance between vectors to identify relevant matches.
    The name of the index.
  • Element Details

    • value

      String value
      The name of the index. If null or empty, then the index name will be generated by Cassandra and will be unknown unless column metadata is used to discover the generated index name.
      Default:
      ""
    • caseSensitive

      boolean caseSensitive
      Enable case-sensitive matching.
      Default:
      true
    • normalize

      boolean normalize
      When set to true, perform Unicode normalization on indexed strings. SAI supports Normalization Form C (NFC) Unicode. When set to true, SAI normalizes the different versions of a given Unicode character to a single version, retaining all the marks and symbols in the index. For example, SAI would change the character Å (U+212B) to Å (U+00C5).
      Default:
      false
    • ascii

      boolean ascii
      When set to true, SAI converts alphabetic, numeric, and symbolic characters that are not in the Basic Latin Unicode block (the first 127 ASCII characters) to the ASCII equivalent, if one exists. For example, this option changes à to a.
      Default:
      false
    • similarityFunction

      SimilarityFunction similarityFunction
      Vector search relies on computing the similarity or distance between vectors to identify relevant matches. The similarity function is used to compute the similarity between two vectors. When using SAI indexes with vector data types, then only the similarity function is used with index options.
      Default:
      COSINE