单机版的solrj(查询)

请参考这个网址 :http://www.solr.cc/blog/?p=1296web

CommonsHttpSolrServer server = new CommonsHttpSolrServer("http://localhost:8983/solr");tomcat

CommonsHttpSolrServer server = new CommonsHttpSolrServer("http://localhost:8983/solr/collection1");app

发现url这两种写法都能查询,索引数据。这有有一个小知识点,solr表示webapp服务名字solr服务,collection1是实例名,若是不写,它会默认collection1实例(单机中,实例名与core的名字必须同样,能够从core.properties中查看)。webapp

如咱们把collection1文件复制,文件夹名字为AA,而且修改core.properties 中的 name=AA,从新启动tomcat。此时若是要查询实例AA中的数据必须http://localhost:8983/solr/AAurl

相关文章
相关标签/搜索