gus-asf commented on code in PR #2666: URL: https://github.com/apache/solr/pull/2666#discussion_r1731444666
########## solr/core/src/java/org/apache/solr/response/SolrQueryResponse.java: ########## @@ -139,30 +142,63 @@ public ReturnFields getReturnFields() { /** * If {@link #getResponseHeader()} is available, set {@link #RESPONSE_HEADER_PARTIAL_RESULTS_KEY} - * flag to true. + * attribute to true or "omitted" as required. */ - public void setPartialResults() { + public void setPartialResults(SolrQueryRequest req) { NamedList<Object> header = getResponseHeader(); - if (header != null - && header.get(SolrQueryResponse.RESPONSE_HEADER_PARTIAL_RESULTS_KEY) == null) { - header.add(SolrQueryResponse.RESPONSE_HEADER_PARTIAL_RESULTS_KEY, Boolean.TRUE); + if (header != null) { + if (header.get(SolrQueryResponse.RESPONSE_HEADER_PARTIAL_RESULTS_KEY) == null) { + Object value = partialResultsStatus(shouldDiscardPartials(req.getParams())); + header.add(SolrQueryResponse.RESPONSE_HEADER_PARTIAL_RESULTS_KEY, value); + } } } + public static Object partialResultsStatus(boolean discarding) { + return discarding ? "omitted" : Boolean.TRUE; Review Comment: It could be. Though it only gets used here and in one assert in one test right now. -- 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-unsubscr...@solr.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: issues-unsubscr...@solr.apache.org For additional commands, e-mail: issues-h...@solr.apache.org