New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Mapping conflict error upgrading from 1.7 to 2.0 #13169
Comments
Also getting a similar error on a
Also, the migration plugin only had informational messages (eg. |
Hi @rayward Thanks for testing out the beta, and for reporting these bugs. I think the analyzer problem will be fixed by rjernst@2e4a053 but the _parent issue needs further investigation. To reproduce, create this index on 1.x:
|
I agree the first issue described should be fixed by #13206. The issue with The problem is that all types have a |
@martijnvg could you comment on #13169 (comment) please? |
@rjernst @clintongormley I think it may work. I'm going to try out if making the |
Internally removing the _parent field from DocumentMapper works out for the old p/c implementation, but not for the new implementation (that uses doc values and Lucene's JoinUtil). The disabled Just thinking out loud, but what we can try to do is:
|
Maybe the bug is that |
Maybe the problem is we aren't using this name in map of field types? If we use that as the key, instead of |
@rjernst you mean internally, rather than in the API? Using it in the API would make it difficult to explain |
Yes, I mean internally. |
@rjernst @jpountz I like the idea of internally mapping the _parent field under a name that takes the type into account. I quickly checked this and this seem to work out. Both the upgrade works without an error and has_child/has_parent queries work. However after running some more tests, I realized that there are other issues. One can include the |
Hmm, so maybe we should be able to have 2 field types? One called _parent that would only be stored and another one called _parent#type that would only be doc-valued? |
Right, that would solve it, just not sure how to would like. The ParentFieldMapper can only produce one Taking a step back, maybe just allowing the the |
Yesterday we discussed that _parent field should use an unique internal field type name per type. So that when the mapping compatibility check is performed no check would fail since each field would be unique and having different field data settings wouldn't matter. Making that change has one important implication the I went a head and made change: martijnvg@26e2e5d However things got tricky and I had to make more changes that I would like:
The change grew to a level that I'm not comfortable porting it back to 2.0 and I think we should completely revise the _parent field. For example with the new implementation we don't need to store _parent indexed and stored field. The join doc values fields are sufficient. The _parent Lucene fields just exist for the old parent child implementation. Also if we going to revise types this is going to have a big impact on the _parent field (if it still exists then). I think for 2.0 we need to make a compromise in order to keep the change small and low risk. Disabling the field data settings would work, but that wouldn't be nice for all the other fields. So I think disabling the field type compatibility check on the _parent field is maybe the right workaround for now: The only field type related setting that can be set on _parent field is field data loading. All the other settings aren't configurable. I think that makes this workaround better then disabling field data settings for all fields. |
@martijnvg ++ |
… field types: 1) A shared immutable fieldtype for the _parent field (used for direct access to that field in the dsl). This field type is stored and indexed. 2) A per type field type for the child join field. The field type has doc values enabled if index is created on or post 2.0 and field data type is allowed to be changed. 3) A per type field type for the parent join field. The field type has doc values enabled if index is created on or post 2.0. This resolves the issue that a mapping is not compatible if parent and child types have different field data loading settings. Closes #13169
… field types: 1) A shared immutable fieldtype for the _parent field (used for direct access to that field in the dsl). This field type is stored and indexed. 2) A per type field type for the child join field. The field type has doc values enabled if index is created on or post 2.0 and field data type is allowed to be changed. 3) A per type field type for the parent join field. The field type has doc values enabled if index is created on or post 2.0. This resolves the issue that a mapping is not compatible if parent and child types have different field data loading settings. Closes #13169
The field in question is:
This is the relevant analyzer configuration:
This field is defined on 2 out of 6 types that I have and is identical for those two types.
The text was updated successfully, but these errors were encountered: