Annotation Type DynamoDbSearchVectorsHashKey


@SdkPublicApi @Target(METHOD) @Retention(RUNTIME) public @interface DynamoDbSearchVectorsHashKey
Denotes a HASH partition key in the SearchSchema for one or more vector indexes. The annotated attribute will be used as the partition key for scoping vector searches via SearchConditionExpression.

Each vector index requires exactly one HASH element in its SearchSchema. Only the equality (=) operator is supported for HASH attributes in SearchConditionExpression.

You must specify at least one index name. The index names must match those specified in corresponding DynamoDbVectorAttribute annotations.

Example usage:


 @DynamoDbBean
 public class Product {
     @DynamoDbSearchVectorsHashKey(indexNames = {"product-embedding-index"})
     public String getCategory() { return category; }

     @DynamoDbVectorAttribute(
         indexName = "product-embedding-index",
         dimensions = 1536,
         distanceFunction = DistanceFunction.COSINE)
     public List<Float> getProductEmbedding() { return productEmbedding; }
 }
 
  • Required Element Summary

    Required Elements
    Modifier and Type
    Required Element
    Description
    The names of one or more vector indexes that this HASH key should participate in.
  • Element Details

    • indexNames

      String[] indexNames
      The names of one or more vector indexes that this HASH key should participate in.