You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@solr.apache.org by Houston Putman <ho...@gmail.com> on 2022/10/20 17:10:52 UTC

Re: Schema question: multi-valued field pint vs pints

Hello Christopher,

If you look at the schema, you will see that "pint" and "pints" are
FieldTypes that are defined in that same schema.
I think they are identical, except for the "multivalued" flag. But you can
change this if you want to.

Solr should not be changing the field type of a field for you.

A few questions:

   - When you say "when I fetch the schema from Solr" how are you fetching
   it?
   - Have you changed the fieldType of this field?
   - How are you updating your schema?

- Houston


On Fri, Sep 16, 2022 at 3:10 PM Christopher Schultz <
chris@christopherschultz.net> wrote:

> All,
>
> Ping. Can I treat type=pint,multiValued=true the same as
> type=pints,multiValued=true ?
>
> Thanks,
> -chris
>
> On 9/8/22 18:43, Christopher Schultz wrote:
> > All,
> >
> > I have defined a schema which uses a multi-valued field with type "pint"
> > and when I fetch the schema from Solr, it says the field type is "pints".
> >
> > It seems if I create a field of type "pints" with "mutivalued":"false",
> > I still get a multi-valued field.
> >
> > Is one an alias of the other? It it better to use one or the other? What
> > will Solr do if I change the definition of a pints/multi field to be
> > pint/multi? Will it recognize that they are equivalent, or will it
> > damage an existing index in any way? Or waste a bunch of time?
> >
> > I'm writing an automated schema-update process, and it's telling me that
> > my desired schema doesn't match the actual schema because of this
> > difference. I'm wondering if I should take pints == multi-valued pint
> > into account or if I should allow the update to proceed.
> >
> > Would it be save to say that for any field-type, making it plural just
> > means "this is a multi-valued field of type type-without-trailing-s"?
> >
> > Thanks,
> > -chris
>

Re: Schema question: multi-valued field pint vs pints

Posted by Christopher Schultz <ch...@christopherschultz.net>.
Houston,

On 10/20/22 13:10, Houston Putman wrote:
> Hello Christopher,
> 
> If you look at the schema, you will see that "pint" and "pints" are
> FieldTypes that are defined in that same schema.
> I think they are identical, except for the "multivalued" flag. But you can
> change this if you want to.

I am seeing schemas where the "type" of a field is "pints" and also is 
multivalued, and also fields where the type is "pint" and is 
multivalued. I'm thinking that they are synonyms, but may be defined 
distinctly, possible for historical reasons.

> Solr should not be changing the field type of a field for you.
> 
> A few questions:
> 
>     - When you say "when I fetch the schema from Solr" how are you fetching
>     it?

I'm using SolrJ's SchemaRequest stuff.

>     - Have you changed the fieldType of this field?

I'm not 100% sure on the history of the index schema. I'm trying to 
formalize it as much as possible and I'm building a schema-migrator that 
I'd be happy to share with the community once it's a little less janky.

>     - How are you updating your schema?

I'm using SolrJ's SchemaRequest stuff orchestrated by my own software.

-chris

> On Fri, Sep 16, 2022 at 3:10 PM Christopher Schultz <
> chris@christopherschultz.net> wrote:
> 
>> All,
>>
>> Ping. Can I treat type=pint,multiValued=true the same as
>> type=pints,multiValued=true ?
>>
>> Thanks,
>> -chris
>>
>> On 9/8/22 18:43, Christopher Schultz wrote:
>>> All,
>>>
>>> I have defined a schema which uses a multi-valued field with type "pint"
>>> and when I fetch the schema from Solr, it says the field type is "pints".
>>>
>>> It seems if I create a field of type "pints" with "mutivalued":"false",
>>> I still get a multi-valued field.
>>>
>>> Is one an alias of the other? It it better to use one or the other? What
>>> will Solr do if I change the definition of a pints/multi field to be
>>> pint/multi? Will it recognize that they are equivalent, or will it
>>> damage an existing index in any way? Or waste a bunch of time?
>>>
>>> I'm writing an automated schema-update process, and it's telling me that
>>> my desired schema doesn't match the actual schema because of this
>>> difference. I'm wondering if I should take pints == multi-valued pint
>>> into account or if I should allow the update to proceed.
>>>
>>> Would it be save to say that for any field-type, making it plural just
>>> means "this is a multi-valued field of type type-without-trailing-s"?
>>>
>>> Thanks,
>>> -chris
>>
>