From d89e29fba8ed56cf62d783ca3268490800bb9924 Mon Sep 17 00:00:00 2001 From: Haruko386 Date: Tue, 23 Jun 2026 19:19:44 +0800 Subject: [PATCH] Document[Go-develop]: update Go development docs (#16229) ### What problem does this PR solve? Document updated: ### Type of change - [x] Bug Fix (non-breaking change which fixes an issue) --- internal/development.md | 56 ++++++++++++++++++++++++++++------------- 1 file changed, 38 insertions(+), 18 deletions(-) diff --git a/internal/development.md b/internal/development.md index 87af2e383c..982d0e64ca 100644 --- a/internal/development.md +++ b/internal/development.md @@ -473,7 +473,7 @@ RAGFlow(api/default)> DROP CHUNK STORE FOR DATASET 'test' - Search chunks ``` -RAGFlow(api/default)> SEARCH 'AI' ON DATASETS 'test' +RAGFlow(api/default)> RETRIEVE 'AI' ON DATASETS 'test' ``` - Get chunks @@ -519,35 +519,55 @@ RAGFlow(api/default)> GET METADATA OF DATASET 'test' 'test2' ### 6.29. Search datasets -- Search datasets +- Search datasets using SQL-like dataset search syntax: ``` -RAGFlow(api/default)> SEARCH 'AI' ON DATASETS 'test'; +RAGFlow(api/default)> RETRIEVE 'AI' ON DATASETS 'test'; -RAGFlow(api/default)> SEARCH 'AI' ON DATASETS 'test1' 'test2'; +RAGFlow(api/default)> RETRIEVE 'AI' ON DATASETS 'test1, test2'; -RAGFlow(api/default)> SEARCH 'AI' ON DATASETS 'test' WITH top_k 1; +RAGFlow(api/default)> RETRIEVE 'AI' ON DATASETS 'test' WITH top_k 1; -RAGFlow(api/default)> SEARCH 'AI' ON DATASETS 'test' WITH page 2 page_size 20; +RAGFlow(api/default)> RETRIEVE 'AI' ON DATASETS 'test' WITH page 2 page_size 20; -RAGFlow(api/default)> SEARCH 'AI' ON DATASETS 'test' WITH similarity_threshold 0.5; +RAGFlow(api/default)> RETRIEVE 'AI' ON DATASETS 'test' WITH similarity_threshold 0.5; -RAGFlow(api/default)> SEARCH 'AI' ON DATASETS 'test' WITH vector_similarity_weight 0.0; +RAGFlow(api/default)> RETRIEVE 'AI' ON DATASETS 'test' WITH vector_similarity_weight 0.0; -RAGFlow(api/default)> SEARCH 'AI' ON DATASETS 'test' WITH keyword true; +RAGFlow(api/default)> RETRIEVE 'AI' ON DATASETS 'test' WITH keyword true; -RAGFlow(api/default)> SEARCH 'AI' ON DATASETS 'test' WITH use_kg true; +RAGFlow(api/default)> RETRIEVE 'AI' ON DATASETS 'test' WITH use_kg true; -RAGFlow(api/default)> SEARCH 'AI' ON DATASETS 'test' WITH rerank_id 'BAAI/bge-reranker-v2-m3@CI@SILICONFLOW'; +RAGFlow(api/default)> RETRIEVE 'AI' ON DATASETS 'test' WITH rerank_id 'BAAI/bge-reranker-v2-m3@CI@SILICONFLOW'; -RAGFlow(api/default)> SEARCH 'AI' ON DATASETS 'test' WITH search_id 'abc123'; +RAGFlow(api/default)> RETRIEVE 'AI' ON DATASETS 'test' WITH search_id 'abc123'; -RAGFlow(api/default)> SEARCH 'AI' ON DATASETS 'test' WITH cross_languages ['Chinese']; +RAGFlow(api/default)> RETRIEVE 'AI' ON DATASETS 'test' WITH cross_languages ['Chinese']; -RAGFlow(api/default)> SEARCH 'AI' ON DATASETS 'test' WITH doc_ids ['doc_a', 'doc_b']; +RAGFlow(api/default)> RETRIEVE 'AI' ON DATASETS 'test' WITH doc_ids ['doc_a', 'doc_b']; -RAGFlow(api/default)> SEARCH 'AI' ON DATASETS 'test' WITH meta_data_filter '{"method":"auto"}'; +RAGFlow(api/default)> RETRIEVE 'AI' ON DATASETS 'test' WITH meta_data_filter '{"method":"auto"}'; -RAGFlow(api/default)> SEARCH 'AI' ON DATASETS 'test' WITH meta_data_filter '{"method":"manual","conditions":[{"key":"author","op":"eq","value":"Luo"}]}'; +RAGFlow(api/default)> RETRIEVE 'AI' ON DATASETS 'test' WITH meta_data_filter '{"method":"manual","conditions":[{"key":"author","op":"eq","value":"Luo"}]}'; -RAGFlow(api/default)> SEARCH 'AI' ON DATASETS 'test' WITH top_k 50 similarity_threshold 0.5 vector_similarity_weight 0.5 use_kg true; -``` \ No newline at end of file +RAGFlow(api/default)> RETRIEVE 'AI' ON DATASETS 'test' WITH top_k 50 similarity_threshold 0.5 vector_similarity_weight 0.5 use_kg true; +``` + +- Search datasets using filesystem-style search syntax: +``` +RAGFlow(api/default)> search "AI" # search all datasets + +RAGFlow(api/default)> search "AI" datasets/test # search only dataset 'test' + +RAGFlow(api/default)> search "AI" datasets/test -n 20 # return top 20 results + +RAGFlow(api/default)> search "AI" datasets 'test1' 'test2' # search in datasets +``` + +> [!Note] +> - `search` is the simple filesystem search command and only accepts `query [path] [-n number]`. +> - `RETRIEVE` / `SEARCH ... ON DATASETS ...` is the SQL-like search command and supports full `WITH` option expansion. +> - `WITH` options include: `top_k`, `page_size`, `page`, `similarity_threshold`, `vector_similarity_weight`, `keyword`, `use_kg`, `rerank_id`, `search_id`, `cross_languages`, `doc_ids`, and `meta_data_filter`. + - Example with multiple options: +``` +RAGFlow(api/default)> RETRIEVE 'AI' ON DATASETS 'test' WITH top_k 50 similarity_threshold 0.5 vector_similarity_weight 0.5 use_kg true; +```