8000 [Bug]: Go UpdateChunk does not refresh question_tks, important_tks, or the embedding · Issue #22297 · infiniflow/ragflow · GitHub
[go: up one dir, main page]

Skip to content

[Bug]: Go UpdateChunk does not refresh question_tks, important_tks, or the embedding #22297

Open

Description

@LUXUS1

Self Checks

  • I have searched for existing issues search for existing issues, including closed ones.
  • I confirm that I am using English to submit this report (Language Policy).
  • Non-english title submitions will be closed directly ( 非英文标题的提交将会被直接关闭 ) (Language Policy).
  • Please do not modify this template :) and fill in all the required fields.

RAGFlow workspace code commit ID

292e171

RAGFlow image version

v1.0.0

Other environment information

Actual behavior

Saving a chunk in the UI calls Go ChunkService.UpdateChunk. It rewrites content_ltks, important_kwd, and question_kwd only. It does not rewrite important_tks or question_tks, and it does not re-embed q_*_vec.

Full-text search uses question_tks^20, not question_kwd. The reranker also reads question_tks (repeated 6 times). Similar questions added or edited on an existing chunk therefore show up in the editor but do not change retrieval. Keywords still affect full-text because the query and the reranker read important_kwd directly, but important_tks stays stale. The stored vector stays whatever was computed when the chunk was created.

Expected behavior

Match the previous Python update_chunk in api/apps/restful_apis/chunk_api.py: when keywords or questions are in the request, rewrite important_tks and question_tks; always re-encode the vector. If the question list is non-empty, embed that list; otherwise embed the chunk content. The chunk editor says the same thing: if questions are given, the chunk embedding is based on them.

Steps to reproduce

1. Create a chunk with content only, so its vector is the content.
2. Edit that chunk, add similar questions and keywords, and save.
3. Retrieve with one of the new similar questions.
4. The question tokens and the vector are still the original ones. Only question_kwd and important_kwd changed.

Additional information

Open PR #20552 refreshes the vector when the embedding input changes, and its description says the change does not extend to question_tks. important_tks is also still missing from UpdateChunk. Both token fields are written only in AddChunk.

Activity

  1. added
    🐞 bugSomething isn't working, pull request that fix bug.
    on Nov 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    🐞 bugSomething isn't working, pull request that fix bug.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      0