SolrJ管理

    //创建一个集群的连接
    CloudSolrServer server = new CloudSolrServer("127.0.0.1:2181,127.0.0.1:2182,127.0.0.1:2183");
    //设置默认的colllection属性
    server.setDefaultCollection("collection3");

切换到集群版solr

重新配置xml文件

   <!--集群版solr-->
    <bean id="cloudSolrServer" class="org.apache.solr.client.solrj.impl.CloudSolrServer">
        <constructor-arg index="0" value="127.0.0.1:2181,127.0.0.1:2182,127.0.0.1:2183"></constructor-arg>
        <property name="defaultCollection" value="collection3"></property>
    </bean>

results matching ""

    No results matching ""