Search collection
POST/api/v1/collections/:collection-id/search
Perform a search in a collection.
Request
Path Parameters
collection-id stringrequired
Collection ID
- application/json
Body
text stringrequired
Search query text
labels array[]nullable
Possible values: >= 2
, <= 2
top_k number
Default value: 5
Maximum number of search results
Responses
- 200
- 401
- 403
- 404
Successful response
- application/json
- Schema
- Example (from schema)
Schema
Array [
]
result
object[]
required
Search results consisting of chunks
id stringrequired
Chunk ID
content stringrequired
Chunk content in plain text
file_id stringrequired
File ID which the chunk is part of
distance numberrequired
A value representing a similarity distance between query and result, smaller values means more similar.
score numbernullable
{
"result": [
{
"id": "string",
"content": "string",
"file_id": "string",
"distance": 0,
"score": 0
}
]
}
Unauthorized
- application/json
- Schema
- Example (from schema)
Schema
error
object
required
message stringrequired
Human readable error message
data nullable
Further details on the error
{
"error": {
"message": "string"
}
}
Forbidden
- application/json
- Schema
- Example (from schema)
Schema
error
object
required
message stringrequired
Human readable error message
data nullable
Further details on the error
{
"error": {
"message": "string"
}
}
Not found
- application/json
- Schema
- Example (from schema)
Schema
error
object
required
message stringrequired
Human readable error message
data nullable
Further details on the error
{
"error": {
"message": "string"
}
}
Loading...