Documents

Documents search returns documents that match a list of search criteria.

See Document for a service that returns full details of a single document.

Call

Call the service at dhinstance/seach/documents passing input parameters in the POST body.

Using curl as an example:

curl -X POST -H "Content-Type: application/json" --data @documents_search.json "dhinstance/search/documents"

The call with also require an authorization header to identify the instance user, who is then used as the instance uuid.

See Data loads for a definition of dhinstance.

Input

{
"filters": [
{
"dimension_reference": "textRef",
"dimension_type": "text",
"value": "value"
},
{
"dimension_reference": "dateRef",
"dimension_type": "dateRange",
"from": "yyyy-mm-dd",
"to": "yyyy-mm-dd"
}, ...
],
"latest": true|false,
"include_worker": true|false
}

The properties of the filter depend on the type of the dimension. For text dimensions, a value match is used. These values should match the value properties returned from the Dimension search, i.e. be normalized. For date dimensions, a from and to date are used. to is inclusive (i.e. the last date), and from and to are both optional.

The dimension reference identifies the dimension, which match the properties held in Insight Hub indexes. Available properties are listed in Index properties.

If latest is set to true, then only the document with the latest document received date for each document key is returned. This is typically used with a document_key search using a key with a wildcard. If you want to get the latest version of a single document, always use the single document search which is much more efficient for this purpose.

Workers are returned only if include_worker is true.

Output

{
"results": [
{
"document_uuid": "uuid",
...,
"worker": {
"worker_uuid": "uuid",
...
}
}, ... more documents ...
]
}

The response is a JSON object. The results property is an array of objects. Each object represents a document and associated worker. See Document data and Worker data for details.