简体   繁体   English

如何使用solrj放置solrconfig.xml和schema.xml

[英]How to put solrconfig.xml and schema.xml using solrj

I'd like to put new solrconfig.xml and schema.xml using solrj. 我想使用solrj放置新的solrconfig.xmlschema.xml
I already found SchemaRquest . 我已经找到SchemaRquest But, It provides only some functions Add/Update/Delete. 但是,它仅提供一些功能“添加/更新/删除”。
What I want to do is that define solrconfig.xml and schema.xml first and put it into a collection and use it using solrj. 我想做的是先定义solrconfig.xmlschema.xml然后将其放入集合中,并通过solrj使用它。

Assuming you have a SolrCloud setup you can do this: 假设您具有SolrCloud设置,则可以执行以下操作:

$SOLR_HOME/server/scripts/cloud-scripts/zkcli.sh -zkhost zkhost:3181 -confname example-cmd putfile /configs/example/managed-schema ./managed-schema 

If you want to do with Java, you can do something like this: 如果要使用Java,可以执行以下操作:

ZooKeeper zk = new ZooKeeper(host, tick * 15, this);
zk.setData(PATH_IN_ZK, contentString.getBytes(StandardCharsets.UTF_8), -1);

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM