You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@solr.apache.org by "psalagnac (via GitHub)" <gi...@apache.org> on 2026/09/11 15:10:31 UTC
Re: [PR] SOLR-18305: Ensure that when query limits are used the correct similarity is used for different types of queries. [solr]
psalagnac commented on code in PR #4898:
URL: https://github.com/apache/solr/pull/4898#discussion_r3990532852
##########
solr/core/src/java/org/apache/solr/search/SolrIndexSearcher.java:
##########
@@ -791,6 +792,17 @@ public QueryResult search(QueryCommand cmd) throws IOException {
return getDocListC(cmd);
}
+ // make sure that searchLeaf searches with QueryLimits never call the
+ // throwaway's IndexSearcher similarity
+ private static final Similarity GUARD_SIMILARITY =
+ new Similarity() {
+ @Override
+ public SimScorer scorer(
+ float boost, CollectionStatistics collectionStats, TermStatistics... termStats) {
+ throw new UnsupportedOperationException("should never be invoked here!");
Review Comment:
Should we throw a `SolrException` with error 500 instead?
I think there is dedicated error handling so the response to the client has more details.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@solr.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@solr.apache.org
For additional commands, e-mail: issues-help@solr.apache.org