SolrController { @RequestMapping("/getById/{id}") public String getByIdFromSolr(@PathVariable("id") String id) throws IOException, SolrServerException { SolrDocument solrDocument = solrClient.getById(id); Collection<String> fieldNames = solrDocument.getFieldNames(); Map<String, Object> fieldValueMap = solrDocument.getFieldValueMap(); List<SolrDocument> childDocuments = solrDocument.getChildDocuments(); String results = solrDocument.toString(); return results; }  @RequestMapping("/addUsers") void addUsers(); @RequestMapping("/addUser") void addUser(); @RequestMapping("/getById/{id}") String getByIdFromSolr(@PathVariable("id") String id); @RequestMapping("/updateUser") void updateUser(); @RequestMapping("/delById/{id}") String delById(@PathVariable("id") String id); @RequestMapping("/delAll") void delAll(); @RequestMapping("/queryAllOne") String queryAllOne(); @RequestMapping("/queryAll") Object queryAll();  }
@Test public void getByIdFromSolr() throws IOException, SolrServerException { String id="8888888"; SolrDocument solrDocument = solrClient.getById(id); Collection<String> fieldNames = solrDocument.getFieldNames(); Map<String, Object> fieldValueMap = solrDocument.getFieldValueMap(); List<SolrDocument> childDocuments = solrDocument.getChildDocuments(); String results = solrDocument.toString(); System.out.println(results); }