Search vector contains invalid values
TL;DR — your SearchVector parameter is the wrong shape. Stored embeddings live inside an L attribute, but the query parameter is a bare array of {"N": …} values. Unwrap the L, and make sure every element is a plain number.
What it means
ValidationException: Search vector contains invalid values. All values in the search vector must be a 32-bit floating-point number attributeThat is the verbatim service response we captured in us-east-1 by wrapping the query vector in DynamoDB's L type. SearchVectors refuses the request before touching the index.
Why it happens
The wire format is asymmetric, and nearly everyone hits this once. An embedding stored on an item is a List attribute:
{"embedding": {"L": [{"N": "0.0132"}, {"N": "-0.0475"}]}}The SearchVector request parameter is not. It is a bare JSON array of number values:
[{"N": "0.0132"}, {"N": "-0.0475"}]Send the stored shape as the query shape and you get this error. It also fires when an element inside the array is a string, boolean, or nested structure rather than an N value.
How to fix it
Pass the array directly. With the CLI, the file://query-vector.json payload is the bare array; in the SDKs, build SearchVector as a list of AttributeValue numbers, not one L value. If you reuse the marshalling helper that produced the stored attribute, unwrap its output before querying.
Dimension count is checked separately, so an unwrapped vector of the wrong length fails with a different message: Invalid size for parameter.
Related
How the query side works end to end, with a live-measured cost model: the DynamoDB vector search guide.