@Test public void queryAllOne() { }
@RequestMapping("/queryAllOne") public String queryAllOne() throws IOException, SolrServerException { SolrQuery query = new SolrQuery(); query.setQuery("*:*"); query.add("q", "name:然"); QueryResponse response = solrClient.query(query); SolrDocumentList docs = response.getResults(); long numFound = docs.getNumFound(); System.out.println("总共查询到的文档数量： " + numFound); return docs.toString(); }
SolrController { @RequestMapping("/queryAllOne") public String queryAllOne() throws IOException, SolrServerException { SolrQuery query = new SolrQuery(); query.setQuery("*:*"); query.add("q", "name:然"); QueryResponse response = solrClient.query(query); SolrDocumentList docs = response.getResults(); long numFound = docs.getNumFound(); System.out.println("总共查询到的文档数量： " + numFound); return docs.toString(); } }
SolrController { @RequestMapping("/queryAllOne") public String queryAllOne() throws IOException, SolrServerException { SolrQuery query = new SolrQuery(); query.setQuery("*:*"); query.add("q", "name:然"); QueryResponse response = solrClient.query(query); SolrDocumentList docs = response.getResults(); long numFound = docs.getNumFound(); System.out.println("总共查询到的文档数量： " + numFound); return docs.toString(); }  }
SolrController { @RequestMapping("/queryAllOne") public String queryAllOne() throws IOException, SolrServerException { SolrQuery query = new SolrQuery(); query.setQuery("*:*"); query.add("q", "name:然"); QueryResponse response = solrClient.query(query); SolrDocumentList docs = response.getResults(); long numFound = docs.getNumFound(); System.out.println("总共查询到的文档数量： " + numFound); return docs.toString(); }  @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(); }
SolrController { @RequestMapping("/queryAllOne") public String queryAllOne() throws IOException, SolrServerException { SolrQuery query = new SolrQuery(); query.setQuery("*:*"); query.add("q", "name:然"); QueryResponse response = solrClient.query(query); SolrDocumentList docs = response.getResults(); long numFound = docs.getNumFound(); System.out.println("总共查询到的文档数量： " + numFound); return docs.toString(); }  @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();  }