Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cuvs-java: Evaluate adding a query mapping function (avoids reifying a mapping list) #699

Open
ChrisHegarty opened this issue Feb 14, 2025 · 0 comments

Comments

@ChrisHegarty
Copy link
Contributor

This issue has been filed to evaluate modifying the Builder withMapping(List<Integer> mapping) API, so that it does not require to reify a concrete list of map ids.

For example:

List<Integer> map =...

var query = new CagraQuery.Builder()
        .withMapping(map)

From my understanding a function of int -> int is sufficient. Maybe an additional size(). For Lucene this would work better than reifying the ordinal to doc mapping as a list.

e.g.

Builder withMapping(MappingFunction ordToDocFunc)

@FunctionalInterface
public interface MappingFunction {
  /** The given a vector ordinal returns a docId */
  int apply(int value);

  int size(); // if needed
}
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

No branches or pull requests

1 participant