Clemens,
On 5/30/22 02:02, Clemens WYSS (Helbling Technik) wrote:
Given a connection to Solr ( e.g. adminSolrConnection )
CoreAdminRequest.Create createCoreRequest = new CoreAdminRequest.Create();
createCoreRequest.setCoreName( coreName );
createCoreRequest.process( adminSolrConnection );
What is an "admin solr connection"? Is that any different than just a
plain-old HttpSolrClient instance?
How can I provide the schema for the core once it's been created? Can I
use the API for that, or do I have to resort to pushing the config file
directly similar to these kindx of curl commands:
curl -d "{ ... config }" \
${SCHEME}://localhost:${PORT}/solr/${CORENAME}/config
curl -H application/json --data-binary '{ ... schema ... }' \
"${SCHEME}://localhost:${PORT}/solr/${CORENAME}/schema"
The CoreAdminRequest class has a createCore() method which takes a whole
bunch of arguments, but the javadoc doesn't say what those arguments
are. With parameter names like "configFile" I assume it's expecting a
configuration file /name/ and not the actual configuration; same with
schemaFile. I'm happy to make direct calls to the REST API, but if the
SolrJ client will do it for me, I'd prefer that.
I'm also happy to write patches for CoreAdminRequest to that end.
-chris
On 2022/05/25 21:25:09 Christopher Schultz wrote:
All,
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).
I'm using Solr 7.7.3 and the vanilla SolrJ client library.
Thanks,
-chris