-
Notifications
You must be signed in to change notification settings - Fork 60
Open
Description
I'm currently working on a hybrid search and want to filter out irrelevant results using the distance threshold parameter.
According to the Typesense docs (https://typesense.org/docs/29.0/api/vector-search.html#distance-threshold) you shouldn't need either the id parameter or a vector query.
However, if I try to create a VectorQuery using that above pattern, I get the validation error below
Line 89
typesense-dotnet/src/Typesense/VectorSearchQuery.cs
Lines 80 to 103 in f524cad
| public VectorQuery(float[] vector, string vectorFieldName, string? id = null, int? k = null, int? flatSearchCutoff = null, Dictionary<string, string>? extraParams = null, decimal? distanceThreshold = null) | |
| { | |
| ArgumentNullException.ThrowIfNull(vector); | |
| if (vector.Length > 0 && id != null) | |
| throw new ArgumentException( | |
| "Malformed vector query string: cannot pass both vector query and `id` parameter."); | |
| if (vector.Length == 0 && id is null) | |
| throw new ArgumentException("When a vector query value is empty, an `id` parameter must be present."); | |
| if (string.IsNullOrWhiteSpace(vectorFieldName)) | |
| throw new ArgumentException( | |
| "The vector fieldname cannot be null or whitespace.", | |
| nameof(vectorFieldName)); | |
| _vector = vector; | |
| VectorFieldName = vectorFieldName; | |
| Id = id; | |
| K = k; | |
| DistanceThreshold = distanceThreshold; | |
| FlatSearchCutoff = flatSearchCutoff; | |
| ExtraParams = extraParams ?? new(); | |
| } |
Is this behavior intended?
Metadata
Metadata
Assignees
Labels
No labels