dsmiley commented on code in PR #2764: URL: https://github.com/apache/solr/pull/2764#discussion_r1862970143
########## solr/core/src/java/org/apache/solr/handler/designer/SchemaDesignerConfigSetHelper.java: ########## @@ -525,40 +495,22 @@ void deleteStoredSampleDocs(String configSet) { @SuppressWarnings("unchecked") List<SolrInputDocument> getStoredSampleDocs(final String configSet) throws IOException { - List<SolrInputDocument> docs = null; - - final URI uri; - try { - uri = - collectionApiEndpoint(BLOB_STORE_ID, "blob", configSet + "_sample") - .setParameter(CommonParams.WT, "filestream") - .build(); - } catch (URISyntaxException e) { - throw new SolrException(SolrException.ErrorCode.BAD_REQUEST, e); - } - - HttpGet httpGet = new HttpGet(uri); + var request = new GenericSolrRequest(SolrRequest.METHOD.GET, "/blob/" + configSet + "_sample"); + request.setRequiresCollection(true); + request.setResponseParser(new InputStreamResponseParser("filestream")); Review Comment: I played with this method a bit, hoping to remove InputStream low level stuff but there seems to be something special about "filestream" so I left this aspect as is. Besides, the response handling is pretty concise nonetheless. ########## solr/modules/sql/src/test/org/apache/solr/handler/sql/TestSQLHandler.java: ########## Review Comment: changes here look DRAFT-y ########## solr/core/src/test/org/apache/solr/handler/designer/TestSchemaDesignerConfigSetHelper.java: ########## @@ -280,15 +281,11 @@ public void testAnalyzeField() throws Exception { helper.addSchemaObject(configSet, Collections.singletonMap("add-field", addField)); assertEquals("title", addedFieldName); - Map<String, Object> analysis = + NamedList<Object> analysis = helper.analyzeField(configSet, "title", "The Pillars of the Earth"); - Map<String, Object> title = - (Map<String, Object>) ((Map<String, Object>) analysis.get("field_names")).get("title"); - assertNotNull(title); - List<Object> index = (List<Object>) title.get("index"); - assertNotNull(index); - assertFalse(index.isEmpty()); + var indexNl = (NamedList<Object>) analysis.findRecursive("field_names", "title", "index"); Review Comment: shows the usefulness of NamedList.findRecursive ########## solr/core/src/java/org/apache/solr/handler/designer/SchemaDesignerConfigSetHelper.java: ########## @@ -125,46 +119,22 @@ class SchemaDesignerConfigSetHelper implements SchemaDesignerConstants { } @SuppressWarnings("unchecked") - Map<String, Object> analyzeField(String configSet, String fieldName, String fieldText) + NamedList<Object> analyzeField(String configSet, String fieldName, String fieldText) Review Comment: returning NamedList now (more Solr native); didn't need the Map conversion or JSON stuff or InputStream low level stuff -- 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