This IndexSchema is not mutable. Solr 7.3.1

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

This IndexSchema is not mutable. Solr 7.3.1

Vincenzo D'Amore
Hi all,

I'm trying to import a csv file in solr

id,name,surname,gender,eyeColor,hairColor
1,pippo,pluto,male,brown,brown

I'm using this command

curl '
http://localhost:8983/solr/videoid/update?commit=true&header=true&fieldnames=id,name,surname,gender,eyeColor,hairColor&separator=,'
-H "Content-Type: application/csv" --data-binary @test.csv

But receiving the following error:

{
  "responseHeader":{
    "status":400,
    "QTime":32},
  "error":{
    "metadata":[
      "error-class","org.apache.solr.common.SolrException",
      "root-error-class","org.apache.solr.common.SolrException"],
    "msg":"This IndexSchema is not mutable.",
    "code":400}}

Do you know why the Solr index should be mutable?



--
Vincenzo D'Amore
Reply | Threaded
Open this post in threaded view
|

Re: This IndexSchema is not mutable. Solr 7.3.1

Erick Erickson
It’s the _schema_ that’s not mutable. Which implies you have field guessing turned _off_

I’d take a look at the solr log, the error might be more informative. But at a guess, you
need to define the fields you’re importing, namely id, name, surname, gender, eyeColor and hairColor
in your schema.

> On May 20, 2020, at 1:46 PM, Vincenzo D'Amore <[hidden email]> wrote:
>
> Hi all,
>
> I'm trying to import a csv file in solr
>
> id,name,surname,gender,eyeColor,hairColor
> 1,pippo,pluto,male,brown,brown
>
> I'm using this command
>
> curl '
> http://localhost:8983/solr/videoid/update?commit=true&header=true&fieldnames=id,name,surname,gender,eyeColor,hairColor&separator=,'
> -H "Content-Type: application/csv" --data-binary @test.csv
>
> But receiving the following error:
>
> {
>  "responseHeader":{
>    "status":400,
>    "QTime":32},
>  "error":{
>    "metadata":[
>      "error-class","org.apache.solr.common.SolrException",
>      "root-error-class","org.apache.solr.common.SolrException"],
>    "msg":"This IndexSchema is not mutable.",
>    "code":400}}
>
> Do you know why the Solr index should be mutable?
>
>
>
> --
> Vincenzo D'Amore

Reply | Threaded
Open this post in threaded view
|

Re: This IndexSchema is not mutable. Solr 7.3.1

Vincenzo D'Amore
Hi Erick,

thanks for the prompt support, I'm sure all the fields are defined (after
all they are all strings and only 6).

It seems that you cannot use CSV with ClassicIndexSchemaFactory


On Wed, May 20, 2020 at 8:20 PM Erick Erickson <[hidden email]>
wrote:

> It’s the _schema_ that’s not mutable. Which implies you have field
> guessing turned _off_
>
> I’d take a look at the solr log, the error might be more informative. But
> at a guess, you
> need to define the fields you’re importing, namely id, name, surname,
> gender, eyeColor and hairColor
> in your schema.
>
> > On May 20, 2020, at 1:46 PM, Vincenzo D'Amore <[hidden email]>
> wrote:
> >
> > Hi all,
> >
> > I'm trying to import a csv file in solr
> >
> > id,name,surname,gender,eyeColor,hairColor
> > 1,pippo,pluto,male,brown,brown
> >
> > I'm using this command
> >
> > curl '
> >
> http://localhost:8983/solr/videoid/update?commit=true&header=true&fieldnames=id,name,surname,gender,eyeColor,hairColor&separator=,
> '
> > -H "Content-Type: application/csv" --data-binary @test.csv
> >
> > But receiving the following error:
> >
> > {
> >  "responseHeader":{
> >    "status":400,
> >    "QTime":32},
> >  "error":{
> >    "metadata":[
> >      "error-class","org.apache.solr.common.SolrException",
> >      "root-error-class","org.apache.solr.common.SolrException"],
> >    "msg":"This IndexSchema is not mutable.",
> >    "code":400}}
> >
> > Do you know why the Solr index should be mutable?
> >
> >
> >
> > --
> > Vincenzo D'Amore
>
>

--
Vincenzo D'Amore
Reply | Threaded
Open this post in threaded view
|

Re: This IndexSchema is not mutable. Solr 7.3.1

Vincenzo D'Amore
Hi all,

another update. I think I found the problem.
This error is generated when I have defined add-schema-fields in
the updateRequestProcessorChain.

In other words you can have ClassicIndexSchemaFactory but (and make
sense) add-schema-fields has to be removed by
the updateRequestProcessorChain:

  <updateRequestProcessorChain name="add-unknown-fields-to-the-schema"
default="${update.autoCreateFields:true}"

 processor="uuid,remove-blank,field-name-mutating,parse-boolean,parse-long,parse-double,parse-date">

Any thought about this?



On Wed, May 20, 2020 at 11:27 PM Vincenzo D'Amore <[hidden email]>
wrote:

> Hi Erick,
>
> thanks for the prompt support, I'm sure all the fields are defined (after
> all they are all strings and only 6).
>
> It seems that you cannot use CSV with ClassicIndexSchemaFactory
>
>
> On Wed, May 20, 2020 at 8:20 PM Erick Erickson <[hidden email]>
> wrote:
>
>> It’s the _schema_ that’s not mutable. Which implies you have field
>> guessing turned _off_
>>
>> I’d take a look at the solr log, the error might be more informative. But
>> at a guess, you
>> need to define the fields you’re importing, namely id, name, surname,
>> gender, eyeColor and hairColor
>> in your schema.
>>
>> > On May 20, 2020, at 1:46 PM, Vincenzo D'Amore <[hidden email]>
>> wrote:
>> >
>> > Hi all,
>> >
>> > I'm trying to import a csv file in solr
>> >
>> > id,name,surname,gender,eyeColor,hairColor
>> > 1,pippo,pluto,male,brown,brown
>> >
>> > I'm using this command
>> >
>> > curl '
>> >
>> http://localhost:8983/solr/videoid/update?commit=true&header=true&fieldnames=id,name,surname,gender,eyeColor,hairColor&separator=,
>> '
>> > -H "Content-Type: application/csv" --data-binary @test.csv
>> >
>> > But receiving the following error:
>> >
>> > {
>> >  "responseHeader":{
>> >    "status":400,
>> >    "QTime":32},
>> >  "error":{
>> >    "metadata":[
>> >      "error-class","org.apache.solr.common.SolrException",
>> >      "root-error-class","org.apache.solr.common.SolrException"],
>> >    "msg":"This IndexSchema is not mutable.",
>> >    "code":400}}
>> >
>> > Do you know why the Solr index should be mutable?
>> >
>> >
>> >
>> > --
>> > Vincenzo D'Amore
>>
>>
>
> --
> Vincenzo D'Amore
>
>

--
Vincenzo D'Amore
Reply | Threaded
Open this post in threaded view
|

Re: This IndexSchema is not mutable. Solr 7.3.1

Shawn Heisey-2
On 5/20/2020 4:30 PM, Vincenzo D'Amore wrote:
> another update. I think I found the problem.
> This error is generated when I have defined add-schema-fields in
> the updateRequestProcessorChain.
>
> In other words you can have ClassicIndexSchemaFactory but (and make
> sense) add-schema-fields has to be removed by
> the updateRequestProcessorChain:

Absolutely correct.  The update processor that automatically adds
unknown fields DOES require a mutable schema.  The classic schema will
not work with it.

Thanks,
Shawn