How to Create Solr 6 Cores

How to create Solr 6 cores?

Try this way

Navigate to Solr/solr-6.1.0/server/solr/

create new folder and name it netest.

copy conf folder from Solr/solr-6.1.0/server/solr/configsets/basic_configs/ and paste it inside netest folder.

now you enter this command on terminal sudo ./solr create -c netest

This will create newcore with name netest using config files inside conf folder

hope this helps

Create new cores in SOLR via HTTP?

Yes, you can create the Solr cores via HTTP. You have found the correct URL (https://wiki.apache.org/solr/CoreAdmin) to look into. All the above parameters are optional.

instanceDir - This is the path where your new core will be created. It'll create the folder structure provided by you, under "/example/solr/". If you don't provide this parameter, it'll automatically create a new core (with the collection no) like collection1.

config - If you want to have a different solrconfig.xml for the new core, then provide this. Otherwise, it'll share the existing core's (collection1) config by default.

schema - If you want to have a different schema.xml for the new core, then provide this. Otherwise, it'll share the existing core's (collection1) schema by default.

dataDir - This is the path where your new core's data will be stored. It'll create the folder structure provided by you under the new core folder.

If you really don't want some different configuration for your new core, follow the sample HTTP URL

http://localhost:8983/solr/admin/cores?action=CREATE&name=core_name&numShards=2&replicationFactor=2

Hope this will help.

DSE 6 create solr cores through http

Many of the HTTP APIs supported in the 5.x versions are removed in the DSE 6, including the core administration.

You need to use CQL syntax (recommended), or dsetool (older, less recommended) to manipulate the DSE Search cores.

P.S. From my experience, using the CQL it is easier, and doesn't require to have access to Solr UI, or command line.

Solr 8.10 sample core files and how to add new cores

Short answer : cd into solr bin directory and run solr create -c "mytest"

(@see solr create command).


Basically you can follow this few steps to define a configuration set and create the corresponding core.

  • Define SOLR_HOME (where to put Solr core(s) config/data) in solr's bin/solr.in.sh, or bin\solr.in.cmd on windows. It's recommended you separate it from solr sources & binaries.
  • Create/move your configuration set in SOLR_HOME directory and ensure solr has ownership.
  • Run the solr create command

Here a bash script based on one I oftenly use that does the job (I noticed you are on a windows machine but the principle remains the same) :

#!/bin/bash

SOLR_SRC="/opt/solr" # symlink to your solr-<version> directory
SOLR_ROOT="/var/solr"
SOLR_HOME="${SOLR_ROOT}/data"

CORE="mytest"

# Create core config set in SOLR_HOME
cd ${SOLR_HOME}/
mkdir -p ${CORE}/data
# cp -R ${SOLR_SRC}/server/solr/configsets/_default/conf/ ./${CORE}/ # from default conf
cp -R ${SOLR_SRC}/server/solr/${CORE}/conf/ ./${CORE}/

# Set ownership
chown -R solr:solr ${SOLR_HOME}

# Create core
su - solr -c "${SOLR_SRC}/bin/solr create -c ${CORE}"

How to create new core in Solr 5?

In Solr 5, creation of cores is supported by the bin/solr script provided in the distribution. Try

bin/solr create -help

for a quick introduction.

From the above help doc, you may find:

bin/solr create [-c name] [-d confdir] [-n configName] [-shards #] [-replicationFactor #] [-p port]


Related Topics



Leave a reply



Submit