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 Nawab Zada Asad Iqbal <kh...@gmail.com> on 2017/06/05 07:23:35 UTC

Field x is not multivalued and destination for multiple copyFields

*Hi, I have a field 'name_token' which gets value via copyFields on
different language-specific fields (e.g. name_en , name_it, name_es, etc.)
If I can ensure that, *



*only one of these language-specific fields will have a value for a given
document, is it ok to ignore this warning:"IndexSchema Field name_token is
not multivalued and destination for multiple copyFields"*


*Also, what will happen if my a record happens to have values in two
language specific name fields (e.g. if a name or word exists in two
languages: name_zh and name_ja ). *



*My understanding is that the value is same anyways, so there is no
drawback, but can it result in an exception?*

*Regards*

*Nawab*

Re: Field x is not multivalued and destination for multiple copyFields

Posted by Rick Leir <rl...@leirtech.com>.
Nawab,

If you have multivalued=true and you index a document with two or more 
name_* fields, then the name_token will have two or more values, all of 
which will be searchable. I think this is what you want, because names 
can be quite different in different languages. For example the country names

de Deutschland
en Germany
fr Allemagne
es Alemania

or names for 'shoe'
schuh
zapato
cipela

If you have multivalued=false and try to index two or more languages for 
the name, it would cause an exception to be thrown in the indexing 
thread and the document will not be indexed (schema validation will fail).

If you use multivalued=false on a field which is a copyfield 
destination, this is not a common usage pattern and in my mind (using a 
northern idiom) you are "walking on thin ice". Tell us how it goes.
Cheers -- Rick


On 2017-06-05 03:23 AM, Nawab Zada Asad Iqbal wrote:
> *Hi, I have a field 'name_token' which gets value via copyFields on
> different language-specific fields (e.g. name_en , name_it, name_es, etc.)
> If I can ensure that, *
>
>
>
> *only one of these language-specific fields will have a value for a given
> document, is it ok to ignore this warning:"IndexSchema Field name_token is
> not multivalued and destination for multiple copyFields"*
>
>
> *Also, what will happen if my a record happens to have values in two
> language specific name fields (e.g. if a name or word exists in two
> languages: name_zh and name_ja ). *
>
>
>
> *My understanding is that the value is same anyways, so there is no
> drawback, but can it result in an exception?*
>
> *Regards*
>
> *Nawab*
>