Reference
Use our SDK for querying your datasets
Install the dataset SDK:
Quickstart
Import the dataset SDK and create the client.
Create a dataset object and run insert documents and search.
Methods
createIfNotExist
The createIfNotExist
method is used to create a dataset if it doesn’t exist.
recreateIfExists
The recreateIfExists
method is used to recreate a dataset if it exists.
insertDocuments
The insertDocuments
method is used to insert documents into the dataset. It takes in a list of documents and a list of vectorization options.
search
The search
method is used to search the dataset. It takes in a query builder object.
updateDocuments
The updateDocuments
method is used to update documents in the dataset. It takes in a list of documents.
updateDocumentsWhere
The updateDocumentsWhere
method is used to update documents in the dataset based on a filter. It takes in a filter and a list of documents.
getDocument
The getDocument
method is used to get a document from the dataset. It takes in a document id.
deleteDocument
The deleteDocument
method is used to delete a document from the dataset. It takes in a document id.
deleteDocumentsWhere
The deleteDocumentsWhere
method is used to delete documents from the dataset based on a filter. It takes in a filter.
QueryBuilder
The query builder is used to construct queries for searching the dataset. It is a chainable API that allows you to build complex queries with a simple syntax.
To use it, start with QueryBuilder()
and chain it with the following methods to generate the query.
Vector
The vector
method is used to search for documents based on a vector. It takes in a field name and a vector object.
Example:
Sort
The sort
method is used to sort the results based on a field. It takes in a field name and a sort order.
Example:
Page
The page
method is used to paginate the results. It takes in a page number.
Example:
Page size
The pageSize
method is used to set the page size. It takes in a page size.
Example:
Include fields
The includeFields
method is used to include fields in the results. It takes in a list of field names.
Example:
Was this page helpful?