create new core directories in SOLR on the fly

ndiks picture ndiks · Oct 31, 2010 · Viewed 7.3k times · Source

i am using solr 1.4.1 for building a distributed search engine, but i dont want to use only one index file - i want to create new core "index"-directories on the fly in my java code.

i found following rest api to create new cores using an EXISTING core directory (http://wiki.apache.org/solr/CoreAdmin).

http://localhost:8983/solr/admin/cores?action=CREATE&name=coreX&instanceDir=path_to_instance_directory&config=config_file_name.xml&schema=schem_file_name.xml&dataDir=data

is there a way to create a new core without an extisting core directory? has solr such a function? via rest or in the solrj-api? thanks.

Answer

Mauricio Scheffer picture Mauricio Scheffer · Oct 31, 2010

It's not currently possible to programmatically submit your schema and config to Solr to create a new core. Here's the JIRA issue about it.

As mentioned in the comments, you can work around it by using something like WebDAV or scp or sftp.