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-17058: Request param to disable distributed stats request at query time #2046

Merged
merged 16 commits into from
Feb 21, 2024

Conversation

weiwang19
Copy link
Contributor

@weiwang19 weiwang19 commented Oct 28, 2023

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

Description

When distributed IDF is enabled in solr cloud by adding one of the cache implementations in solrconfig.xml https://solr.apache.org/guide/solr/latest/deployment-guide/solrcloud-distributed-requests.html#distributedidf, each solr query will incur a distributed shard request to get term statistics. For queries that does not use distributed IDF information for scoring, the stats request is not necessary.

Solution

Hence I propose to add a distrib.statsCache request param so that the distributed stats request can be disabled at query time.

  1. distrib.statsCache defaults to true. When the param is not present, there is no change to current distributed IDF behavior.
  2. When explicitly set distrib.statsCache=false, distributed stats call is disabled for the current query.

Tests

Added unit tests related to distrib IDF and query result key.

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
Member

@mkhludnev mkhludnev left a comment

Choose a reason for hiding this comment

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

@weiwang19 thank you so much for the contribution! I think it's worthwhile to add. I want to share my opinion, it's quite flexible though.

@weiwang19 weiwang19 requested a review from mkhludnev November 29, 2023 17:04
@mkhludnev
Copy link
Member

Thanks @weiwang19
I'll check it next week.
@devs please chime in - I always hesitate to come up with names in API!

@weiwang19
Copy link
Contributor Author

please let me know if there are any concerns to address.

@mkhludnev
Copy link
Member

please let me know if there are any concerns to address.

pls check weiwang19#1

SOLR-170588: more explicit asserts
@github-actions github-actions bot added documentation Improvements or additions to documentation client:solrj tests cat:search labels Feb 21, 2024
@weiwang19
Copy link
Contributor Author

Done with the changes. Thank you so much @mkhludnev

@mkhludnev mkhludnev self-assigned this Feb 21, 2024
@mkhludnev mkhludnev merged commit bcb9f14 into apache:main Feb 21, 2024
4 checks passed
@mkhludnev
Copy link
Member

Thanks, @weiwang19. Would you mind to create cherrypick PR to branch_9x?

weiwang19 added a commit to weiwang19/solr that referenced this pull request Feb 21, 2024
…ry time (apache#2046)

* add param to disable distrib stats at query time

---------

Co-authored-by: wwang30 <[email protected]>
Co-authored-by: Mikhail Khludnev <[email protected]>
@weiwang19 weiwang19 mentioned this pull request Feb 21, 2024
7 tasks
@weiwang19
Copy link
Contributor Author

@mkhludnev can you help check the PR for backport to 9x? #2291

mkhludnev added a commit that referenced this pull request Feb 21, 2024
…ry time (#2291)

* SOLR-17058: Request param to disable distributed stats request at query time (#2046)

Co-authored-by: wwang30 <[email protected]>
Co-authored-by: Mikhail Khludnev <[email protected]>
mkhludnev added a commit that referenced this pull request Mar 15, 2024
mkhludnev added a commit to mkhludnev/solr that referenced this pull request Mar 15, 2024
mkhludnev added a commit that referenced this pull request Mar 15, 2024
alessandrobenedetti pushed a commit to SeaseLtd/solr that referenced this pull request Mar 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cat:search client:solrj documentation Improvements or additions to documentation tests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants