curl --request POST \
--url https://{cluster}.cognitedata.com/api/v1/projects/{project}/documents/passages/search \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"filter": {
"and": [
{
"prefix": {
"property": [
"name"
],
"value": "Report"
}
},
{
"equals": {
"property": [
"type"
],
"value": "PDF"
}
}
]
},
"expansionStrategy": {
"strategy": "symmetric",
"chunk_count": 2
},
"limit": 10
}
'{
"items": [
{
"text": "Pump installation\nFollow these 15 steps:\n ...",
"document": {
"id": 1234
},
"locations": [
{
"page_number": 3,
"left": 68.78,
"right": 478.56,
"top": 75.04,
"bottom": 386.1
},
{
"page_number": 4,
"left": 68.78,
"right": 478.56,
"top": 75.04,
"bottom": 386.1
}
]
}
]
}curl --request POST \
--url https://{cluster}.cognitedata.com/api/v1/projects/{project}/documents/passages/search \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"filter": {
"and": [
{
"prefix": {
"property": [
"name"
],
"value": "Report"
}
},
{
"equals": {
"property": [
"type"
],
"value": "PDF"
}
}
]
},
"expansionStrategy": {
"strategy": "symmetric",
"chunk_count": 2
},
"limit": 10
}
'{
"items": [
{
"text": "Pump installation\nFollow these 15 steps:\n ...",
"document": {
"id": 1234
},
"locations": [
{
"page_number": 3,
"left": 68.78,
"right": 478.56,
"top": 75.04,
"bottom": 386.1
},
{
"page_number": 4,
"left": 68.78,
"right": 478.56,
"top": 75.04,
"bottom": 386.1
}
]
}
]
}Access token issued by the CDF project's configured identity provider. Access token must be an OpenID Connect token, and the project must be configured to accept OpenID Connect tokens. Use a header key of 'Authorization' with a value of 'Bearer $accesstoken'. The token can be obtained through any flow supported by the identity provider.
Fields to be set for the search request.
Narrow down search results. You must specify atleast one filter of type semanticSearch, lexicalSearch or both.
A query that matches items matching boolean combinations of other queries.
Currently only supports and clause.
Show child attributes
A expansion strategy to to increase the text view for each passage returned. Helpful to increase context for an LLM.
Show child attributes
Maximum number of items.
1 <= x <= 10List of most relevant document passages for a given query. The results are sorted by relevance, and contains metadata such as page numbers.
Show child attributes
Was this page helpful?