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

Update TermsQuery and TermsSetQuery and add tests #546

Merged
merged 1 commit into from
Sep 3, 2024

Conversation

prudhvigodithi
Copy link
Contributor

Description

  • Created schema for Terms.
  • Updated TermsQuery and TermsSetQuery to use the Terms schema.
  • Add unit tests for TermsQuery and TermsSetQuery.

Issues Resolved

Part of #540

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.

Copy link

github-actions bot commented Aug 30, 2024

Changes Analysis

Commit SHA: 7cb604a
Comparing To SHA: 30f1846

API Changes

Summary

└─┬Components
  ├──[➕] schemas (38410:7)
  ├─┬_common.query_dsl:TermsQuery
  │ ├──[➕] anyOf (38410:7)
  │ ├──[➕] anyOf (37704:7)
  │ ├──[➖] allOf (38412:11)❌ 
  │ └──[➖] allOf (37704:7)❌ 
  └─┬_common.query_dsl:TermsSetQuery
    └─┬ALLOF
      └─┬terms
        └──[🔀] $ref (38411:9)❌ 

Document Element Total Changes Breaking Changes
components 6 4
  • BREAKING Changes: 4 out of 6
  • Modifications: 1
  • Removals: 2
  • Additions: 3
  • Breaking Removals: 2
  • Breaking Modifications: 1

Report

The full API changes report is available at: https://github.com/opensearch-project/opensearch-api-specification/actions/runs/10688023181/artifacts/1887360554

API Coverage

Before After Δ
Covered (%) 533 (52.2 %) 533 (52.2 %) 0 (0 %)
Uncovered (%) 488 (47.8 %) 488 (47.8 %) 0 (0 %)
Unknown 26 26 0

Copy link

Spec Test Coverage Analysis

Total Tested
559 249 (44.54 %)

Copy link
Member

@dblock dblock left a comment

Choose a reason for hiding this comment

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

Nice!

I think we should rename and organize the .yaml test filenames into folders consistently with the keywords used.

  • tests/default/_core/search/terms_query_field.yaml is a query with terms, so tests/default/_core/search/query/terms.yaml
  • terms_query_multiple is a variation of the first one, so you should combine them
  • terms_set_query is a query with terms_set, so it becomes query/terms_set.yaml

Generally we're not testing OpenSearch, just the schema. No need to test response bodies.

Finally, we also plan to use these tests to auto-generate documentation, so consistency becomes important (too many docs are all over the place when it comes to kinds of examples) - try to simplify these tests as much as possible. Try only using our canoical movies and games examples used elsewhere instead of introducing new types of things (classes, students).

I have some more nitpicky comments, see which ones make sense to you.

CHANGELOG.md Outdated Show resolved Hide resolved
CHANGELOG.md Outdated Show resolved Hide resolved
CHANGELOG.md Outdated Show resolved Hide resolved
CHANGELOG.md Outdated Show resolved Hide resolved
payload:
name: John Doe
student_id: '333'
status: [201]
Copy link
Member

Choose a reason for hiding this comment

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

A lot of this can be replaced with a much shorter version with _bulk. Look for it in other tests.

tests/default/_core/search/terms_query_multiple.yaml Outdated Show resolved Hide resolved
tests/default/_core/search/terms_set_query.yaml Outdated Show resolved Hide resolved
@prudhvigodithi
Copy link
Contributor Author

Thanks @dblock I have updated the PR addressing your comments, please take a look.

Copy link
Member

@dblock dblock left a comment

Choose a reason for hiding this comment

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

Tiny nit of ,<space>.

tests/default/_core/search/query/terms.yaml Outdated Show resolved Hide resolved
tests/default/_core/search/query/terms_set.yaml Outdated Show resolved Hide resolved
tests/default/_core/search/query/terms_set.yaml Outdated Show resolved Hide resolved
Signed-off-by: Prudhvi Godithi <pgodithi@amazon.com>
@prudhvigodithi
Copy link
Contributor Author

Updated @dblock, please check.

Copy link
Member

@dblock dblock left a comment

Choose a reason for hiding this comment

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

👏

@dblock dblock merged commit 147e77e into opensearch-project:main Sep 3, 2024
17 checks passed
@dblock
Copy link
Member

dblock commented Sep 3, 2024

If you're looking for more work @prudhvigodithi, #548 looks like it's a bit more involved, might also need doc fixes.

@prudhvigodithi
Copy link
Contributor Author

Sure @dblock.
Thanks
@getsaurabh02

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.

2 participants