Allow codec configuration on BranchIndexWriter (currently blocks Lucene suggest fields)
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Aptitud para principiantes
- 64/100
- Tipo de issue
- Nueva funcionalidad
- Claridad
- Bastante claro
- Estado de actividad
- Activo
- Área
- backend-api-design, search
Línea de trabajo
Comienza en src/java/org/replikativ/scriptum/BranchIndexWriter.java, en createOver, create, open y forkLocked, y luego sigue las factorías públicas que construyen sus instancias de IndexWriterConfig. Revisa los puntos de entrada de Clojure en src/clojure/scriptum/core.clj, especialmente create-index y open-store-index. Se considera terminado cuando el codec opcional llega a todas las configuraciones de los writers, mientras los valores predeterminados existentes permanecen sin cambios, incluidos los writers creados durante los forks.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
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.
- Lenguaje dominante
- Clojure
- Estrellas
- 20
- Forks
- 1
- Métricas de merge de PR
- Sin PR fusionados en 30 d
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Sin plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Issues similares
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 62/100
Los mantenedores suelen responder en 1 día
-
.Needs Triage .Team/UXWest Priority:P2 Type:Bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 67/100
metabase/metabase#83998 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
Add :ConjureLogShow commandAbierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
-
Install script not workingAbierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
Los mantenedores suelen responder en 1 día
-
Clojure 1.13 compatibilityAbiertobug
Dificultad 1/5 Menos de una hora Aptitud para principiantes 88/100
clojure-emacs/cider-nrepl#1053 · 1 comentario ·
Los mantenedores suelen responder en 2 días