Skip to content

feat: add readonly bool - #9030

Merged
dancixx merged 1 commit into
devfrom
feat/add-readonly-bool
May 13, 2026
Merged

dancixx merged 1 commit into
devfrom
feat/add-readonly-bool

Conversation

@dancixx

@dancixx dancixx commented May 13, 2026 •

Copy link
Copy Markdown
Contributor

All Submissions:

⚠️ PRs must target the dev branch. If your PR targets master, please change the base branch to dev before requesting a review.

  • My PR targets the dev branch (not master) and my branch was created from dev.
  • Have you followed the guidelines in our Contributing document?
  • Have you checked to ensure there aren't other open Pull Requests for the same update/change?

New Feature Submissions:

  1. Does your submission pass tests?
  2. Have you formatted your code locally using cargo +nightly fmt --all command prior to submission?
  3. Have you checked your code using cargo clippy --workspace --all-features command?

Changes to Core Features:

  • Have you added an explanation of what your changes do and why you'd like us to include them?
  • Have you written new tests for your core changes, as applicable?
  • Have you successfully ran tests with your changes locally?

@dancixx
dancixx marked this pull request as ready for review May 13, 2026 11:58
@coderabbitai

coderabbitai Bot commented May 13, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

This PR integrates ReadOnlyBoolIndex<S> throughout the read-only field indexing dispatch layer. It extracts the value retriever logic into a reusable function, implements FacetIndex for the read-only bool index, adds a BoolReadOnly variant to FacetIndexEnum, introduces a BoolIndex variant to ReadOnlyFieldIndex, and wires all trait methods in PayloadFieldIndexRead and FieldIndexRead to dispatch the new variant across counting, filtering, cardinality estimation, condition checking, telemetry, and facet operations.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

  • qdrant/qdrant#8764: Adds FacetIndex support for ReadOnlyBoolIndex via callback-based API refactor for bool indexes.
  • qdrant/qdrant#8978: Extends FieldIndexRead::value_retriever and read_view to delegate value extraction through per-index value_retriever methods.
  • qdrant/qdrant#9025: Extends read-only indexing dispatch by adding UniversalRead-generic FacetIndexEnum variants for read-only field indexes.

Suggested reviewers

  • generall
  • ffuugoo
  • coszio
🚥 Pre-merge checks | ✅ 2 | ❌ 3

❌ Failed checks (1 warning, 2 inconclusive)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 52.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
Title check ❓ Inconclusive The title 'feat: add readonly bool' is vague and generic, using non-descriptive terms that don't convey meaningful information about what 'readonly bool' refers to in this codebase. Consider expanding the title to be more specific, such as 'feat: add ReadOnlyBoolIndex support for facet indexing' or similar, to better describe the feature being added.
Description check ❓ Inconclusive The PR description consists only of a template checklist without any substantive explanation of the actual changes made by the pull request. Add a meaningful description explaining what the readonly bool feature does, why it's needed, and how it affects the codebase beyond just the template checklist.
✅ Passed checks (2 passed)
Check name Status Explanation
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/add-readonly-bool

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick comments (1)
lib/segment/src/index/field_index/field_index_base/read_only/read_ops.rs (1)

21-199: ⚡ Quick win

Add focused coverage for the new read-only bool dispatch paths.

This wiring touches many match-based entry points; adding targeted tests for ReadOnlyFieldIndex::BoolIndex (including as_facet_index → FacetIndexEnum::BoolReadOnly) will harden against future variant drift.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@lib/segment/src/index/field_index/field_index_base/read_only/read_ops.rs`
around lines 21 - 199, Add focused unit tests that exercise the
ReadOnlyFieldIndex::BoolIndex variant across all dispatch points to prevent
regression: create a ReadOnlyFieldIndex::BoolIndex instance and assert behavior
for count_indexed_points(), filter(...), estimate_cardinality(...),
for_each_payload_block(...), condition_checker(...),
special_check_condition(...), get_telemetry_data(),
values_count()/values_is_empty(), value_retriever(...), as_numeric() returning
None, and as_facet_index() returning a FacetIndexEnum::BoolReadOnly; use the
exact enums and methods named (ReadOnlyFieldIndex, BoolIndex,
FacetIndexEnum::BoolReadOnly, MapIndexRead/BoolIndexRead/NullIndexRead helpers
where relevant) so the tests hit each match arm shown in the impl and fail if
future variant dispatch breaks.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Nitpick comments:
In `@lib/segment/src/index/field_index/field_index_base/read_only/read_ops.rs`:
- Around line 21-199: Add focused unit tests that exercise the
ReadOnlyFieldIndex::BoolIndex variant across all dispatch points to prevent
regression: create a ReadOnlyFieldIndex::BoolIndex instance and assert behavior
for count_indexed_points(), filter(...), estimate_cardinality(...),
for_each_payload_block(...), condition_checker(...),
special_check_condition(...), get_telemetry_data(),
values_count()/values_is_empty(), value_retriever(...), as_numeric() returning
None, and as_facet_index() returning a FacetIndexEnum::BoolReadOnly; use the
exact enums and methods named (ReadOnlyFieldIndex, BoolIndex,
FacetIndexEnum::BoolReadOnly, MapIndexRead/BoolIndexRead/NullIndexRead helpers
where relevant) so the tests hit each match arm shown in the impl and fail if
future variant dispatch breaks.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: a57d9fda-6212-4c75-a003-89e041c9746c

📥 Commits

Reviewing files that changed from the base of the PR and between 2861c61 and d42b98a.

📒 Files selected for processing (5)
  • lib/segment/src/index/field_index/bool_index/mod.rs
  • lib/segment/src/index/field_index/bool_index/read_ops.rs
  • lib/segment/src/index/field_index/facet_index.rs
  • lib/segment/src/index/field_index/field_index_base/read_only/mod.rs
  • lib/segment/src/index/field_index/field_index_base/read_only/read_ops.rs

@dancixx
dancixx merged commit c80337c into dev May 13, 2026
15 checks passed
@dancixx
dancixx deleted the feat/add-readonly-bool branch May 13, 2026 12:39
@coderabbitai coderabbitai Bot mentioned this pull request May 14, 2026
3 tasks done
generall pushed a commit that referenced this pull request May 22, 2026
@generall generall added this to the Live-reload milestone May 30, 2026
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.

2 participants