On 10/17/2021 7:08 AM, nskarthik wrote:
not possible when Solr is in standalone mode
I use Solr in NON-CLOUD  standalone mode.

Process :  /solr Create -c <new core>
This feature just creates an empty core (copies all required default files ), 
but why this cannot be created from SOLRJ ?

If this feature is made available with AAA, Core creation would be simple and 
powerful.

When Solr is in cloud mode, the bin/solr script copies a config up to ZooKeeper and then calls the Collections API. These are both API calls, not filesystem manipulation. Solr does all the work of creating cores. This is possible because with SolrCloud, the active config for a collection is not on disk, it's in ZooKeeper.

As you might have figured out, it's the config that makes things difficult.

Normally when Solr is in standalone mode, the bin/solr script creates a core directory with the required structure, copies a config into the newly created directory structure, and then calls the http-based CoreAdmin API to complete the registration of a new core in Solr. Solr cannot do the directory/file creation in standalone mode.

There IS a way, though. There is a Solr feature called configsets that makes it possible to use ONLY the CoreAdmin API to create a core.

https://solr.apache.org/guide/8_6/config-sets.html

You do have to set up the configsets location. If you use the service installer, the default place for configsets is /var/solr/data/configsets ... and that directory will not be created by the service installer.

With configsets properly set up, I was able to create a core with just this API call:

http://server:port/solr/admin/cores?action=CREATE&name=mycore&configSet=_default

This should be possible with SolrJ using the CoreAdmin capability. I need to run to the store right now, but I can look into how to write the SolrJ code when that's finished.

Thanks,
Shawn

Reply via email to