Skip to content

Add opt-in Lucene vector field indexing to partitioned regions - #8154

Draft
gouthamaenugu wants to merge 5 commits into
apache:developfrom
gouthamaenugu:feature/GEODE-vector-pr1-knn-field
Draft

gouthamaenugu wants to merge 5 commits into
apache:developfrom
gouthamaenugu:feature/GEODE-vector-pr1-knn-field

Conversation

@gouthamaenugu

@gouthamaenugu gouthamaenugu commented Nov 24, 2026 •

Copy link
Copy Markdown

For all changes, please confirm:

  • Is there a JIRA ticket associated with this PR, and is it referenced in the commit message?
  • Is the PR based on the current develop commit?
  • Is the initial contribution a single, squashed commit?
  • Does the full gradlew build run cleanly?
  • Have you written or updated unit tests?
  • Are added dependencies compatible with ASF licensing? There are no new dependencies.

Summary

Add opt-in vector fields to geode-lucene indexes on partitioned regions. Geode applications can already use Lucene vectors through a custom LuceneSerializer. The Java API and cache.xml can now declare a vector field for the built-in serializers. Applications query the field with a Lucene KnnFloatVectorQuery via the existing LuceneQueryProvider API.

  • Support vector-only and mixed text/vector indexes and round-trip both configurations through cache.xml.
  • Index vectors using Lucene's default float32 format. Members compare the configured field names, dimensions, and similarities when establishing the index.
  • Omit a missing or malformed vector and replace the indexed document, so the previous vector disappears and valid text fields remain queryable.
  • Retain the prior index-profile wire format for older members. Enable vector fields after all members hosting the region are upgraded.

Review feedback is especially welcome on the Java API and index-profile compatibility. This draft is limited to configuring and indexing vector fields.

Verification

Temurin 17. The Lucene unit and integration suites recorded 313 and 331 passes respectively, with seven existing skips across both suites. The integration suite includes seven public API cases and six serialization checks. Formatting, POM, Javadoc, and assembly-contents checks passed. The existing distributed lexical rolling-upgrade test passed from Geode 2.0.4 with and without reindexing. A separate 1.15.6 run hit a Lucene segment-format error that also occurs on unmodified develop.

A local distributed smoke test with two data stores and a separate accessor verified vector results, removal of an invalid replacement, and rejection of a joining store with a different vector dimension.

OpenAI Codex assisted with the draft follow-up implementation, tests, and PR description.

@JinwooHwang

Copy link
Copy Markdown
Contributor

Welcome, @gouthamaenugu, and thank you for this contribution! Vector indexing is an exciting direction for geode-lucene, and the amount of care here shows: the detailed description, the unit tests, and the attention to keeping lexical-only indexes unchanged.

I've approved the CI workflows so you can get test signal while this is still a draft.

Since this adds public API and touches serialization and wire compatibility, a few steps will help it move smoothly:

  1. Design discussion on dev@geode.apache.org. A short proposal covering the API shape, the compatibility impact, and how the PRs in the series fit together lets the community weigh in before detailed code review.
  2. A JIRA ticket, with the PR title and commits updated to reference it.
  3. An ICLA on file with the ASF, if you haven't submitted one already, given the size of the contribution.
  4. The dependency order of the stacked PRs (I see this one and 8155), so reviewers know where to start.

One small question: a commit message refers to "critic findings PR1-B1 through PR1-B5". Could you share where that review lives, so the context is available to everyone?

Once the dev@ thread has settled and this is marked ready for review, I'll be glad to go through it in detail. Thanks again, and welcome to the community!

@gouthamaenugu

Copy link
Copy Markdown
Author

Thank you for the warm welcome and for approving the CI workflows, @JinwooHwang!

Here's where each of those items stands:

  1. dev@geode.apache.org design thread: I've just posted a [DISCUSS] thread ("[DISCUSS] Native HNSW Vector Indexing and Distributed Hybrid Search in geode-lucene for Geode 2.1") covering the public API shape, serialization/wire compatibility impact, and how the four draft PRs fit together.
  2. JIRA ticket: My ASF Jira account (gouthamaenugu) is now active. Once the dev@ thread settles on whether to track this under one umbrella GEODE ticket with subtasks or individual linked tickets, I'll file the ticket(s) and update the PR titles and squashed commits to reference them.
  3. ASF ICLA: I am preparing and submitting my ICLA to secretary@apache.org now.
  4. PR dependency & recommended review order:

On "critic findings PR1-B1 through PR1-B5" in commit 8a38329976: Those were labels from my own local pre-submission hardening checklist (not an external/private review). For full public context, the five items addressed in that commit were:

  • PR1-B1: VectorIndexMetadata ObjectInputFilter safety — serialize similarityFunctionName as a String instead of the third-party Lucene enum and enforce invariants in readObject.
  • PR1-B2: FlatFormatSerializer support for top-level and nested vector fields.
  • PR1-B3: Race-free ClassValue<ConcurrentHashMap<...>> field lookup cache in VectorFieldMapper.
  • PR1-B4: Defensive float[] copy on extraction plus float32 COSINE norm overflow/underflow validation.
  • PR1-B5: Reject duplicate vector field registrations and text/vector field-name collisions in LuceneIndexFactoryImpl.

When squashing the branch to reference the JIRA ticket before marking ready for review, I'll make sure the final commit message is completely self-contained without internal checklist labels. I'm also looking into the integrationTest failure from the CI run you enabled. Thanks again!

@JinwooHwang

Copy link
Copy Markdown
Contributor

Thanks for the thorough update, @gouthamaenugu, and for clarifying the PR1-B1 through B5 labels. Let's settle the JIRA structure on the dev@ thread, and take your time with the integrationTest failure.
Looking forward to the discussion on the list.

@gouthamaenugu gouthamaenugu changed the title GEODE-vector-pr1: Add KnnFloatVectorField, SQ8 Scalar Quantization Codec, Zero-Copy PDX Vector Mapping, and Bounded Segment Compaction Add opt-in Lucene vector field indexing to partitioned regions Nov 29, 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