You are viewing a plain text version of this content. The canonical link for it is here.
Posted to solr-user@lucene.apache.org by rhys J <rh...@gmail.com> on 2019/11/04 17:34:23 UTC
creating a core with a custom managed-schema
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>
Re: creating a core with a custom managed-schema
Posted by Erick Erickson <er...@gmail.com>.
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 <rh...@gmail.com> wrote:
>
> On Mon, Nov 4, 2019 at 1:36 PM Erick Erickson <er...@gmail.com>
> 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
Re: creating a core with a custom managed-schema
Posted by rhys J <rh...@gmail.com>.
On Mon, Nov 4, 2019 at 1:36 PM Erick Erickson <er...@gmail.com>
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
Re: creating a core with a custom managed-schema
Posted by Erick Erickson <er...@gmail.com>.
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 <rh...@gmail.com> 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>