Accept the null JSON value as the value of _vectors

This commit is contained in:
Kerollmops 2023-08-14 16:03:55 +02:00
parent ef3d098b4d
commit c53841e166
No known key found for this signature in database
GPG key ID: 92ADA4E935E71FA4
3 changed files with 16 additions and 13 deletions

View file

@ -666,6 +666,7 @@ fn compute_semantic_score(query: &[f32], vectors: Value) -> milli::Result<Option
.map_err(InternalError::SerdeJson)?;
Ok(vectors
.into_iter()
.flatten()
.map(|v| OrderedFloat(dot_product_similarity(query, &v)))
.max()
.map(OrderedFloat::into_inner))