Hi Arunan,

Solr runs in one of two main modes: "Cloud" mode or "Standalone" mode.
Collections can only be created in Cloud mode.  Standalone mode
doesn't allow creation of collections; it uses cores instead.  From
your error message above, it looks like the problem is that you're
trying to create a collection in "standalone" mode, which doesn't
support that.

SolrJ has methods to create both cores and collections, you just have
to have Solr running in the right mode:
- Collection creation:
https://lucene.apache.org/solr/7_4_0/solr-solrj/org/apache/solr/client/solrj/request/CollectionAdminRequest.Create.html
- Core creation:
https://lucene.apache.org/solr/7_4_0/solr-solrj/org/apache/solr/client/solrj/request/CoreAdminRequest.Create.html

You'll have to decide whether you want to run Solr in cloud or
standalone mode, and adjust your core/collection creation accordingly.

Best,

Jason
On Fri, Jul 20, 2018 at 2:09 AM Arunan Sugunakumar
<arunans...@cse.mrt.ac.lk> wrote:
>
> Hi,
>
> I would like to know whether it is possible to create a collection in Solr
> through SolrJ. I tried to create and it throws me an error saying that
> "Solr instance is not running in SolrCloud mode.
> "
> I am trying to upgrade a system to use solr which used lucene library in
> the past. In lucene, everything is controlled via code and user does not
> have worry about creating collections. I am trying to replicate this
> experience in Solr.
>
> Thanks in Advance,
> Arunan

Reply via email to