apache / apache/lucene

Should we create a static factory method for loading VectorValues? [LUCENE-10426]

Open
#11,462 2 comments 0 reactions 0 assignees View on GitHub
legacy-jira-priority:Minor module:core/index type:enhancement
Dominant language
Java
Stars
3.6k
Forks
1.4k
Avg merge
2d 11h
Merged PRs (30d)
88

Description

Similar to the recent work in #11434, it might be useful to add a static factory method for loading `VectorValues` that returns an "empty" `VectorValues` instance if the field doesn't exist in a segment (and also throws if the field is not configured as a vector field). This follows the same pattern of the static factory methods found in `DocValues`}. 

I'm less convinced this is useful to add right now since I don't really see any existing usages of `LeafReader#getVectorValues`}, so maybe the value isn't there right now?

---
Migrated from [LUCENE-10426](https://issues.apache.org/jira/browse/LUCENE-10426) by Greg Miller (@gsmiller)

Contributor guide

Open the contributing guide

Research direction

Compare the recent work in #11434 with the static factory methods in DocValues, then inspect usages of LeafReader#getVectorValues. Decide whether a factory for loading VectorValues should provide an empty instance for missing fields and reject non-vector fields; the issue is done when the API need and behavior are resolved.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
search
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.