[
https://issues.apache.org/jira/browse/SOLR-10830?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Hoss Man updated SOLR-10830:
----------------------------
Attachment: SOLR-10830.patch
thanks [~mkhludnev], unfortunately there's a problem...
When i wrote that quick patch yesterday, i didn't bother trying to run all
tests because I took it as a given that we probably had a bunch of test schemas
with copy/pasted field definitions that violated this but weren't problematic
because they didn't actaully use child docs.
When i went to run test today to move forward with this issue, I realized that
in addition to schemas with explicit {{\_root_}} fields, i was also seeing
failures from tests that used {{"\*"}} dynamicFields that were matching
{{\_root_}}. Since it's probably more common for folks to have something like
{{<dynamicField name="\*" type="text" />}} in their schemas then it is that
folks are using childDocs, i don't really think we should fail on startup in
those cases.
So the update patch tweaks the logic so that hard failure on IndexSchema init
is only if {{\_root_}} is explicitly defined. Later, in
AddUpdateCommand.flatten, I added a stricter check to fail updates that involve
child docs unless the {{\_root_}} field type matches. I also added a test for
this situation, and updated any existing schema files that were problematic.
WDYT?
> Solr needs to enforce that _root_ field has the same fieldType as the
> uniqueKey field
> -------------------------------------------------------------------------------------
>
> Key: SOLR-10830
> URL: https://issues.apache.org/jira/browse/SOLR-10830
> Project: Solr
> Issue Type: Bug
> Security Level: Public(Default Security Level. Issues are Public)
> Reporter: Hoss Man
> Attachments: SOLR-10830.patch, SOLR-10830.patch
>
>
> it's pretty important for correct childDocument behavior that the {{\_root_}}
> field have the same {{<fieldType/>}} as the uniqueKey field -- but nothing
> seems to enforce that.
> (I realized this while working on SOLR-10807 where i was forcing all fields
> to be Points based except for the uniqueKey field and got some weird errors
> in PeerSync that only related to replacing child documents -- because the
> {{schema.xml}} has a {{TrieIntField}} based "id" field, but {{\_root_}} was
> using {{IntPointField}} -- but the same problem could affect any schema if
> folks change the {{id}} from string to long, or int to string, and don't make
> the corrisponding change to the definition of {{\_root_}})
--
This message was sent by Atlassian JIRA
(v6.3.15#6346)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]