You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@solr.apache.org by cp...@apache.org on 2024/02/22 10:18:47 UTC
(solr) branch jira/solr-13350 updated (ab895b101a0 -> 08088d1ca62)
This is an automated email from the ASF dual-hosted git repository.
cpoerschke pushed a change to branch jira/solr-13350
in repository https://gitbox.apache.org/repos/asf/solr.git
from ab895b101a0 factor out SolrMultiCollectorManager.scoreMode method
new a59fde7e0db reduce code duplication w.r.t. populateScoresIfNeeded and populateNextCursorMarkFromTopDocs
add e7051f9058f SOLR-17166 cloud.sh can't put solr.xml in zk anymore (#2279)
add bcb9f144974 SOLR-17058: Request param to disable distributed stats request at query time (#2046)
new 08088d1ca62 Merge remote-tracking branch 'origin/main' into jira/solr-13350
The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails. The revisions
listed as "add" were already present in the repository and have only
been added to this reference.
Summary of changes:
dev-tools/scripts/cloud.sh | 5 +-
solr/CHANGES.txt | 2 +
.../solr/handler/component/QueryComponent.java | 9 +++-
.../solr/handler/component/ResponseBuilder.java | 10 +++-
.../java/org/apache/solr/search/QueryCommand.java | 9 ++++
.../org/apache/solr/search/QueryResultKey.java | 16 ++++++-
.../org/apache/solr/search/SolrIndexSearcher.java | 32 +++++++------
.../org/apache/solr/core/QueryResultKeyTest.java | 17 +++++++
.../apache/solr/search/stats/TestDistribIDF.java | 53 ++++++++++++++++++++++
.../pages/solrcloud-distributed-requests.adoc | 11 +++++
.../apache/solr/common/params/CommonParams.java | 9 ++++
11 files changed, 150 insertions(+), 23 deletions(-)
(solr) 02/02: Merge remote-tracking branch 'origin/main' into jira/solr-13350
Posted by cp...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
cpoerschke pushed a commit to branch jira/solr-13350
in repository https://gitbox.apache.org/repos/asf/solr.git
commit 08088d1ca62b18c43b8b1ce6ddd788189a26fb44
Merge: a59fde7e0db bcb9f144974
Author: Christine Poerschke <cp...@apache.org>
AuthorDate: Thu Feb 22 10:14:08 2024 +0000
Merge remote-tracking branch 'origin/main' into jira/solr-13350
dev-tools/scripts/cloud.sh | 5 +-
solr/CHANGES.txt | 2 +
.../solr/handler/component/QueryComponent.java | 9 +++-
.../solr/handler/component/ResponseBuilder.java | 10 +++-
.../java/org/apache/solr/search/QueryCommand.java | 9 ++++
.../org/apache/solr/search/QueryResultKey.java | 16 ++++++-
.../org/apache/solr/search/SolrIndexSearcher.java | 8 +++-
.../org/apache/solr/core/QueryResultKeyTest.java | 17 +++++++
.../apache/solr/search/stats/TestDistribIDF.java | 53 ++++++++++++++++++++++
.../pages/solrcloud-distributed-requests.adoc | 11 +++++
.../apache/solr/common/params/CommonParams.java | 9 ++++
11 files changed, 140 insertions(+), 9 deletions(-)
(solr) 01/02: reduce code duplication w.r.t. populateScoresIfNeeded and populateNextCursorMarkFromTopDocs
Posted by cp...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
cpoerschke pushed a commit to branch jira/solr-13350
in repository https://gitbox.apache.org/repos/asf/solr.git
commit a59fde7e0dbe069766881c630861d3634eb70e10
Author: Christine Poerschke <cp...@apache.org>
AuthorDate: Thu Feb 22 10:12:16 2024 +0000
reduce code duplication w.r.t. populateScoresIfNeeded and populateNextCursorMarkFromTopDocs
---
.../org/apache/solr/search/SolrIndexSearcher.java | 24 +++++++++-------------
1 file changed, 10 insertions(+), 14 deletions(-)
diff --git a/solr/core/src/java/org/apache/solr/search/SolrIndexSearcher.java b/solr/core/src/java/org/apache/solr/search/SolrIndexSearcher.java
index ae9833d3bfd..fa689473fa1 100644
--- a/solr/core/src/java/org/apache/solr/search/SolrIndexSearcher.java
+++ b/solr/core/src/java/org/apache/solr/search/SolrIndexSearcher.java
@@ -1898,6 +1898,7 @@ public class SolrIndexSearcher extends IndexSearcher implements Closeable, SolrI
log.info("calling from 2, query: {}", query.getClass());
}
final TopDocs topDocs;
+ final ScoreMode scoreModeUsed;
if (!allowMT(pf.postFilter, cmd, query)) {
if (log.isInfoEnabled()) {
log.info("skipping collector manager");
@@ -1909,26 +1910,24 @@ public class SolrIndexSearcher extends IndexSearcher implements Closeable, SolrI
maxScoreCollector = new MaxScoreCollector();
collector = MultiCollector.wrap(topCollector, maxScoreCollector);
}
- final ScoreMode scoreModeUsed =
+ scoreModeUsed =
buildAndRunCollectorChain(qr, query, collector, cmd, pf.postFilter).scoreMode();
totalHits = topCollector.getTotalHits();
topDocs = topCollector.topDocs(0, len);
- hitsRelation = populateScoresIfNeeded(cmd, needScores, topDocs, query, scoreModeUsed);
- populateNextCursorMarkFromTopDocs(qr, cmd, topDocs);
maxScore =
totalHits > 0
? (maxScoreCollector == null ? Float.NaN : maxScoreCollector.getMaxScore())
: 0.0f;
- nDocsReturned = topDocs.scoreDocs.length;
-
} else {
if (log.isInfoEnabled()) {
log.info("using CollectorManager");
}
final SearchResult searchResult =
searchCollectorManagers(len, cmd, query, true, needScores, false);
+ scoreModeUsed = searchResult.scoreMode;
+
final Object[] res = searchResult.result;
final TopDocsResult result = (TopDocsResult) res[0];
@@ -1941,13 +1940,12 @@ public class SolrIndexSearcher extends IndexSearcher implements Closeable, SolrI
} else {
maxScore = Float.NaN;
}
-
- populateNextCursorMarkFromTopDocs(qr, cmd, topDocs);
- hitsRelation =
- populateScoresIfNeeded(cmd, needScores, topDocs, query, searchResult.scoreMode);
- nDocsReturned = topDocs.scoreDocs.length;
}
+ hitsRelation = populateScoresIfNeeded(cmd, needScores, topDocs, query, scoreModeUsed);
+ populateNextCursorMarkFromTopDocs(qr, cmd, topDocs);
+
+ nDocsReturned = topDocs.scoreDocs.length;
ids = new int[nDocsReturned];
scores = needScores ? new float[nDocsReturned] : null;
for (int i = 0; i < nDocsReturned; i++) {
@@ -2262,8 +2260,6 @@ public class SolrIndexSearcher extends IndexSearcher implements Closeable, SolrI
assert (totalHits == set.size()) || qr.isPartialResults();
topDocs = topCollector.topDocs(0, len);
- populateScoresIfNeeded(cmd, needScores, topDocs, query, ScoreMode.COMPLETE);
- populateNextCursorMarkFromTopDocs(qr, cmd, topDocs);
maxScore =
totalHits > 0
? (maxScoreCollector == null ? Float.NaN : maxScoreCollector.getMaxScore())
@@ -2294,8 +2290,6 @@ public class SolrIndexSearcher extends IndexSearcher implements Closeable, SolrI
}
}
- populateNextCursorMarkFromTopDocs(qr, cmd, topDocs);
- populateScoresIfNeeded(cmd, needScores, topDocs, query, ScoreMode.COMPLETE);
// TODO: Is this correct?
// hitsRelation = populateScoresIfNeeded(cmd, needScores, topDocs, query,
// searchResult.scoreMode);
@@ -2309,6 +2303,8 @@ public class SolrIndexSearcher extends IndexSearcher implements Closeable, SolrI
}
+ populateScoresIfNeeded(cmd, needScores, topDocs, query, ScoreMode.COMPLETE);
+ populateNextCursorMarkFromTopDocs(qr, cmd, topDocs);
nDocsReturned = topDocs.scoreDocs.length;
ids = new int[nDocsReturned];