什么是HttpSolrServer的替换solrServer = new HttpSolrServer(builder.build()。toString());

时间:2017-04-18 13:07:57

标签: java solr

什么是

的替代品
HttpSolrServer solrServer = new HttpSolrServer(builder.build().toString());

2 个答案:

答案 0 :(得分:2)

这是一个解决方案:

SolrClient solrServer = new HttpSolrClient.Builder(solrLocation).build();

答案 1 :(得分:1)

正如documentation所说:

  

已过时。使用HttpSolrClient

     

@Deprecated public class HttpSolrServer扩展HttpSolrClient

HttpSolrClient solrServer = new HttpSolrClient (builder.build().toString());