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

SOLR-16953: Grouped fields are handled in edismax clauses #1893

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

Conversation

psalagnac
Copy link
Contributor

https://issues.apache.org/jira/browse/SOLR-16953

Description

ExtendedDismaxParser generates boosts queries from parameter pf for unwanted terms when using grouped fields (queries similar to field:(term1 term2 term3) ).
term1 is skipped as expected, but term2 and term3, are unexpectedly added in the generated boost query. This is because the field is not added to term2 and term3 in the output of splitIntoClauses() method.

Solution

In splitIntoClauses(), set the field to all clauses that are created when parsing terms with a grouped field.
In the example, we set the field to term1, term2 and term3.

Tests

Added two cases in TestExtendedDismaxParser to ensure generated clauses are correct and we return records in the correct order.

Checklist

Please review the following and check all that apply:

  • I have reviewed the guidelines for How to Contribute and my code conforms to the standards described there to the best of my ability.
  • I have created a Jira issue and added the issue ID to my pull request title.
  • I have given Solr maintainers access to contribute to my PR branch. (optional but recommended)
  • I have developed this patch against the main branch.
  • I have run ./gradlew check.
  • I have added tests for my changes.
  • I have added documentation for the Reference Guide

Copy link

github-actions bot commented Feb 3, 2024

This PR had no visible activity in the past 60 days, labeling it as stale. Any new activity will remove the stale label. To attract more reviewers, please tag someone or notify the dev@solr.apache.org mailing list. Thank you for your contribution!

@github-actions github-actions bot added the stale PR not updated in 60 days label Feb 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
stale PR not updated in 60 days
Projects
None yet
1 participant