solr icon indicating copy to clipboard operation
solr copied to clipboard

SOLR-16953: Grouped fields are handled in edismax clauses

Open psalagnac opened this issue 2 years ago • 2 comments

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:

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

psalagnac avatar Sep 06 '23 09:09 psalagnac

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 [email protected] mailing list. Thank you for your contribution!

github-actions[bot] avatar Feb 03 '24 00:02 github-actions[bot]

Commenting to avoid auto-close

dsmiley avatar Sep 30 '24 04:09 dsmiley

This PR has had no activity for 60 days and is now labeled as stale. Any new activity will remove the stale label. To attract more reviewers, please tag people who might be familiar with the code area and/or notify the [email protected] mailing list. To exempt this PR from being marked as stale, make it a draft PR or add the label "exempt-stale". If left unattended, this PR will be closed after another 60 days of inactivity. Thank you for your contribution!

github-actions[bot] avatar Dec 01 '24 00:12 github-actions[bot]

This PR is now closed due to 60 days of inactivity after being marked as stale. Re-opening this PR is still possible, in which case it will be marked as active again.

github-actions[bot] avatar Jan 31 '25 00:01 github-actions[bot]