Hi Alan,

Having 3 different needs for this would probably help clarify what common
denominator they need. :) Class-based signature is appealing from code
point of view but how will it work across versions, codecs, etc? A working
example (or, like I said, three examples) would probably help capture the
common needs and problems that may arise.

This said - it does feel like Lucene got a bit stagnant recently (call it
mature, if you like), so perhaps it would be a good breath of fresh air to
have something entirely new to work on, not just minor improvements.

Dawid

On Fri, Jul 3, 2026 at 3:35 PM Alan Woodward <[email protected]> wrote:

> Hi all,
>
> I’ve been catching up with the talks from Buzzwords this year and watching
> this (excellent!) talk from Shailesh (
> https://www.youtube.com/watch?v=ziRcxCJPU6s) on star-tree indexes in
> OpenSearch made me think again about the way we make index structures
> available on LeafReader.  The star-tree index is a novel structure that I
> don’t think it would make sense to add to the base API, but on the other
> hand there isn’t currently an obvious extension point that makes it easy to
> use without doing some hairy casting of LeafReader types.  We have a
> similar issue in elasticsearch with bloom filters - useful in a restricted
> set of circumstances, probably not helpful to have cluttering up the API,
> so we end up implementing it in a custom Codec and then casting at runtime
> to see if things are available (with the usual problems about
> FilterLeafReader wrapping that comes with relying on casts).  This also
> applies to Codec-specific extensions to things like DocValueSkippers.
>
> What do people think about adding a new method to the LeafReader API that
> looks like this:
>
> /** Return a data structure accessed through type T if available */
> T getDataStructure(Class<T> structureType) {
> return null;
> }
>
> Expert users implementing their own Codecs can use this to return
> specialised data structures without polluting the top-level API or having
> to use fragile casts.
>
> Any opinions?
>

Reply via email to