單機版的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

相關文章
相關標籤/搜索