On 5/25/2022 3:25 PM, Christopher Schultz wrote:
I have a non-clustered/ZK Solr instance and I'd like to create a core using the Java SolrClient library. Is that currently possible? I only see methods for working with documents in the current core (selected when the client object is initially created, based upon the URL which contains the core name).
With the default config, you have to create the core directory and its conf subdirectory with a config, schema, and any other config files referenced by the config and schema ... then you can call the CoreAdmin API to add the core.
When using "bin/solr create" that script creates the core directory and populates the conf with the config you specify, then it calls the CoreAdmin API to add the core to Solr.
There is a ConfigSet feature for non-cloud ... once properly set up, that would allow core creation using ONLY the API. I haven't used that feature myself. The sticky point is that in order to create a core, the config must be available. In cloud mode, all configs are in zookeeper, so Solr just has to create the directory. For non-cloud either the core directory must already exist and have a config, or the config must be referenced via the configset feature.
Thanks, Shawn
