Searching Vectors
These operations allow you to search for vectors in Helix. Searching is done using cosine similarity.
SearchV
Search for vectors in your graph.
Example:
In schema.hx:
In query.hx:
Note:
Currently, we only support using an array of F64
values to represent the vector.
We will be adding support for different types such as F32
, binary vectors and
more in the very near future. Please reach out to us if you need a different vector type.
Prefiltering
You can prefilter the results of a search by adding a PREFILTER
clause to the query.
The condition in the PREFILTER
step must evaluate to a boolean value.
Example:
The condition is applied through out the search process. At each step, when the HNSW algorithm looks at the nearest neighbors, it will only consider nodes that satisfy the condition. This means that the final results have only been influenced by other vectors that satisfy the condition.
Postfiltering
You can postfilter the results of a search by adding a WHERE
clause to the query.
The condition in the WHERE
step must evaluate to a boolean value.
Example:
The condition is applied after the search has been completed.