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

Add RRF tests #992

Conversation

ryanbogan
Copy link
Member

@ryanbogan ryanbogan commented Nov 18, 2024

Description

[Describe what this change achieves]

Related Issues

Resolves #[Issue number to be closed when this PR is merged]

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.

assertEquals(3, hitsList.size());
assertEquals(0.016393442, (Double) hitsList.getFirst().get("_score"), DELTA_FOR_SCORE_ASSERTION);
assertEquals(0.016129032, (Double) hitsList.get(1).get("_score"), DELTA_FOR_SCORE_ASSERTION);
assertEquals(0.015873017, (Double) hitsList.getLast().get("_score"), DELTA_FOR_SCORE_ASSERTION);
Copy link
Member

Choose a reason for hiding this comment

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

you need to have a resource cleanup block, please check how it's done in other tests (code ref)

}

@SneakyThrows
private void createDefaultRRFSearchPipeline() {
Copy link
Member

Choose a reason for hiding this comment

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

check if we can extend the existing method in base class or at least move this method there

Copy link
Member Author

Choose a reason for hiding this comment

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

I was trying to do that, but it requires the method in the base class requires a normalization input and the rrf pipeline doesn't have one. Unless there's something I'm missing, we should just move it to the base class.

}

@SneakyThrows
private Map<String, Object> searchRRF(String modelId) {
Copy link
Member

Choose a reason for hiding this comment

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

why can't we use existing method from base class, https://github.com/opensearch-project/neural-search/blob/main/src/testFixtures/java/org/opensearch/neuralsearch/BaseNeuralSearchIT.java#L494-L501 or one of it variant. Only customization for RRF is a pipeline name that can be passed as parameter (code ref)

@ryanbogan ryanbogan changed the title Add RRF integ test Add RRF tests Nov 19, 2024
@martin-gaievski martin-gaievski force-pushed the feature/rrf-score-normalization-v2 branch from bcb9df5 to 74c99c5 Compare November 19, 2024 21:58
@ryanbogan
Copy link
Member Author

Commit history met up again. I'll open new PR and link: #997

@ryanbogan ryanbogan closed this Nov 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants