Count what a search matches, and the facets of the matches.
Needs Search Document Metadata for total_count and View Search Facets for facets and facet_values, as the Portal's count and facet routes do. The Search app's total, filter panel and filter-list lookup for one query. query, weights, facet_filters, document_number_prefixes, reference_numbers, date_ranges and exclude_duplicates are the members of POST /documents/search that its Search app engine reads. include lists what to compute: total_count (the number of documents the caller can read that match), facets (the matches counted by each facet, the most frequent values first, and by month of the document date); both by default. facet_values asks for one facet's values containing a text, with the facet's own filter set aside so another value of the same list can be found. A facet value returned here is a value facet_filters takes. A large organisation's facets are estimated from a sample: is_approximate says so.
| |
|---|
| Scope | documents:search |
| Asynchronous | No |
| MCP tool | aggregate_documents |
| Company capability | search |
Parameters
| Name | In | Type | Required | Description |
|---|
Docwize-Version | header | string (date) | Optional | |
Request body
Responses
Errors
The problem codes this operation can answer with. Each code links to its page.
Schemas
| Field | Type | Required | Description |
|---|
contains | string or null | Optional | Only the values containing this text, ignoring case. |
facet | string | Required | The facet whose values to list: one of the names facet_filters takes. |
DocumentAggregate
| Field | Type | Required | Description |
|---|
document_date_months | array of FacetBucket | Required | The matches per month of their document date, value YYYY-MM, oldest first; empty when include leaves facets out. |
facet_values | FacetValues or null | Required | The facet_values asked for; null when none was. |
facets | array of FacetCounts | Required | The matches counted by each facet; empty when include leaves facets out. |
is_approximate | boolean or null | Required | The facet counts were estimated from a sample of a large organisation's documents and scaled up: a rare value may be missing. Null when facets were not computed. |
total_count | integer or null | Required | The documents the caller can read that match; null when include leaves it out. |
truncated_facets | array of string | Required | The facets that have more values than were listed. |
| Field | Type | Required | Description |
|---|
date_ranges | array of SearchDateRangeInput | Optional | Keep the documents whose dates fall in every range. |
document_number_prefixes | array of string | Optional | Keep the documents whose number starts with one of these, ignoring case. |
exclude_duplicates | boolean or null | Optional | Hide the documents that duplicate another document's number. |
facet_filters | array of SearchFacetFilterInput | Optional | Keep the documents whose folder, tag, location, file author and so on hold one of the values. The values are the ones POST /documents/aggregate lists. |
facet_values | AggregateFacetValuesInput or null | Optional | List the values of one facet that contain a text. |
include | array of string | Optional | What to compute: total_count, facets. Both when left out. |
query | string or null | Optional | Full text, as in POST /documents/search. |
reference_numbers | array of string | Optional | Keep the documents whose reference number contains one of these, ignoring case. |
weights | SearchWeightsInput or null | Optional | How much each field counts towards the score of a match of the query. 0 leaves a field out. |
FacetBucket
| Field | Type | Required | Description |
|---|
document_count | integer | Required | The matching documents that hold the value. ≥ -2147483648; ≤ 2147483647 |
value | string | Required | The value as facet_filters takes it. An empty string counts the documents with no value. |
FacetCounts
| Field | Type | Required | Description |
|---|
facet | string | Required | |
values | array of FacetBucket | Required | |
FacetValues
| Field | Type | Required | Description |
|---|
documents_without_value | integer | Required | The matching documents with no value, when the values were not narrowed to a text. ≥ -2147483648; ≤ 2147483647 |
facet | string | Required | |
is_approximate | boolean | Required | Counted on a sample of a large organisation's documents and scaled up. |
is_truncated | boolean | Required | More values than were listed exist: type more of the value to find it. |
values | array of FacetBucket | Required | The most frequent first; documents with no value are left out (see documents_without_value). |
| Field | Type | Required | Description |
|---|
field | string | Required | One of document_date, created_at, file_created_at, file_modified_at. |
from | string (date) or null | Optional | The first day; open when left out. |
to | string (date) or null | Optional | The last day; open when left out. |
| Field | Type | Required | Description |
|---|
facet | string | Required | One of document_type, document_sub_type, from, to, project, folder, location, tag, created_by, file_content_type, file_author, file_last_author, file_producer, file_title. |
values | array of SearchFacetValueInput | Required | Alternatives: a document is kept when its facet holds any of them. |
| Field | Type | Required | Description |
|---|
include_children | boolean | Optional | With match exact, also select the values under this one in a hierarchy (a folder's subfolders): the facet starts with the value, ignoring case. |
match | string or null | Optional | exact (the default: the facet equals the value) or contains (the facet contains the text, ignoring case). |
value | string | Required | A value as the facet lists it. An empty string selects the documents with no value. |
| Field | Type | Required | Description |
|---|
ccs | integer or null | Optional | |
content | integer or null | Optional | |
description | integer or null | Optional | |
document_number | integer or null | Optional | |
folders | integer or null | Optional | |
from | integer or null | Optional | |
other_number | integer or null | Optional | |
reference_number | integer or null | Optional | |
to | integer or null | Optional | |