From ff4239c7cf66fe4e60dc36b3ffa35f81074a3dae Mon Sep 17 00:00:00 2001 From: writinwaters <93570324+writinwaters@users.noreply.github.com> Date: Mon, 13 Oct 2025 17:33:04 +0800 Subject: [PATCH] Docs: Updated descriptions on metadata filtering (#10518) ### What problem does this PR solve? ### Type of change - [x] Documentation Update --- docs/guides/dataset/set_metadata.md | 4 +++ docs/references/http_api_reference.md | 36 +++++++++++++++++++++++++-- 2 files changed, 38 insertions(+), 2 deletions(-) diff --git a/docs/guides/dataset/set_metadata.md b/docs/guides/dataset/set_metadata.md index 904efaa9c..a3d239927 100644 --- a/docs/guides/dataset/set_metadata.md +++ b/docs/guides/dataset/set_metadata.md @@ -21,6 +21,10 @@ Ensure that your metadata is in JSON format; otherwise, your updates will not be ![Input metadata](https://raw.githubusercontent.com/infiniflow/ragflow-docs/main/images/input_metadata.jpg) +## Related APIs + +[Retrieve chunks](../../references/http_api_reference.md#retrieve-chunks) + ## Frequently asked questions ### Can I set metadata for multiple documents at once? diff --git a/docs/references/http_api_reference.md b/docs/references/http_api_reference.md index 12d20b296..286aaa5a0 100644 --- a/docs/references/http_api_reference.md +++ b/docs/references/http_api_reference.md @@ -1823,7 +1823,21 @@ curl --request POST \ { "question": "What is advantage of ragflow?", "dataset_ids": ["b2a62730759d11ef987d0242ac120004"], - "document_ids": ["77df9ef4759a11ef8bdd0242ac120004"] + "document_ids": ["77df9ef4759a11ef8bdd0242ac120004"], + "metadata_condition": { + "conditions": [ + { + "name": "author", + "comparison_operator": "=", + "value": "Toby" + }, + { + "name": "url", + "comparison_operator": "not contains", + "value": "amd" + } + ] + } }' ``` @@ -1858,7 +1872,25 @@ curl --request POST \ - `"cross_languages"`: (*Body parameter*) `list[string]` The languages that should be translated into, in order to achieve keywords retrievals in different languages. - `"metadata_condition"`: (*Body parameter*), `object` - The metadata condition for filtering chunks. + The metadata condition used for filtering chunks: + - `"conditions"`: (*Body parameter*), `array` + A list of metadata filter conditions. + - `"name"`: `string` - The metadata field name to filter by, e.g., `"author"`, `"company"`, `"url"`. Ensure this parameter before use. See [Set metadata](../guides/dataset/set_metadata.md) for details. + - `comparison_operator`: `string` - The comparison operator. Can be one of: + - `"contains"` + - `"not contains"` + - `"start with"` + - `"empty"` + - `"not empty"` + - `"="` + - `"≠"` + - `">"` + - `"<"` + - `"≥"` + - `"≤"` + - `"value"`: `string` - The value to compare. + + #### Response Success: