serhiy-bzhezytskyy commented on code in PR #4640:
URL: https://github.com/apache/solr/pull/4640#discussion_r3998848307


##########
solr/solrj/src/java/org/apache/solr/client/solrj/response/ResponseParser.java:
##########
@@ -67,4 +82,19 @@ public abstract NamedList<Object> 
processResponse(InputStream body, String encod
    * @return the MIME types that this parser is capable of parsing. Never null.
    */
   public abstract Set<String> getContentTypes();
+
+  /**
+   * Parses the response and returns it in the canonical shape the SolrJ 
response classes expect: a
+   * {@link NamedList} tree with {@link 
org.apache.solr.common.SolrDocumentList} for document
+   * sections.
+   *
+   * <p>Most parsers produce that shape directly and inherit this method 
unchanged. A parser whose
+   * natural output is a raw structure of {@code Map}s and {@code List}s — 
such as the JSON map
+   * parser — overrides it to convert, so that the conversion is the parser's 
own responsibility
+   * rather than something a client has to know to apply.
+   */
+  public NamedList<Object> processCanonicalResponse(InputStream body, String 
encoding)

Review Comment:
   Agreed, removed. CanonicalJsonResponseParser now overrides processResponse 
directly; HttpSolrClient and EmbeddedSolrServer call processResponse instead of 
processCanonicalResponse. Checked the other direct processResponse callers 
first: the two tests that call it on a JSON parser construct 
JsonMapResponseParser, not the canonical subclass, so unaffected; 
ConcurrentUpdateBaseSolrClient's error-parsing path already branches on 
NamedList vs List for exactly this raw/canonical ambiguity, so a canonical 
result reaching it now is not a behaviour change worth guarding against.



-- 
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