Find text in parsed task source content¶
Find text in parsed source content within a task.
POST https://api.moi.matrixorigin.cn/v5/semantic-models/runtime/search-document
Before you call this API¶
Use only the injected service address, technical credentials, workspace, and short-lived authorization in the current task environment. Preserve the original authorization header. An ordinary PAT neither replaces task identity nor establishes authorization. Examples use jq. See common information for variables, objects, and states.
Request body¶
curl -X POST "${MOI_ENDPOINT%/}/semantic-models/runtime/search-document" \
-H "X-API-Key: $MOI_API_KEY" \
-H "X-Workspace-ID: $MOI_WORKSPACE_ID" \
-H "X-MOI-Runtime-Authorization: $MOI_RUNTIME_AUTHORIZATION" \
-H 'Content-Type: application/json' \
--data-binary "$(jq -n --arg REQUEST_ID "$REQUEST_ID" --arg MARKDOWN_FILE_ID "$MARKDOWN_FILE_ID" --arg KNOWLEDGE_QUERY "$KNOWLEDGE_QUERY" '
{
"request_id": $REQUEST_ID,
"markdown_file_id": $MARKDOWN_FILE_ID,
"query": $KNOWLEDGE_QUERY,
"max_matches": 5,
"context_chars": 600
}
')"
Find literal text in the current effective source projection, without semantic retrieval. total_matches is the total match count; truncated indicates incomplete returned snippets.
Field |
Type |
Required |
Description |
|---|---|---|---|
|
string |
Yes |
Unique operation ID, 1–256 bytes, without leading/trailing whitespace or an audit: prefix. Retain it when replaying identical input. |
|
string |
Yes |
Markdown location ID from the original evidence. |
|
string |
Yes |
Nonempty query text. |
|
integer |
No |
Nonpositive/omitted uses 5; maximum 20. |
|
integer |
No |
Nonpositive/omitted uses 600; maximum 2000. |
Successful response¶
{
"code": "OK",
"msg": "OK",
"data": {
"call_id": "request_example",
"output": {
"markdown_file_id": "markdown_example",
"file_name": "example.md",
"query": "example",
"total_chars": 0,
"matches": [],
"total_matches": 0,
"truncated": false,
"metadata": {}
}
}
}
Field |
Type |
Description |
|---|---|---|
|
string |
OK on success. |
|
string |
Response description. |
|
string |
Corresponding original request_id. |
|
boolean |
true indicates business failure; false may be omitted. |
|
object |
Current operation result. |
|
object (array of objects) |
Original artifacts and evidence from the same task. |
|
object |
Operation metadata, when present. |
|
string |
Raw value returned by the current operation; retain according to common objects. |
|
string |
Raw value returned by the current operation; retain according to common objects. |
|
string |
Raw value returned by the current operation; retain according to common objects. |
|
integer |
Raw value returned by the current operation; retain according to common objects. |
|
array |
Returned match positions and context snippets. |
|
integer |
Total matches in the original content. |
|
boolean |
Whether current results are truncated. |
|
object |
Raw value returned by the current operation; retain according to common objects. |
Error responses¶
Handle HTTP status, business results, and error fields. See errors and environments. On source/version conflicts, read current state rather than automatically replacing identities, resources, or request IDs and retrying.