Repository navigation
[AI] Implement read-only PayloadFieldIndexRead / FieldIndexRead - #9026
Merged
Merged
Conversation
Wires `ReadOnlyFieldIndex` into the read-only field-index surface that
`ReadOnlyMapIndex` and `ReadOnlyNullIndex` already provide, sharing the
non-trivial bodies with the existing `MapIndex` impls.
- Extracted per-`N` `PayloadFieldIndexRead` bodies (filter,
estimate_cardinality, for_each_payload_block, condition_checker) in
`payload_index_impl/{str,int,uuid}.rs` into free functions over
`T: MapIndexRead<N>`. Both `MapIndex<N>` and `ReadOnlyMapIndex<N, S>`
now impl `PayloadFieldIndexRead` via thin delegation to those bodies.
- Lifted `value_retriever` bodies in `value_indexer_impl.rs` the same
way; `ReadOnlyMapIndex<N, S>` gets the per-K closure for free.
- Added `telemetry_index_type` (required) + `get_telemetry_data`
(default) to `MapIndexRead`, mirroring the `NullIndexRead` pattern;
every map-index variant now reports telemetry without an inherent
method on the enum.
- Promoted `MapIndexRead` + its module to `pub` so
`field_index_base/read_only/` can name them.
- Implemented `FacetIndex for ReadOnlyMapIndex<N, S>` and extended
`FacetIndexEnum` with `S: UniversalRead = MmapFile` plus the three
read-only variants. `FieldIndex::as_facet_index` pins
`S = MmapFile` via turbofish to keep inference happy.
- `ReadOnlyFieldIndex::as_numeric` returns `None` for now; no concrete
read-only numeric type exists yet (the doc on `NumericFieldIndexRead`
already notes this is intended for a future `ReadOnlySegment`).
dancixx
approved these changes
May 13, 2026
generall
added a commit
that referenced
this pull request
May 13, 2026
* rename mmap -> universal * [AI] Introduce `ReadOnlyMapIndex` and implement `MapIndexRead` for it * add missing file * [AI] Implement read-only PayloadFieldIndexRead / FieldIndexRead (#9026) Wires `ReadOnlyFieldIndex` into the read-only field-index surface that `ReadOnlyMapIndex` and `ReadOnlyNullIndex` already provide, sharing the non-trivial bodies with the existing `MapIndex` impls. - Extracted per-`N` `PayloadFieldIndexRead` bodies (filter, estimate_cardinality, for_each_payload_block, condition_checker) in `payload_index_impl/{str,int,uuid}.rs` into free functions over `T: MapIndexRead<N>`. Both `MapIndex<N>` and `ReadOnlyMapIndex<N, S>` now impl `PayloadFieldIndexRead` via thin delegation to those bodies. - Lifted `value_retriever` bodies in `value_indexer_impl.rs` the same way; `ReadOnlyMapIndex<N, S>` gets the per-K closure for free. - Added `telemetry_index_type` (required) + `get_telemetry_data` (default) to `MapIndexRead`, mirroring the `NullIndexRead` pattern; every map-index variant now reports telemetry without an inherent method on the enum. - Promoted `MapIndexRead` + its module to `pub` so `field_index_base/read_only/` can name them. - Implemented `FacetIndex for ReadOnlyMapIndex<N, S>` and extended `FacetIndexEnum` with `S: UniversalRead = MmapFile` plus the three read-only variants. `FieldIndex::as_facet_index` pins `S = MmapFile` via turbofish to keep inference happy. - `ReadOnlyFieldIndex::as_numeric` returns `None` for now; no concrete read-only numeric type exists yet (the doc on `NumericFieldIndexRead` already notes this is intended for a future `ReadOnlySegment`).
generall
added a commit
that referenced
this pull request
May 22, 2026
* rename mmap -> universal * [AI] Introduce `ReadOnlyMapIndex` and implement `MapIndexRead` for it * add missing file * [AI] Implement read-only PayloadFieldIndexRead / FieldIndexRead (#9026) Wires `ReadOnlyFieldIndex` into the read-only field-index surface that `ReadOnlyMapIndex` and `ReadOnlyNullIndex` already provide, sharing the non-trivial bodies with the existing `MapIndex` impls. - Extracted per-`N` `PayloadFieldIndexRead` bodies (filter, estimate_cardinality, for_each_payload_block, condition_checker) in `payload_index_impl/{str,int,uuid}.rs` into free functions over `T: MapIndexRead<N>`. Both `MapIndex<N>` and `ReadOnlyMapIndex<N, S>` now impl `PayloadFieldIndexRead` via thin delegation to those bodies. - Lifted `value_retriever` bodies in `value_indexer_impl.rs` the same way; `ReadOnlyMapIndex<N, S>` gets the per-K closure for free. - Added `telemetry_index_type` (required) + `get_telemetry_data` (default) to `MapIndexRead`, mirroring the `NullIndexRead` pattern; every map-index variant now reports telemetry without an inherent method on the enum. - Promoted `MapIndexRead` + its module to `pub` so `field_index_base/read_only/` can name them. - Implemented `FacetIndex for ReadOnlyMapIndex<N, S>` and extended `FacetIndexEnum` with `S: UniversalRead = MmapFile` plus the three read-only variants. `FieldIndex::as_facet_index` pins `S = MmapFile` via turbofish to keep inference happy. - `ReadOnlyFieldIndex::as_numeric` returns `None` for now; no concrete read-only numeric type exists yet (the doc on `NumericFieldIndexRead` already notes this is intended for a future `ReadOnlySegment`).
85 of 99 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Wires
ReadOnlyFieldIndexinto the read-only field-index surface thatReadOnlyMapIndexandReadOnlyNullIndexalready provide, sharing the non-trivial bodies with the existingMapIndeximpls — zero body duplication between the writable and read-only paths.NPayloadFieldIndexReadbodies extracted inpayload_index_impl/{str,int,uuid}.rsto free functions overT: MapIndexRead<N>(filter_impl,estimate_cardinality_impl,for_each_payload_block_impl,condition_checker_impl). BothMapIndex<N>andReadOnlyMapIndex<N, S>implPayloadFieldIndexReadvia thin delegation to those bodies.value_retrieverlifted invalue_indexer_impl.rsthe same way (value_retriever_str/int/uuid);ReadOnlyMapIndex<N, S>gets the per-K closure for free.MapIndexRead: addedtelemetry_index_type(required) +get_telemetry_data(default), mirroring theNullIndexReadpattern. Every map-index variant now reports telemetry without an inherent method on the enum.FacetIndex for ReadOnlyMapIndex<N, S>added;FacetIndexEnumextended withS: UniversalRead = MmapFileplus three new variants (KeywordReadOnly,IntReadOnly,UuidReadOnly).FieldIndex::as_facet_indexpinsS = MmapFilevia turbofish since the unused-by-this-variant generic is otherwise ambiguous.ReadOnlyFieldIndex::as_numericreturnsNone— no concrete read-only numeric type exists yet (the existingNumericFieldIndexReaddoc already notes this is intended for a futureReadOnlySegment).MapIndexRead+ its module promoted topubsofield_index_base/read_only/can name them.Test plan
cargo check -p segment --lib --testscargo clippy --workspace --all-targets -- -D warningscargo test -p segment --lib field_index::— 252/252 pass