This endpoint lets you search for relevant parts (passages) of up to 100 PDF documents by using advanced filters and semantic search queries.
For each query you have to specify a list of document ids using the in
filter (see exmple).
This endpoint has been deprecated in favor of /documents/passages/search
which is now in GA. Please consider moving over.
Fields to be set for the search request.
List of most relevant document passages for a given query. The results are sorted by relevance, and contains metadata such as page numbers.
The response for a failed request.
{- "filter": {
- "and": [
- {
- "prefix": {
- "property": [
- "name"
], - "value": "Report"
}
}, - {
- "equals": {
- "property": [
- "type"
], - "value": "PDF"
}
}
]
}, - "expansionStrategy": {
- "strategy": "symmetric",
- "chunk_count": 1
}, - "limit": 10
}
{- "items": [
- {
- "match": {
- "text": "Pump installation\nFollow these 15 steps:\n ...",
- "location": [
- {
- "page": 7,
- "left": 68.78,
- "right": 478.56,
- "top": 75.04,
- "bottom": 386.1
}
]
}, - "item": {
- "id": 2384,
- "externalId": "haml001",
- "instanceId": {
- "space": "string",
- "externalId": "string"
}, - "title": "Hamlet",
- "author": "William Shakespeare",
- "producer": "string",
- "createdTime": 1519862400000,
- "modifiedTime": 1519958703000,
- "lastIndexedTime": 1521062805000,
- "mimeType": "text/plain",
- "extension": "pdf",
- "pageCount": 2,
- "type": "Document",
- "language": "en",
- "truncatedContent": "ACT I\nSCENE I. Elsinore. A platform before the castle.\n FRANCISCO at his post. Enter to him BERNARDO\nBERNARDO\n Who's there?\n",
- "assetIds": [
- 42,
- 101
], - "labels": [
- {
- "externalId": "my.known.id"
}
], - "sourceFile": {
- "name": "hamlet.txt",
- "directory": "plays/shakespeare",
- "source": "SubsurfaceConnectors",
- "mimeType": "application/octet-stream",
- "size": 1000,
- "hash": "23203f9264161714cdb8d2f474b9b641e6a735f8cea4098c40a3cab8743bd749",
- "assetIds": [ ],
- "labels": [
- {
- "externalId": "my.known.id"
}
], - "geoLocation": {
- "type": "Point",
- "coordinates": [
- 10.74609,
- 59.91273
]
}, - "datasetId": 1,
- "securityCategories": [ ],
- "metadata": {
- "property1": "string",
- "property2": "string"
}
}, - "geoLocation": {
- "type": "Point",
- "coordinates": [
- 10.74609,
- 59.91273
]
}
}
}
]
}