You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
NEST always repeats the field name within the field properties when using fluent mapping. e.g. in the below PUT mapping 'title' is repeated as the json member name within the 'properties' object, and also as the value for the 'name' member of itself.
This is fine for most cases, but breaks down in edge cases. I'm trying to setup completion suggest fields (using the fluent mapping Generic, until this PR is merged), and the 'name' field doesnt exist on it.
e.g:
.MultiField(mf => mf
.Name(d => d.Title)
.Fields(f => f
.String(s => s.Name(d => d.Title))
.Generic(s => s
.Type("completion")
.Name("suggest")
.IndexAnalyzer("default"))))
produces the following, which fails ({"error":"MapperParsingException[Unknown field [name]]","status":400}):
Removing the "name": "suggest", part manually (using fiddler edit and replay) it then succeeds.
I tried looking into the source code to fix it myself (I was thinking a config option somewhere to turn this behaviour off), but I have no idea where to start. Any pointers appreciated! If there's already an option for this, my apologies, I did look but couldn't find it.
The text was updated successfully, but these errors were encountered:
I rather write a special SuggestCompletion() mapping method for this but you are right that the it would be handy if you could make .Generic() not always write the name property.
NEST always repeats the field name within the field properties when using fluent mapping. e.g. in the below PUT mapping 'title' is repeated as the json member name within the 'properties' object, and also as the value for the 'name' member of itself.
This is fine for most cases, but breaks down in edge cases. I'm trying to setup completion suggest fields (using the fluent mapping Generic, until this PR is merged), and the 'name' field doesnt exist on it.
e.g:
produces the following, which fails (
{"error":"MapperParsingException[Unknown field [name]]","status":400}
):Removing the
"name": "suggest",
part manually (using fiddler edit and replay) it then succeeds.I tried looking into the source code to fix it myself (I was thinking a config option somewhere to turn this behaviour off), but I have no idea where to start. Any pointers appreciated! If there's already an option for this, my apologies, I did look but couldn't find it.
The text was updated successfully, but these errors were encountered: