You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@solr.apache.org by Ed Yu <ek...@hotmail.com> on 2021/08/31 20:28:19 UTC
Having problem with implicit field "_root_"
We have a solr setup from a very old version (1.4) and we are upgrading it to 8.9. We are stuck at the point that I think the schema.xml is syntactically free of errors but now giving an error:
Caused by: org.apache.solr.common.SolrException: Could not load conf for core nwr_col: Can't load schema /var/solr/data/nwr_col/conf/schema.xml: _root_ field must be defined using the exact same fieldType as the uniqueKey field (id) uses: uuid
We have a field “id”
<field name="id" type="uuid" indexed="true" stored="true" default="NEW"/>
<fieldType name="uuid" class="solr.UUIDField" indexed="true"/>
So I added:
<field name="_root_" type="uuid" indexed="false" stored="false" docValues="false" default="NEW" />
And now I got the following error:
Caused by: org.apache.solr.common.SolrException: Could not load conf for core nwr_col: Can't load schema /var/solr/data/nwr_col/conf/schema.xml: [schema.xml] Duplicate field definition for '_root_' [[[_root_{type=string,properties=indexed,omitNorms,omitTermFreqAndPositions,sortMissingLast,docValues,useDocValuesAsStored,uninvertible}]]] and [[[_root_{type=uuid,default=NEW,properties=useDocValuesAsStored}]]]
Sounds like redefining the _root_ field is not allowed.
So I need to know:
1. How can we redefine _root_ to fix the above error?
2. Preferably, is there a way we can disable this parent child document feature to avoid the need of the _root_ field?
Sorry for such a noob question.
Regards,
Ed.
Sent from Mail<https://go.microsoft.com/fwlink/?LinkId=550986> for Windows
Re: Having problem with implicit field "_root_"
Posted by David Smiley <ds...@apache.org>.
It appears you are not using child documents, thus you should not define
_root_.
~ David Smiley
Apache Lucene/Solr Search Developer
http://www.linkedin.com/in/davidwsmiley
On Tue, Aug 31, 2021 at 4:30 PM Ed Yu <ek...@hotmail.com> wrote:
> We have a solr setup from a very old version (1.4) and we are upgrading it
> to 8.9. We are stuck at the point that I think the schema.xml is
> syntactically free of errors but now giving an error:
>
> Caused by: org.apache.solr.common.SolrException: Could not load conf for
> core nwr_col: Can't load schema /var/solr/data/nwr_col/conf/schema.xml:
> _root_ field must be defined using the exact same fieldType as the
> uniqueKey field (id) uses: uuid
>
> We have a field “id”
> <field name="id" type="uuid" indexed="true" stored="true"
> default="NEW"/>
> <fieldType name="uuid" class="solr.UUIDField" indexed="true"/>
>
> So I added:
>
> <field name="_root_" type="uuid" indexed="false" stored="false"
> docValues="false" default="NEW" />
>
> And now I got the following error:
>
> Caused by: org.apache.solr.common.SolrException: Could not load conf for
> core nwr_col: Can't load schema /var/solr/data/nwr_col/conf/schema.xml:
> [schema.xml] Duplicate field definition for '_root_'
> [[[_root_{type=string,properties=indexed,omitNorms,omitTermFreqAndPositions,sortMissingLast,docValues,useDocValuesAsStored,uninvertible}]]]
> and [[[_root_{type=uuid,default=NEW,properties=useDocValuesAsStored}]]]
>
> Sounds like redefining the _root_ field is not allowed.
>
> So I need to know:
>
>
> 1. How can we redefine _root_ to fix the above error?
> 2. Preferably, is there a way we can disable this parent child document
> feature to avoid the need of the _root_ field?
>
> Sorry for such a noob question.
>
> Regards,
> Ed.
>
> Sent from Mail<https://go.microsoft.com/fwlink/?LinkId=550986> for Windows
>
>
Re: Having problem with implicit field "_root_"
Posted by Dominique Bejean <do...@eolya.fr>.
Hi,
I suggest you define both id and _root_ fields as string, and you populate
id with uuid generated by UUIDUpdateProcessor in an
updateRequestProcessorChain.
See Solr Wiki - https://cwiki.apache.org/confluence/display/solr/uniquekey
Dominique
Le mar. 31 août 2021 à 22:30, Ed Yu <ek...@hotmail.com> a écrit :
> We have a solr setup from a very old version (1.4) and we are upgrading it
> to 8.9. We are stuck at the point that I think the schema.xml is
> syntactically free of errors but now giving an error:
>
> Caused by: org.apache.solr.common.SolrException: Could not load conf for
> core nwr_col: Can't load schema /var/solr/data/nwr_col/conf/schema.xml:
> _root_ field must be defined using the exact same fieldType as the
> uniqueKey field (id) uses: uuid
>
> We have a field “id”
> <field name="id" type="uuid" indexed="true" stored="true"
> default="NEW"/>
> <fieldType name="uuid" class="solr.UUIDField" indexed="true"/>
>
> So I added:
>
> <field name="_root_" type="uuid" indexed="false" stored="false"
> docValues="false" default="NEW" />
>
> And now I got the following error:
>
> Caused by: org.apache.solr.common.SolrException: Could not load conf for
> core nwr_col: Can't load schema /var/solr/data/nwr_col/conf/schema.xml:
> [schema.xml] Duplicate field definition for '_root_'
> [[[_root_{type=string,properties=indexed,omitNorms,omitTermFreqAndPositions,sortMissingLast,docValues,useDocValuesAsStored,uninvertible}]]]
> and [[[_root_{type=uuid,default=NEW,properties=useDocValuesAsStored}]]]
>
> Sounds like redefining the _root_ field is not allowed.
>
> So I need to know:
>
>
> 1. How can we redefine _root_ to fix the above error?
> 2. Preferably, is there a way we can disable this parent child document
> feature to avoid the need of the _root_ field?
>
> Sorry for such a noob question.
>
> Regards,
> Ed.
>
> Sent from Mail<https://go.microsoft.com/fwlink/?LinkId=550986> for Windows
>
>
Re: Having problem with implicit field "_root_"
Posted by Srijan <sh...@gmail.com>.
Check the attached thread. It might be what you're looking for.
On Tue, Aug 31, 2021 at 4:30 PM Ed Yu <ek...@hotmail.com> wrote:
> We have a solr setup from a very old version (1.4) and we are upgrading it
> to 8.9. We are stuck at the point that I think the schema.xml is
> syntactically free of errors but now giving an error:
>
> Caused by: org.apache.solr.common.SolrException: Could not load conf for
> core nwr_col: Can't load schema /var/solr/data/nwr_col/conf/schema.xml:
> _root_ field must be defined using the exact same fieldType as the
> uniqueKey field (id) uses: uuid
>
> We have a field “id”
> <field name="id" type="uuid" indexed="true" stored="true"
> default="NEW"/>
> <fieldType name="uuid" class="solr.UUIDField" indexed="true"/>
>
> So I added:
>
> <field name="_root_" type="uuid" indexed="false" stored="false"
> docValues="false" default="NEW" />
>
> And now I got the following error:
>
> Caused by: org.apache.solr.common.SolrException: Could not load conf for
> core nwr_col: Can't load schema /var/solr/data/nwr_col/conf/schema.xml:
> [schema.xml] Duplicate field definition for '_root_'
> [[[_root_{type=string,properties=indexed,omitNorms,omitTermFreqAndPositions,sortMissingLast,docValues,useDocValuesAsStored,uninvertible}]]]
> and [[[_root_{type=uuid,default=NEW,properties=useDocValuesAsStored}]]]
>
> Sounds like redefining the _root_ field is not allowed.
>
> So I need to know:
>
>
> 1. How can we redefine _root_ to fix the above error?
> 2. Preferably, is there a way we can disable this parent child document
> feature to avoid the need of the _root_ field?
>
> Sorry for such a noob question.
>
> Regards,
> Ed.
>
> Sent from Mail<https://go.microsoft.com/fwlink/?LinkId=550986> for Windows
>
>