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 boost parameter to Terms query #54

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

floristenhove
Copy link
Contributor

@floristenhove floristenhove commented Oct 22, 2024

  • Adds support for the boost parameter in TermsQuery, similar to Add boost parameter to MatchQuery #42.
  • Updates the boost condition in MatchQuery to check for not null values instead of falsy values.

'terms' => [
$this->field => $this->value,
],
];

if ($this->boost) {
Copy link
Contributor

@dam-bal dam-bal Oct 24, 2024

Choose a reason for hiding this comment

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

what if we want to apply boost of 0? this won't work as expected, it would be better to check if it's not null instead

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Great suggestion. I thought I'd keep it in line with the existing MatchQuery but this is better. I've updated the MatchQuery as well now, or would you like a separate PR for this?

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