Document

Searches Documents in a DocumentCollection

POST
Searches over documents in a collection based on provided search criteria. One of text or metadata must be provided. Returns an empty list if no documents are found.

Path parameters

collectionNamestringRequired
Name of the Document Collection

Query parameters

limitintegerOptional
Limit the number of returned documents

Request

This endpoint expects an object.
metadata
map from strings to anyOptional
Document metadata to filter on.
min_score
doubleOptional
mmr_lambda
doubleOptional
The lambda parameter for the MMR Reranking Algorithm.
search_type
enumOptional
The type of search to perform. Defaults to "similarity". Must be one of "similarity" or "mmr".
Allowed values: similaritymmr
text
stringOptional
The search text.

Response

This endpoint returns an object
current_page
integerOptional
query_vector
list of doublesOptional
result_count
integerOptional
results
list of objectsOptional
total_pages
integerOptional

Errors

POST
1curl -X POST https://api.getzep.com/api/v2/collections/collectionName/search \
2 -H "Authorization: Api-Key <apiKey>" \
3 -H "Content-Type: application/json" \
4 -d '{}'
1{
2 "current_page": 1,
3 "query_vector": [
4 1.1
5 ],
6 "result_count": 1,
7 "results": [
8 {
9 "content": "content",
10 "created_at": "created_at",
11 "document_id": "document_id",
12 "embedding": [
13 1.1
14 ],
15 "is_embedded": true,
16 "score": 1.1,
17 "updated_at": "updated_at",
18 "uuid": "uuid"
19 }
20 ],
21 "total_pages": 1
22}