Add natural language search to your app using AI embeddings
myProducts
is the collection used to store product descriptions.
First, we need to populate the collection with items (for example, product
descriptions). You can insert individual or multiple items using the upsert
and upsertBatch
methods, respectively.
Use upsert
to insert a product description into the collection. If you don’t
specify a key, Modus generates a unique key for you.
collection
: the name of the collection.status
: the status of the operation.objects
: the search result items with their text, distance, and score
values.
distance
: a lower value indicates a closer match between the search query
and the item in the collectionscore
: a higher value (closer to 1) represents a better matchsearchByVector
API. Retrieve the vector associated with the given item by its key, then perform
a search using that vector.