メインコンテンツまでスキップ

Search documents.

POST/api/v1/documents/searchdocuments:search
注記

このページの操作の説明は、API の OpenAPI 文書のとおり英語で記載しています。

Searches the documents the caller can read, as the Portal's Search app or by precise filters. query is full text (words are ANDed, OR, "exact phrase", -exclude). Two engines answer, chosen by the members sent. The precise engine reads meaning (a search by meaning; needs the organisation's document embeddings) and filter (a tree of and, or, not and {field, op, value} leaves over the document fields, ops eq, ne, in, gt, gte, lt, lte, contains, starts_with, is_null; lookup-backed fields are named <field>_id). The Search app's engine reads weights, facet_filters (folder, tag, location, document type, from, to, project, file author and so on), document_number_prefixes, reference_numbers, date_ranges (document, entry and file dates), exclude_duplicates and highlight (passages with their pages). One search cannot hold members of both. Each hit carries its score. Relevance pages by the engine's order; sort=document_id orders by document ID.

filter と meaning は、すべての会社で利用できるわけではありません。利用できない会社でこれらを使って呼び出すと、422 の unsupported_for_tenant で拒否されます。ただし、検索アプリのエンジンが読むメンバーも同時に送った場合は、422 の validation_failed で拒否されます。

スコープdocuments:search
非同期いいえ
MCP ツールsearch_documents
Portal の権限search_documents
会社に必要な機能search
ページングsnapshot
既定の並び順-relevance, document_id
並べ替えに使えるフィールドrelevance, document_id

パラメーター​

名前場所型必須説明
limitqueryinteger任意既定値: 50; ≥ 1
cursorquerystring任意
sortquerystring任意Comma-separated sort fields, - for descending.
Docwize-Versionheaderstring (date)任意

リクエスト本文​

Content-Type型
application/jsonDocumentSearchInput

応答​

ステータス説明本文
200Success.application/json object
400invalid_version, malformed_jsonapplication/problem+json Problem
401token_expired, unauthenticatedapplication/problem+json Problem
403forbidden, insufficient_scope, token_owner_inactiveapplication/problem+json Problem
405method_not_allowedapplication/problem+json Problem
406not_acceptableapplication/problem+json Problem
410cursor_expiredapplication/problem+json Problem
413payload_too_largeapplication/problem+json Problem
415unsupported_media_typeapplication/problem+json Problem
421wrong_regionapplication/problem+json Problem
422invalid_cursor, unsupported_for_tenant, validation_failedapplication/problem+json Problem
500internal_errorapplication/problem+json Problem
503tenant_unavailable, unavailableapplication/problem+json Problem
504timeoutapplication/problem+json Problem

200 の本文​

フィールド型必須説明
itemsDocumentSearchHit の配列必須
next_cursorstring または null必須
warningsobject の配列必須

エラー​

この操作が返す可能性のある problem のコードです。各コードからそのページに移動できます。

スキーマ​

AdditionalField​

フィールド型必須説明
labelstring または null必須
valuestring または null必須

AdditionalFields​

フィールド型必須説明
additional_field_3AdditionalField必須
additional_field_4AdditionalField必須
additional_field_5AdditionalField必須
additional_field_6AdditionalField必須

CarbonCopy​

フィールド型必須説明
cc_idstring必須
contactobject または null必須The contact of the organisation the copy names; null for the organisation on its own.
organisationobject または null必須

DocumentFile​

フィールド型必須説明
content_typestring または null必須
file_hashstring または null必須The hash the Portal stored for the file's content; null when none was recorded.
file_namestring必須
has_pdfboolean必須Whether a PDF rendition of the file is ready (an Office file converts on demand, so false only means not yet).
is_indexedboolean必須Whether the file's text has been indexed for search.
page_countinteger または null必須The pages the file has, once the Portal has counted them; null before.
size_bytesstring または null必須
version_idstring必須

DocumentFolder​

フィールド型必須説明
folder_idstring必須
pathstring または null必須

DocumentSearchHit​

フィールド型必須説明
actual_submission_datestring または null必須
additional_fieldsAdditionalFields必須
attachment_statestring または null必須none, has_attachments or is_attachment (the document is an attachment of another); null unless include names attachment_state.
carbon_copiesCarbonCopy の配列必須The organisations and contacts the document is copied to; empty unless include names carbon_copies.
created_atstring (date-time) または null必須
created_byUserRef または null必須
descriptionstring または null必須
document_datestring または null必須
document_idstring必須
document_numberstring または null必須
document_statusobject または null必須The status shown as Status in the Portal (lookup_actionstatus).
document_sub_typeobject または null必須
document_typeobject または null必須
duplicate_ofstring または null必須The number of the document this one duplicates (the Portal's Duplicate Of).
fileDocumentFile または null必須The current file (name, type, size), as GET /documents/{document_id} shows it; null when the document has none or include leaves file out.
foldersDocumentFolder の配列必須The folders the document is filed in that the caller can see, as GET /documents/{document_id} lists them; empty unless include names folders.
from_contactobject または null必須
from_organisationobject または null必須
highlightsSearchHighlight の配列必須Passages that matched the query, with their pages; empty unless the search asked for highlight, and for the precise engine (filter, meaning).
is_latest_revisionboolean必須
is_lockedboolean必須
is_privilegedboolean必須
locationsSearchHitLocation の配列必須The locations the document is filed in; empty unless include names locations.
main_document_datestring または null必須
ownerUserRef または null必須
page_endnumber または null必須Last page of the range this document covers in its file.
page_startnumber または null必須First page of the range this document covers in its file.
post_review_statusobject または null必須
projectobject または null必須The stored project number text, with the project's ID when one matches.
project_organisationobject または null必須
reference_numberstring または null必須
relevancenumber または null必須1 is relevant (the default), 0 is irrelevant (the Portal's Irrelevant switch).
responded_withstring または null必須The reference of the document that responded to this one (the Portal's Responded With).
response_datestring または null必須
response_due_datestring または null必須
revision_numberstring または null必須
scorenumber必須How well the document matches the query, higher first. 0 when the search has no query.
tagsSearchHitTag の配列必須The document's tags that are open to the caller; empty unless include names tags.
to_contactobject または null必須
to_organisationobject または null必須

DocumentSearchInput​

フィールド型必須説明
date_rangesSearchDateRangeInput の配列任意Keep the documents whose dates fall in every range.
document_number_prefixesstring の配列任意Keep the documents whose number starts with one of these, ignoring case.
exclude_duplicatesboolean または null任意Hide the documents that duplicate another document's number.
facet_filtersSearchFacetFilterInput の配列任意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.
filterobject または null任意A tree of and, or, not and {field, op, value} leaves over the document fields (precise engine).
highlightSearchHighlightOptionsInput または null任意Return the passages of each hit that hold the query's words, with their pages (Search app's engine).
includestring の配列任意Columns to add to each hit, as the Search app's results grid shows them: folders, tags, locations, carbon_copies, attachment_state, file. None when left out.
meaningstring または null任意A search by meaning (needs the organisation's document embeddings; precise engine).
querystring または null任意Full text: words are ANDed; OR, "exact phrase" and -exclude work. The Search app's engine also reads parentheses, NOT, AND, a trailing * and field:term, and matches the fields weights names, not only the content.
reference_numbersstring の配列任意Keep the documents whose reference number contains one of these, ignoring case.
weightsSearchWeightsInput または null任意How much each field counts towards the score of a match of the query. 0 leaves a field out.

SearchDateRangeInput​

フィールド型必須説明
fieldstring必須One of document_date, created_at, file_created_at, file_modified_at.
fromstring (date) または null任意The first day; open when left out.
tostring (date) または null任意The last day; open when left out.

SearchFacetFilterInput​

フィールド型必須説明
facetstring必須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.
valuesSearchFacetValueInput の配列必須Alternatives: a document is kept when its facet holds any of them.

SearchFacetValueInput​

フィールド型必須説明
include_childrenboolean任意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.
matchstring または null任意exact (the default: the facet equals the value) or contains (the facet contains the text, ignoring case).
valuestring必須A value as the facet lists it. An empty string selects the documents with no value.

SearchHighlight​

フィールド型必須説明
fieldstring必須The field the passage comes from: content, document_number, description, reference_number, from, to, ccs, other_number or folders.
htmlstring必須The passage with the matched words in <b>; everything else is HTML-escaped.
pageinteger または null必須The 1-based page of the document the passage is on; null when the text has no pages.

SearchHighlightOptionsInput​

フィールド型必須説明
fragment_sizeinteger または null任意Characters per passage, 20 to 2000 (default 150).
fragmentsinteger または null任意Passages per field and hit, 1 to 20 (default 3).

SearchHitLocation​

フィールド型必須説明
location_idstring必須
pathstring または null必須

SearchHitTag​

フィールド型必須説明
namestring必須
tag_idstring必須

SearchWeightsInput​

フィールド型必須説明
ccsinteger または null任意
contentinteger または null任意
descriptioninteger または null任意
document_numberinteger または null任意
foldersinteger または null任意
frominteger または null任意
other_numberinteger または null任意
reference_numberinteger または null任意
tointeger または null任意

UserRef​

フィールド型必須説明
display_namestring必須
kindstring: user, system, integration または string必須
user_idstring または null必須