creating a core with a custom managed-schema

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

creating a core with a custom managed-schema

rhys J
I have created a tmp directory where I want to have reside custom
managed-schemas to use when creating cores.

/tmp/solr_schema/CORENAME/managed-schema

Based on this page:
https://lucene.apache.org/solr/guide/7_0/coreadmin-api.html#coreadmin-create
, I am running the following command:

sudo -u solr /opt/solr/bin/solr create -c dbtrphon -schema
/tmp/solr_schemas/dbtrphon/managed-schema

I get this error:

ERROR: Unrecognized or misplaced argument: -schema!

How can I create a core with a custom managed-schema?

I'm trying to implement solr in a development environment, but I would like
to have custom schemas, so that when we move it to live, we don't have to
recreate the schemas by hand again.

Thanks,

Rhys

<https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail&utm_term=icon>
Virus-free.
www.avast.com
<https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail&utm_term=link>
<#DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2>
Reply | Threaded
Open this post in threaded view
|

Re: creating a core with a custom managed-schema

Erick Erickson
Well, just what it says. -schema isn’t a recognized parameter, where did you get it? Did you try bin/solr create -help and follow the instructions there?

Best,
Erick

> On Nov 4, 2019, at 12:34 PM, rhys J <[hidden email]> wrote:
>
> I have created a tmp directory where I want to have reside custom
> managed-schemas to use when creating cores.
>
> /tmp/solr_schema/CORENAME/managed-schema
>
> Based on this page:
> https://lucene.apache.org/solr/guide/7_0/coreadmin-api.html#coreadmin-create
> , I am running the following command:
>
> sudo -u solr /opt/solr/bin/solr create -c dbtrphon -schema
> /tmp/solr_schemas/dbtrphon/managed-schema
>
> I get this error:
>
> ERROR: Unrecognized or misplaced argument: -schema!
>
> How can I create a core with a custom managed-schema?
>
> I'm trying to implement solr in a development environment, but I would like
> to have custom schemas, so that when we move it to live, we don't have to
> recreate the schemas by hand again.
>
> Thanks,
>
> Rhys
>
> <https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail&utm_term=icon>
> Virus-free.
> www.avast.com
> <https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail&utm_term=link>
> <#DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2>

Reply | Threaded
Open this post in threaded view
|

Re: creating a core with a custom managed-schema

rhys J
On Mon, Nov 4, 2019 at 1:36 PM Erick Erickson <[hidden email]>
wrote:

> Well, just what it says. -schema isn’t a recognized parameter, where did
> you get it? Did you try bin/solr create -help and follow the instructions
> there?
>
> I am confused.

This page:
https://lucene.apache.org/solr/guide/7_0/coreadmin-api.html#coreadmin-create

says that schema is a valid parameter, and it explains how to use it.

But when I use the command create, I get an error.

Is there no way to use a custom schema to create a core from the command
line? Will I always have to either hand edit the managed-schema, or use the
API?

Thanks,

Rhys
Reply | Threaded
Open this post in threaded view
|

Re: creating a core with a custom managed-schema

Erick Erickson
You’re confusing the admin API with the bin/solr script. If you look at
the examples on that page, the form is:

admin/cores?action=CREATE&name=core-name&instanceDir=path/to/dir&config=solrconfig.xml&dataDir=data

what you used was:
/opt/solr/bin/solr create….

Totally different beasts.


> On Nov 4, 2019, at 1:43 PM, rhys J <[hidden email]> wrote:
>
> On Mon, Nov 4, 2019 at 1:36 PM Erick Erickson <[hidden email]>
> wrote:
>
>> Well, just what it says. -schema isn’t a recognized parameter, where did
>> you get it? Did you try bin/solr create -help and follow the instructions
>> there?
>>
>> I am confused.
>
> This page:
> https://lucene.apache.org/solr/guide/7_0/coreadmin-api.html#coreadmin-create
>
> says that schema is a valid parameter, and it explains how to use it.
>
> But when I use the command create, I get an error.
>
> Is there no way to use a custom schema to create a core from the command
> line? Will I always have to either hand edit the managed-schema, or use the
> API?
>
> Thanks,
>
> Rhys