Skip to content

docs: document the length chunker boundary settings - #475

Merged
marevol merged 1 commit into
masterfrom
feature/length-chunker-boundary-settings
Aug 10, 2026
Merged

docs: document the length chunker boundary settings#475
marevol merged 1 commit into
masterfrom
feature/length-chunker-boundary-settings

Conversation

@marevol

@marevol marevol commented Aug 9, 2026

Copy link
Copy Markdown
Contributor

Summary

Documents the three content_chunker.length.boundary.* settings added by the boundary-aware chunking change in fess, and the resulting change to what content_chunker.length.chunk_size means.

Added to 15.8/config/search-semantic.rst in all seven languages (en, ja, de, fr, es, ko, zh-cn), as new rows next to the existing content_chunker.length.overlap entry plus one note after the table. All seven already carried a fully parallel translation of that table, so leaving five of them untouched would have left them describing chunk_size as an exact per-chunk character count.

What is documented

key default range
content_chunker.length.boundary.enabled true --
content_chunker.length.boundary.lookback_percent 20 0-50
content_chunker.length.boundary.lookahead_percent 5 0-25

The note covers:

  • Each cut moves to the nearest suitable break within the search window, preferring a line break or sentence end over a clause separator or space, and those over a script change. Only the cut point moves, so concatenating a document's chunks still reproduces its content exactly.
  • chunk_size is now a target rather than a hard ceiling. The forward sentence search may overshoot by up to lookahead_percent; separately, and not governed by lookahead_percent, moving off a grapheme cluster may overshoot by up to 32 characters. The two never occur on the same cut, so the worst case is about 841 characters at the shipped defaults.
  • Chunks can be up to lookback_percent shorter, so a document may produce slightly more chunks -- relevant to content_chunker.max_chunks_per_document.
  • boundary.enabled=false, or both percentages at 0, restores the previous fixed-length behaviour.

The chunk_size row now points at that note, so a reader scanning the table does not miss the target-versus-ceiling caveat.

Notes for review

The tier precedence and every figure were checked against the implementation, and the numbers are identical across all seven languages. Each file parses with docutils with exactly the same message set as before the change.

The non-English text was not reviewed by a native speaker; corrections welcome, particularly for the de, fr, es and ko notes.

Add content_chunker.length.boundary.enabled / lookback_percent /
lookahead_percent to the system.properties reference table in
config/search-semantic.rst, next to the existing
content_chunker.length.overlap entry, across all 7 languages
(en, ja, de, fr, es, ko, zh-cn).

Also add a note explaining that content_chunker.length.chunk_size is
now a target rather than a hard ceiling:

- Each cut moves to a suitable break within the lookback/lookahead
  search window, preferring a line break or sentence end over a clause
  separator or space, and those over a script change. Only the cut
  point moves and no character is dropped, so concatenating a
  document's chunks still reproduces its content exactly.
- The forward search may overshoot chunk_size by up to
  lookahead_percent. A second, independent overshoot of up to 32
  characters can occur when a cut would otherwise land inside a
  grapheme cluster; that one ignores lookahead_percent and can happen
  even when it is 0. The two never occur on the same cut, so the worst
  case at the shipped defaults is about 841 characters.
- Chunks can also come in up to lookback_percent shorter, so a
  document may produce slightly more chunks than before (see
  content_chunker.max_chunks_per_document).
- Setting boundary.enabled=false, or both percentages to 0, restores
  the previous exact fixed-length behavior.

The chunk_size row now points at that note, so a reader scanning the
table does not miss the target-versus-ceiling caveat.

Verified: docutils parses all 7 files with a message set identical
(line-number-normalized) to the pre-change baseline; defaults, ranges
and figures (true, 20 (0-50), 5 (0-25), 32, 841) are unchanged and
consistent across languages; every touched line stays within each
file's pre-existing maximum display width (East-Asian-Width aware).
@marevol
marevol force-pushed the feature/length-chunker-boundary-settings branch from 82d1ae1 to 386bffb Compare August 10, 2026 23:49
@marevol
marevol merged commit db6da06 into master Aug 10, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant