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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to