Vector Search
Being a vector database, Orama allows you to perform vector search natively.
To perform search through vectors, you need to correctly configure your Orama schema, as described in the create page.
Performing Vector Search
To perform vector search, you will need to use the same search
method you’re already using for full-text and hybrid search, which can be imported from @orama/orama
:
The key differences between running vector search and full-text search are:
- Instead of searching for a
term
, you will need to provide avector
object to search. - You will need to specify the vector property you want to search on.
- At the time of writing, you can only search through one vector property at a time. If you think that this is too limiting, please open a feature request to support multiple vector properties at search-time.
Let’s see a full example of how to perform vector search:
The returning object will be exactly the same as the one we would expect when performing full-text search:
Since vectors can be quite large, you can also choose to not include them in the response by setting includeVectors
to false
(default behavior).