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

Search passages of documents.

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

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

The clustering app's fragment search, passages only: the topic clustering and the paid LLM answer the Portal queues after every search are not run (create_passage_clustering and create_passage_answer ask for them). mode meaning finds the chunks nearest the query's meaning (needs the organisation's document embeddings), best first, each with its start_offset and end_offset in the document's text and its distance (smaller is nearer); mode exact finds the document texts holding the query's words (words, "exact phrase", OR, -exclude), best score first, each with its score. filter is a tree of and, or, not and {field, op, value} leaves over the document fields the clustering app's filter builder offers (document_number, document_date, document_type, project, description, image_type, main_document_number, created_by, from_organisation, folder, tag) and custom_field.<custom_field_id> for a register column, ops eq, ne, in, gt, gte, lt, lte, contains, starts_with, ends_with; a passage whose document has no value for the field is not matched by ne or not. include adds text and page (meaning) or highlights (exact: HTML with the matched words in <span class="keyword">). Only passages of documents the caller can read are found. Needs View Document Text, and Search Semantic for mode meaning or Search Full Text for mode exact; include text needs View Search Fragments and include highlights View Search Highlights. Page through the results with cursor.

スコープdocuments:search
非同期いいえ
MCP ツールsearch_passages
Portal の権限view_document_text
ページングsnapshot
既定の並び順-relevance
並べ替えに使えるフィールドrelevance

パラメーター​

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

リクエスト本文​

Content-Type型
application/jsonPassageSearchInput

応答​

ステータス説明本文
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, validation_failedapplication/problem+json Problem
500internal_errorapplication/problem+json Problem
503tenant_unavailable, unavailableapplication/problem+json Problem
504timeoutapplication/problem+json Problem

200 の本文​

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

エラー​

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

スキーマ​

Passage​

フィールド型必須説明
distancenumber または null必須How far the chunk's meaning is from the query's: smaller is nearer. Set by a meaning search.
document_idstring必須
end_offsetinteger または null必須Where the chunk ends in the document's text; null for an exact search, and in get_passage and list_passages.
highlightsPassageHighlight の配列必須Snippets with the matched words marked; read with include highlights.
pageinteger または null必須The page of the document the chunk starts on (0 when the document has no pages); read with include text, get_passage and list_passages.
passage_idstring または null必須Names the chunk for get_passage and list_passages; null for an exact search, which finds whole document texts.
scorenumber または null必須How well the text matches the query's words: larger is better. Set by an exact search.
start_offsetinteger または null必須Where the chunk starts in the document's text; null for an exact search, and in get_passage and list_passages.
textstring または null必須The chunk's text; read with include text, get_passage and list_passages.

PassageHighlight​

フィールド型必須説明
htmlstring必須The snippet, with the matched words in <span class="keyword">.

PassageSearchInput​

フィールド型必須説明
filterobject または null任意A tree of and, or, not and {field, op, value} leaves: the fields document_number, document_date, document_type, project, description, image_type, main_document_number, created_by, from_organisation, folder and tag, or custom_field.<custom_field_id> for a register column; ops eq, ne, in, gt, gte, lt, lte, contains, starts_with, ends_with.
includestring の配列任意What to read for each passage: text (the chunk's text and page; meaning mode) or highlights (snippets with the matched words marked; exact mode). Neither when left out.
modestring必須meaning (the chunks nearest the query's meaning) or exact (the document texts holding the query's words).
querystring必須What to look for: a sentence for meaning, words for exact (words, "exact phrase", OR, -exclude).