Skip to content

fix(infinity): Use comma separator for important_kwd to preserve mult…#12618

Merged
yuzhichang merged 1 commit intoinfiniflow:mainfrom
liuxiaoyusky:fix/important-kwd-split-bug
Jan 15, 2026
Merged

fix(infinity): Use comma separator for important_kwd to preserve mult…#12618
yuzhichang merged 1 commit intoinfiniflow:mainfrom
liuxiaoyusky:fix/important-kwd-split-bug

Conversation

@liuxiaoyusky
Copy link
Contributor

Problem

The `important_kwd` field in Infinity connector was using mismatched separators:

  • Storage: `list2str(v)` uses space as default separator
  • Reading: `v.split()` splits by all whitespace

This causes multi-word keywords like `"Senior Fund Manager"` to be incorrectly split into `["Senior", "Fund", "Manager"]`.

Solution

Use comma `,` as separator for both storing and reading, consistent with:

  1. The LLM output format in `keyword_prompt.md` ("delimited by ENGLISH COMMA")
  2. The `cached.split(",")` in `task_executor.py`

Changes

  • `insert()`: `list2str(v)` → `list2str(v, ",")`
  • `update()`: `list2str(v)` → `list2str(v, ",")`
  • `get_fields()`: `v.split()` → `v.split(",") if v else []`

Impact

This bug affects:

  • Python-level reranking weight calculation (`important_kwd * 5`)
  • API response keyword display
  • Search precision due to fragmented keywords

…i-word keywords

The important_kwd field was using space as separator when storing
(list2str default) but split() when reading, which breaks multi-word
keywords like "Senior Fund Manager" into ["Senior", "Fund", "Manager"].

This fix uses comma as separator for both storing and reading,
consistent with the LLM output format specified in keyword_prompt.md.

Changes:
- insert(): Use list2str(v, ",") instead of list2str(v)
- update(): Use list2str(v, ",") instead of list2str(v)
- get_fields(): Use v.split(",") instead of v.split()
@dosubot dosubot bot added size:XS This PR changes 0-9 lines, ignoring generated files. ♾️infinity Pull requests that‘s involved with infinity(DB) labels Jan 14, 2026
@yingfeng yingfeng requested a review from yuzhichang January 14, 2026 09:43
@liuxiaoyusky
Copy link
Contributor Author

hello world

@dosubot dosubot bot added the lgtm This PR has been approved by a maintainer label Jan 15, 2026
@yuzhichang yuzhichang merged commit 2ea8ddd into infiniflow:main Jan 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

♾️infinity Pull requests that‘s involved with infinity(DB) lgtm This PR has been approved by a maintainer 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