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

Explain API changes #2403

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

neetikasinghal
Copy link

@neetikasinghal neetikasinghal commented Jan 17, 2025

Description

Explain API high level changes for the POC.

Related Issues

Resolves #875

Check List

  • New functionality includes testing.
  • New functionality has been documented.
  • API changes companion pull request created.
  • Commits are signed per the DCO using --signoff.
  • Public documentation issue/PR created.

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.

Signed-off-by: Neetika Singhal <[email protected]>
Copy link
Contributor

@Vikasht34 Vikasht34 left a comment

Choose a reason for hiding this comment

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

We need to have Unit test for each case

  1. Disk-based search with valid rescore context.
  2. Radial search.
  3. ANN search (default case).
  4. Shard-level rescoring enabled.
  5. Shard-level rescoring disabled.
  6. Filter weight case where filtered IDs are less than k.
  7. Filter threshold value greater than cardinality.
  8. Missing native engine files.
  9. Valid context with matching document and disk-based search.

And Please validate with Explaination Object.

@@ -106,7 +110,100 @@ static void initialize(ModelDao modelDao, ExactSearcher exactSearcher) {

@Override
public Explanation explain(LeafReaderContext context, int doc) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Could we improve readability of this function , I see this function is doing

  1. Building Score
  2. Build the main explanation
  3. Build the detailed explanation for the leaf node.

Would we start with something simple

public Explanation explain(LeafReaderContext context, int doc) {
   //Function to Calculate Score
    // Build the main explanation

      // Build the detailed explanation for the leaf node
    return Explanation.match(score, mainExplanation, Explanation.match(score, leafExplanation));
}

And Please break down other functions as well when needed.

Copy link
Author

Choose a reason for hiding this comment

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

sure i will refactor this.

@neetikasinghal
Copy link
Author

We need to have Unit test for each case

  1. Disk-based search with valid rescore context.
  2. Radial search.
  3. ANN search (default case).
  4. Shard-level rescoring enabled.
  5. Shard-level rescoring disabled.
  6. Filter weight case where filtered IDs are less than k.
  7. Filter threshold value greater than cardinality.
  8. Missing native engine files.
  9. Valid context with matching document and disk-based search.

And Please validate with Explaination Object.

@Vikasht34 yes the tests are not yet added in here, hence its in a draft status. I will add the coverage with all the possible cases.

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.

[BUG] Explain API not compatible with k-NN queries
2 participants