Allow codec configuration on BranchIndexWriter (currently blocks Lucene suggest fields)
まだ誰も着手していません。
評価
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 初心者へのやさしさ
- 64/100
- issue の種類
- 機能追加
- 明瞭さ
- おおむね明確
- 活発さ
- 活発
調査の方向性
src/java/org/replikativ/scriptum/BranchIndexWriter.java の createOver、create、open、forkLocked から始め、続いてそれらの IndexWriterConfig インスタンスを構築する公開ファクトリを追跡してください。src/clojure/scriptum/core.clj の Clojure エントリポイント、特に create-index と open-store-index を確認してください。既存のデフォルトを変更せず、フォーク中に作成される writer を含むすべての writer 構成にオプションの codec が渡れば完了です。
索引モデルが issue の本文から書いたものです。
説明
Checked against v0.1.30 (90dbd2a) / Lucene 10.3.2.
Problem
SuggestField
and ContextSuggestField
require a Codec
whose getPostingsFormatForField
returns a CompletionPostingsFormat
(Completion101PostingsFormat
for Lucene 10.3). That codec has to be set on the
IndexWriterConfig
before the IndexWriter
is constructed.
BranchIndexWriter
builds its IndexWriterConfig internally at four sites, and none of them call
setCodec:
| Line | Enclosing method |
|---|---|
| 328 | createOver |
| 402 | create |
| 507 | open |
| 693 | forkLocked |
None of the public factories take a codec either; they stop at
create(basePath, branchName, analyzer, cryptoHash).
There is no post-construction escape hatch either.
getIndexWriter().getConfig()
returns a LiveIndexWriterConfig,
where the codec is read-only.
So a SuggestField can be handed to
addDocument(Iterable<? extends IndexableField>)
and will be accepted, but it cannot be indexed in a form
SuggestIndexSearcher
can query.
The read half already works.
openReader()
and openReaderAt(generation)
return a plain DirectoryReader,
which wraps in a SuggestIndexSearcher with no change to scriptum. Per-branch and
historical suggest queries come for free once the write path is unblocked.
Why it fits
Completion postings are ordinary per-segment files, so I would expect COW segment
sharing, fork, snapshot addresses and the merkle content-hash to cover them
unchanged. I have not tested that, and it is the part of this I am least sure of.
Autocomplete you can fork, or query at an older commit, seems like a reasonable
thing to want from a branched index, and ContextSuggestField maps onto
multi-tenant scoping.
Suggested shape
Accept an optional Codec on the create / createOver / open factories and
thread it to all four construction sites, with today's behavior as the default. An
IndexWriterConfig customizer such as a
UnaryOperator<IndexWriterConfig>
would be more general if you prefer that.
forkLocked
is the one I would watch. It builds a fresh config rather than inheriting the
parent's, so if it is missed a fork quietly loses its codec and only fails later,
at query time, on the branch rather than on main.
On the Clojure side this could be an option to
create-index
and open-store-index,
plus a :suggest field type in
add-doc.
lucene-suggest need not become a scriptum dependency. A codec parameter is
enough to let callers bring their own.
Two interactions to watch
BranchAwareMergePolicy
will not merge all-shared segments, so segment count grows with branch and
commit history. Completion FSTs are held per segment, so a suggest-heavy index
would feel that as heap growth sooner than an ordinary index does.- For store-backed indices,
warm!
would want to cover the completion files. Otherwise a cold suggest query pays a
round trip per file, like any other cold read.
I am happy to put up a PR if this shape sounds right. If you would rather expose
the whole IndexWriterConfig than just the codec, say so and I will follow that
instead.
- 主要言語
- Clojure
- スター
- 20
- フォーク
- 1
- PR マージ指標
- 30日以内にマージされた PR はありません
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートなし
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 62/100
メンテナーはふだん 1 日以内に返信
-
.Needs Triage .Team/UXWest Priority:P2 Type:Bug
難易度 2/5 1〜3時間 初心者へのやさしさ 67/100
metabase/metabase#83998 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
メンテナーはふだん 1 日以内に返信
-
bug
難易度 1/5 1時間未満 初心者へのやさしさ 88/100
clojure-emacs/cider-nrepl#1053 · コメント 1 件 ·
メンテナーはふだん 2 日以内に返信