Skip to content

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

Open
@ChrisHegarty

Description

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
}

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions