Package com.redis.vl.query
Class Vector.Builder
java.lang.Object
com.redis.vl.query.Vector.Builder
- Enclosing class:
Vector
Builder for creating Vector instances.
-
Method Details
-
vector
Set the query vector.- Parameters:
vector- Query vector for similarity search- Returns:
- This builder
-
fieldName
Set the vector field name to search.- Parameters:
fieldName- Name of the vector field- Returns:
- This builder
-
dtype
Set the vector data type.Supported types: BFLOAT16, FLOAT16, FLOAT32, FLOAT64, INT8, UINT8 (case-insensitive)
- Parameters:
dtype- Vector data type- Returns:
- This builder
-
weight
Set the weight for this vector in multi-vector scoring.The final score will be a weighted combination: w_1 * score_1 + w_2 * score_2 + ...
- Parameters:
weight- Weight value (must be positive)- Returns:
- This builder
-
build
Build the Vector instance.- Returns:
- Configured Vector
- Throws:
IllegalArgumentException- if vector or fieldName is null/empty, dtype is invalid, or weight is non-positive
-