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

Fix permissive fields in relevance queries. #150

Conversation

forestmvey
Copy link

Signed-off-by: forestmvey [email protected]

Description

Relevance functions that query a field should act similar to how a SELECT query works. If a field is queried that does not exist, a SemanticCheckException should be thrown.

Issues Resolved

Issue: 613

Check List

  • New functionality includes testing.
    • All tests pass, including unit test, integration test and doctest
  • New functionality has been documented.
    • New functionality has javadoc added
    • New functionality has user manual doc added
  • Commits are signed per the DCO using --signoff

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.

@codecov
Copy link

codecov bot commented Nov 1, 2022

Codecov Report

❗ No coverage uploaded for pull request base (draft-integ-permissive-relevance-fields@98b8469). Click here to learn what that means.
The diff coverage is n/a.

@@                            Coverage Diff                             @@
##             draft-integ-permissive-relevance-fields     #150   +/-   ##
==========================================================================
  Coverage                                           ?   94.99%           
  Complexity                                         ?     3221           
==========================================================================
  Files                                              ?      318           
  Lines                                              ?     8715           
  Branches                                           ?      640           
==========================================================================
  Hits                                               ?     8279           
  Misses                                             ?      382           
  Partials                                           ?       54           
Flag Coverage Δ
query-workbench 62.76% <0.00%> (?)
sql-engine 97.62% <0.00%> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

Copy link

@MaxKsyunz MaxKsyunz left a comment

Choose a reason for hiding this comment

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

This PR re-implements the SingleFieldQuery, MultiFieldQuery, NoFieldQuery class structure.

I'm checking to see if this can be implemented in those classes.

Field validation does not have to happen at analyze stage -- it can happen later. Relevance function parameters are a good example of this.

@MaxKsyunz
Copy link

@forestmvey how are wildcards be treated?

For a query like multi_match(['prefix*'], ...), will it check that there are fields that begin with prefix?

@forestmvey forestmvey force-pushed the draft-fix-permissive-query-fields branch from c2d2643 to b6a6add Compare November 3, 2022 13:43
@forestmvey
Copy link
Author

@forestmvey how are wildcards be treated?

For a query like multi_match(['prefix*'], ...), will it check that there are fields that begin with prefix?

I implemented that wildcard will not verify for valid fields, but will simply return OS results. So in the event of no fields beginning with prefix, 0 rows will be returned. Do you think we should try to check for fields that match a provided wildcard?

@forestmvey
Copy link
Author

This PR re-implements the SingleFieldQuery, MultiFieldQuery, NoFieldQuery class structure.

I'm checking to see if this can be implemented in those classes.

Field validation does not have to happen at analyze stage -- it can happen later. Relevance function parameters are a good example of this.

Good point! It would be good to not add another class if possible.

@forestmvey forestmvey closed this Nov 7, 2022
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.

3 participants