Skip to content

Document[Go-develop]: update Go development docs - #16229

Merged
JinHai-CN merged 3 commits into
infiniflow:mainfrom
Haruko386:monk
Jun 23, 2026
Merged

JinHai-CN merged 3 commits into
infiniflow:mainfrom
Haruko386:monk

Conversation

@Haruko386

@Haruko386 Haruko386 commented Jun 22, 2026 •

Copy link
Copy Markdown
Member

What problem does this PR solve?

As title

Document updated:

Type of change

  • Bug Fix (non-breaking change which fixes an issue)

@dosubot dosubot Bot added the size:S This PR changes 10-29 lines, ignoring generated files. label Jun 22, 2026
@coderabbitai

coderabbitai Bot commented Jun 22, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: df8c5402-5251-4706-ac42-13bbae81c2b2

📥 Commits

Reviewing files that changed from the base of the PR and between a1d74c9 and 2b23812.

📒 Files selected for processing (1)
  • internal/development.md
✅ Files skipped from review due to trivial changes (1)
  • internal/development.md

📝 Walkthrough

Walkthrough

Two sections of internal/development.md are updated: the "Chunk Management" section renames the CLI command from SEARCH to RETRIEVE (line 476), and the "Search datasets" section is expanded to document SQL-style RETRIEVE examples with parameter variants, introduces filesystem-style search syntax, and includes notes contrasting the two approaches with supported WITH options (lines 522–573).

Changes

CLI Docs: SEARCH → RETRIEVE and dataset search documentation

Layer / File(s) Summary
SEARCH → RETRIEVE in chunk examples
internal/development.md
The chunk management CLI example at line 476 renames SEARCH to RETRIEVE while keeping the dataset scope and syntax identical.
Dataset search documentation expansion
internal/development.md
The dataset search section is expanded with SQL-style RETRIEVE ... ON DATASETS ... examples (including WITH option variants), introduces filesystem-style search syntax with examples for searching all datasets, specific paths, and limiting results, plus notes explaining the differences between search and RETRIEVE/SEARCH ... ON DATASETS ... commands and their supported options.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

Poem

🐇 Through the developer docs we hop with glee,
SEARCH becomes RETRIEVE, wild and free!
New syntax blooms for dataset queries grand,
Both SQL and filesystem ways now at hand.
The terminal reads true, the examples align—
Documentation shines with renewed design! ✨

🚥 Pre-merge checks | ✅ 2 | ❌ 3

❌ Failed checks (3 warnings)

Check name Status Explanation Resolution
Title check ⚠️ Warning The title is generic and overly broad. It states 'update Go development docs' but the actual changes are specific documentation updates to CLI command naming (SEARCH to RETRIEVE) and syntax examples in internal/development.md. Use a more specific title that reflects the actual changes, such as 'Rename SEARCH to RETRIEVE command in CLI docs and update examples.'
Description check ⚠️ Warning The description is largely incomplete and uninformative. It lacks meaningful detail about what was changed, why, and contains only 'As title' with no substantive explanation of the documentation updates. Provide a detailed description explaining what documentation was updated, specifically which commands were renamed and why, and what new syntax examples were added.
Docstring Coverage ⚠️ Warning Docstring coverage is 20.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

Warning

There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure.

🔧 markdownlint-cli2 (0.22.1)
internal/development.md

markdownlint-cli2 v0.22.1 (markdownlint v0.40.0)
Error: Unable to use configuration file '/coderabbit-0.markdownlint-cli2.jsonc'; ENOENT: no such file or directory, open '/coderabbit-0.markdownlint-cli2.jsonc'
at throwForConfigurationFile (file:///usr/local/lib/node_modules/markdownlint-cli2/markdownlint-cli2.mjs:48:9)
at readOptionsOrConfig (file:///usr/local/lib/node_modules/markdownlint-cli2/markdownlint-cli2.mjs:169:5)
at async main (file:///usr/local/lib/node_modules/markdownlint-cli2/markdownlint-cli2.mjs:927:21)
at async file:///usr/local/lib/node_modules/markdownlint-cli2/markdownlint-cli2-bin.mjs:14:22 {
[cause]: Error: ENOENT: no such file or directory, open '/coderabbit-0.markdownlint-cli2.jsonc'
at async open (node:internal/fs/promises:640:25)
at async Object.readFile (node:internal/fs/promises:1287:14)
at async readOptionsOrConfig (file:///usr/local/lib/node_modules/markdownlint-cli2/markdownlint-cli2.mjs:141:17)
at async main (file:///usr/local/lib/node_modules/markdownlint-cli2/markdownlint-cli2.mjs:927:21)
at async file:///usr/local/lib/node_modules/markdownlint-cli2/markdownlint-cli2-bin.mjs:14:22 {
errno: -2,
code: 'ENOENT',
syscall: 'open',
path: '/coderabbit-0.markdownlint-cli2.jsonc'
}
}


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@Haruko386 Haruko386 added 🐞 bug Something isn't working, pull request that fix bug. ci Continue Integration labels Jun 22, 2026
@Haruko386
Haruko386 marked this pull request as draft June 22, 2026 03:32
@Haruko386
Haruko386 marked this pull request as ready for review June 22, 2026 03:32
@Haruko386 Haruko386 changed the title Monk fix(go): CLI error for SEARCH '...' ON DATASETS '...' Jun 22, 2026
@Haruko386
Haruko386 marked this pull request as draft June 22, 2026 03:33
@Haruko386
Haruko386 marked this pull request as ready for review June 22, 2026 03:33
@Haruko386
Haruko386 marked this pull request as draft June 22, 2026 03:38

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick comments (2)
internal/cli/user_parser_test.go (1)

147-180: 🧹 Nitpick | 🔵 Trivial | ⚡ Quick win

Add a lowercase search ... on datasets ... retrieve-path test.

Given this PR’s stated fix scope, add an explicit lowercase retrieve-case assertion to prevent regressions (search 'AI' on datasets 'test2' should map to search_on_datasets).

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@internal/cli/user_parser_test.go` around lines 147 - 180, Add a new test
function after TestParseSearchOnDatasetsCommand to test the lowercase variant of
the search on datasets command. The test should create a Parser with the
lowercase input string "search 'AI' on datasets 'test2'", call Parse with
APIMode, and then assert that cmd.Type equals "search_on_datasets" and that the
question and datasets parameters are correctly extracted as "AI" and "test2"
respectively. This ensures that both uppercase and lowercase syntax variants are
properly handled and prevents regressions in the parser's handling of lowercase
retrieve-path commands.
internal/cli/parser.go (1)

302-309: 🧹 Nitpick | 🔵 Trivial | ⚡ Quick win

Constrain ON DATASETS detection to the retrieve-clause position.

The helper currently matches any adjacent ON DATASETS pair in the raw input, which can misroute ambiguous filesystem search strings. Consider anchoring detection to the expected retrieve shape (after search question parsing) rather than scanning all fields.

Suggested direction
-func isSearchOnDatasetsCommand(input string) bool {
-	fields := strings.Fields(strings.ToUpper(input))
-	for i := 0; i+1 < len(fields); i++ {
-		if fields[i] == "ON" && fields[i+1] == "DATASETS" {
-			return true
-		}
-	}
-	return false
-}
+func isSearchOnDatasetsCommand(input string) bool {
+	fields := strings.Fields(strings.ToUpper(input))
+	if len(fields) < 4 || fields[0] != "SEARCH" {
+		return false
+	}
+	// Require ON DATASETS to appear as clause boundary after the question segment.
+	for i := 2; i+1 < len(fields); i++ {
+		if fields[i] == "ON" && fields[i+1] == "DATASETS" {
+			return true
+		}
+	}
+	return false
+}
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@internal/cli/parser.go` around lines 302 - 309, The isSearchOnDatasetsCommand
function currently scans the entire input string for any adjacent ON DATASETS
pair, which can incorrectly match these keywords when they appear in filesystem
search strings. Instead of searching through all fields in the raw input,
constrain the ON DATASETS detection to the expected retrieve-clause position by
anchoring it after the search question has been parsed. This means checking for
ON DATASETS at a specific expected position in the parsed command structure
rather than performing a full-field scan of the raw input string.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Nitpick comments:
In `@internal/cli/parser.go`:
- Around line 302-309: The isSearchOnDatasetsCommand function currently scans
the entire input string for any adjacent ON DATASETS pair, which can incorrectly
match these keywords when they appear in filesystem search strings. Instead of
searching through all fields in the raw input, constrain the ON DATASETS
detection to the expected retrieve-clause position by anchoring it after the
search question has been parsed. This means checking for ON DATASETS at a
specific expected position in the parsed command structure rather than
performing a full-field scan of the raw input string.

In `@internal/cli/user_parser_test.go`:
- Around line 147-180: Add a new test function after
TestParseSearchOnDatasetsCommand to test the lowercase variant of the search on
datasets command. The test should create a Parser with the lowercase input
string "search 'AI' on datasets 'test2'", call Parse with APIMode, and then
assert that cmd.Type equals "search_on_datasets" and that the question and
datasets parameters are correctly extracted as "AI" and "test2" respectively.
This ensures that both uppercase and lowercase syntax variants are properly
handled and prevents regressions in the parser's handling of lowercase
retrieve-path commands.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 8e2e1a43-327c-44ba-bd57-1ab20a41eb2f

📥 Commits

Reviewing files that changed from the base of the PR and between dfe841a and 3d24a78.

📒 Files selected for processing (2)
  • internal/cli/parser.go
  • internal/cli/user_parser_test.go

@Haruko386
Haruko386 marked this pull request as ready for review June 22, 2026 03:50
@dosubot dosubot Bot added size:M This PR changes 30-99 lines, ignoring generated files. and removed size:S This PR changes 10-29 lines, ignoring generated files. labels Jun 22, 2026
@Haruko386
Haruko386 marked this pull request as draft June 22, 2026 03:52

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@internal/development.md`:
- Line 476: The SEARCH to RETRIEVE command rename has been applied to
internal/development.md but the same command examples in other documentation
files (internal/cli/README.md and admin/client/COMMAND.md) still reference the
old SEARCH command. Update all SEARCH command examples to RETRIEVE in the
internal/cli/README.md and admin/client/COMMAND.md files to maintain consistency
across the entire documentation set, ensuring the rename is uniformly applied
throughout the codebase.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 7427baf5-c3f1-453b-867b-dfd3983d193a

📥 Commits

Reviewing files that changed from the base of the PR and between 3d24a78 and 2e80c51.

📒 Files selected for processing (1)
  • internal/development.md

Comment thread internal/development.md
- Search chunks
```
RAGFlow(api/default)> SEARCH 'AI' ON DATASETS 'test'
RAGFlow(api/default)> RETRIEVE 'AI' ON DATASETS 'test'

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Verify that no SEARCH command examples remain in the documentation

# Search for remaining SEARCH command examples (case-insensitive)
echo "=== Checking for remaining SEARCH command examples ==="
rg -n "SEARCH\s+" --type md

echo ""
echo "=== Checking for remaining 'Search' command examples in CLI contexts ==="
rg -n "RAGFlow.*>\s*(Search|search)" --type md

Repository: infiniflow/ragflow

Length of output: 732


Verify whether other documentation files should be updated as part of this rename.

The SEARCH→RETRIEVE rename is consistently applied within internal/development.md (lines 476–552). However, verification reveals that other documentation files still contain SEARCH command examples:

  • internal/cli/README.md (lines 106–108)
  • admin/client/COMMAND.md (lines 664, 673)

If this PR intends to rename the command across the entire codebase, these files should also be updated. Clarify whether updating these files is within scope for this PR.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@internal/development.md` at line 476, The SEARCH to RETRIEVE command rename
has been applied to internal/development.md but the same command examples in
other documentation files (internal/cli/README.md and admin/client/COMMAND.md)
still reference the old SEARCH command. Update all SEARCH command examples to
RETRIEVE in the internal/cli/README.md and admin/client/COMMAND.md files to
maintain consistency across the entire documentation set, ensuring the rename is
uniformly applied throughout the codebase.

@Haruko386 Haruko386 added 📖 documentation Improvements or additions to documentation and removed 🐞 bug Something isn't working, pull request that fix bug. labels Jun 22, 2026
@Haruko386
Haruko386 marked this pull request as ready for review June 22, 2026 04:59
@dosubot dosubot Bot added the 🐞 bug Something isn't working, pull request that fix bug. label Jun 22, 2026
@Haruko386
Haruko386 marked this pull request as draft June 22, 2026 05:11
@Haruko386 Haruko386 changed the title fix(go): CLI error for SEARCH '...' ON DATASETS '...' Document[Go-develop]: update Go development docs Jun 22, 2026
@Haruko386 Haruko386 removed the 🐞 bug Something isn't working, pull request that fix bug. label Jun 22, 2026
@Haruko386
Haruko386 marked this pull request as ready for review June 22, 2026 09:49

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
internal/development.md (1)

523-553: ⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Clean up the markdownlint violations in this section.

Both CLI example fences are missing a language tag, and the note list has extra spaces after >. Adding a fence language such as text and normalizing the blockquote spacing will keep the doc lint-clean and render more predictably.

Suggested edit
-```
+```text
@@
->  - `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`.
+> - `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`.
@@
-```
+```text

Also applies to: 556-573

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@internal/development.md` around lines 523 - 553, The markdown code fences
containing RETRIEVE command examples are missing a language tag specification,
and the blockquote lines starting with `>` have inconsistent spacing with extra
spaces after the blockquote marker. Add the language tag `text` to both code
fence opening markers (```text) before the RETRIEVE examples and after the
closing fence. For the blockquote lines that list search command descriptions
and WITH options, ensure each line uses exactly one space after the `>` marker
(change `->  ` pattern to `> `) to maintain consistent blockquote formatting
throughout the section.

Source: Linters/SAST tools

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Outside diff comments:
In `@internal/development.md`:
- Around line 523-553: The markdown code fences containing RETRIEVE command
examples are missing a language tag specification, and the blockquote lines
starting with `>` have inconsistent spacing with extra spaces after the
blockquote marker. Add the language tag `text` to both code fence opening
markers (```text) before the RETRIEVE examples and after the closing fence. For
the blockquote lines that list search command descriptions and WITH options,
ensure each line uses exactly one space after the `>` marker (change `->  `
pattern to `> `) to maintain consistent blockquote formatting throughout the
section.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 4f10056d-846c-425b-bf6f-39e44ac71539

📥 Commits

Reviewing files that changed from the base of the PR and between 2e80c51 and a1d74c9.

📒 Files selected for processing (1)
  • internal/development.md

@codecov

codecov Bot commented Jun 22, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 93.16%. Comparing base (dfe841a) to head (2b23812).
⚠️ Report is 14 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main   #16229   +/-   ##
=======================================
  Coverage   93.16%   93.16%           
=======================================
  Files          10       10           
  Lines         717      717           
  Branches      118      118           
=======================================
  Hits          668      668           
  Misses         29       29           
  Partials       20       20           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@JinHai-CN
JinHai-CN merged commit d89e29f into infiniflow:main Jun 23, 2026
3 checks passed
@Haruko386
Haruko386 deleted the monk branch July 2, 2026 01:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci Continue Integration 📖 documentation Improvements or additions to documentation size:M This PR changes 30-99 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants