Skip to content

fix: exclude compiled artifacts from chunk lists - #18382

Merged
wangq8 merged 1 commit into
infiniflow:mainfrom
buua436:go018
Aug 18, 2026
Merged

wangq8 merged 1 commit into
infiniflow:mainfrom
buua436:go018

Conversation

@buua436

@buua436 buua436 commented Aug 17, 2026

Copy link
Copy Markdown
Contributor

What problem does this PR solve?

The Go document chunks API included Wiki pages, sections, and other compiled artifacts in ordinary chunk lists. This PR excludes chunks containing compile_kwd, aligning the Go behavior, pagination, and total count with the Python implementation.

Type of change

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

@dosubot dosubot Bot added size:XS This PR changes 0-9 lines, ignoring generated files. 🐞 bug Something isn't working, pull request that fix bug. labels Aug 17, 2026
@buua436
buua436 requested a review from wangq8 August 17, 2026 11:21
@buua436 buua436 added the ci Continue Integration label Aug 17, 2026
@coderabbitai

coderabbitai Bot commented Aug 17, 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 Plus

Run ID: 7957ab8a-545a-4e41-b019-e662d45628f0

📥 Commits

Reviewing files that changed from the base of the PR and between 37b945c and 1466f84.

📒 Files selected for processing (2)
  • internal/service/chunk/chunk.go
  • internal/service/chunk/chunk_test.go

Included review availability: Your plan includes up to 10 reviews per rolling hour; 9 remain after this review.


📝 Walkthrough

Walkthrough

The chunk list query now excludes records with an existing compile_kwd field while retaining document ID filtering. The related test verifies the generated must_not filter.

Changes

Chunk list filtering

Layer / File(s) Summary
Chunk filter and validation
internal/service/chunk/chunk.go, internal/service/chunk/chunk_test.go
The chunk list filter excludes records where compile_kwd exists. The test verifies the generated must_not clause.

Estimated code review effort: 1 (Trivial) | ~5 minutes

Merge Risk: ⚪ Minimal · up to 1466f

This change narrowly excludes compiled artifacts from ordinary chunk lists while keeping pagination and totals aligned; no actionable merge-blocking risk remains beyond normal checks and review.

Suggested reviewers: jinhai-cn, haruko386

Poem

A rabbit checks the chunks in line,
Keeps document matches neat and fine.
Compiled keywords stay away,
Tests confirm the rule today.
Hop, hop—filters work as planned!

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly summarizes the main change: excluding compiled artifacts from chunk lists.
Description check ✅ Passed The description clearly explains the problem, the fix, the affected artifacts, and the bug-fix classification.
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.

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.

@wangq8 wangq8 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

LGTM, thanks for the fix.

Verified the change against the Python implementation: list_chunks in api/apps/restful_apis/chunk_api.py uses the same "must_not": {"exists": "compile_kwd"} filter, so this correctly aligns Go behavior with Python.

Also confirmed the engine implementations handle the must_not + exists pair:

  • elasticsearch/chunk.go builds a proper bool.must_not exists clause
  • infinity handles must_not exists via NOT (field != '')
  • oceanbase and serenedb both have explicit must_not/exists handling

One minor note (non-blocking): the Infinity path relies on compile_kwd having an empty-string default so that NOT (compile_kwd != '') matches ordinary chunks. This is consistent with existing patterns (e.g. dataset_structure_graph.go), so no change needed — just flagging the assumption for future reference.

Test coverage looks adequate for the filter construction.

@wangq8
wangq8 merged commit f5efff8 into infiniflow:main Aug 18, 2026
9 checks passed
@coderabbitai coderabbitai Bot mentioned this pull request Aug 19, 2026
2 tasks done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

🐞 bug Something isn't working, pull request that fix bug. ci Continue Integration size:XS This PR changes 0-9 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants