Search passages of documents.
このページの操作の説明は、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 |
パラメーター
| 名前 | 場所 | 型 | 必須 | 説明 |
|---|
limit | query | integer | 任意 | 既定値: 50; ≥ 1 |
cursor | query | string | 任意 | |
sort | query | string | 任意 | Comma-separated sort fields, - for descending. |
Docwize-Version | header | string (date) | 任意 | |
リクエスト本文
200 の本文
| フィールド | 型 | 必須 | 説明 |
|---|
items | Passage の配列 | 必須 | |
next_cursor | string または null | 必須 | |
warnings | object の配列 | 必須 | |
エラー
この操作が返す可能性のある problem のコードです。各コードからそのページに移動できます。
スキーマ
Passage
| フィールド | 型 | 必須 | 説明 |
|---|
distance | number または null | 必須 | How far the chunk's meaning is from the query's: smaller is nearer. Set by a meaning search. |
document_id | string | 必須 | |
end_offset | integer または null | 必須 | Where the chunk ends in the document's text; null for an exact search, and in get_passage and list_passages. |
highlights | PassageHighlight の配列 | 必須 | Snippets with the matched words marked; read with include highlights. |
page | integer または 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_id | string または null | 必須 | Names the chunk for get_passage and list_passages; null for an exact search, which finds whole document texts. |
score | number または null | 必須 | How well the text matches the query's words: larger is better. Set by an exact search. |
start_offset | integer または null | 必須 | Where the chunk starts in the document's text; null for an exact search, and in get_passage and list_passages. |
text | string または null | 必須 | The chunk's text; read with include text, get_passage and list_passages. |
PassageHighlight
| フィールド | 型 | 必須 | 説明 |
|---|
html | string | 必須 | The snippet, with the matched words in <span class="keyword">. |
| フィールド | 型 | 必須 | 説明 |
|---|
filter | object または 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. |
include | string の配列 | 任意 | 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. |
mode | string | 必須 | meaning (the chunks nearest the query's meaning) or exact (the document texts holding the query's words). |
query | string | 必須 | What to look for: a sentence for meaning, words for exact (words, "exact phrase", OR, -exclude). |