-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Create and update mapping domain-object will be different for MultiFieldMapping #873
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
Comments
Is there any reason why ElasticTypeConverter.GetTypeFromJObject are creating a MultiFieldMapping and change the type to originalType instead of parsing the json into the domain objects that are created for multi field mapping? |
If we read the example about how to map multi fields (example from http://nest.azurewebsites.net/nest/indices/put-mapping.html it saying) var typeMapping = new TypeMapping(Guid.NewGuid().ToString("n"));
var property = new TypeMappingProperty
{
Type = "multi_field"
};
var primaryField = new TypeMappingProperty
{
Type = "string",
Index = "not_analyzed"
};
var analyzedField = new TypeMappingProperty
{
Type = "string",
Index = "analyzed"
};
property.Fields = new Dictionary<string, TypeMappingProperty>();
property.Fields.Add("name", primaryField);
property.Fields.Add("name_analyzed", analyzedField);
typeMapping.Properties.Add("name", property); When we later check the Either the type should be parsed as
Both of the way I found will include breaking changes, either in the code that are used for creating the mapping or in the code that are reading the mapping. @drewr or @Mpdreamz do you have any other suggestions on how to solve this or solve the problem with the breaking change 1 or 2? I have already started with solution 1 but then I found out all the breaking changes and need a decision about how to proceed. |
@Tasteful, to answer your original question, As for Hope that makes sense? |
@gmarz but the MultiFieldMapping does't have any properties for the If the |
@Tasteful, OK I see your point here. Agreed, we should add For 1.1, |
During the evening I was removeing all the MultiFieldMappers (for the big breaking change), don't know if I should do a pull-request on that already... you will find my branch here https://github.com/Tasteful/elasticsearch-net/tree/issue/873-2 |
When using multifield mapping the domain-object will not be the same as before posted to server.
I adding a field with 3 variants (default + 2 not default)
When I request to get the mapping from ES I will got a JSON like this back where the type are "string" and the multi-field that have the same name as the field are exposed directly on the field-node.
When this is parsed back to domain-object the response-converter are creating a MultiFieldMapping that have type as "string" and correct name but other attributes like index/store/etc on the field are missing.
When I later update the mappings I got the following request (and missing the index/store attributes). Don't know if it have any negative impact that the attributes are missing.
This is not consequent between how the domain-object are used when creating the mapping and after fetching the mapping. Needing 2 different code to handle the mappings, one for creating and one for validating and updating mapping.
The text was updated successfully, but these errors were encountered: