-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
breaking change when applying FieldType.Object to a Dictionary<long, SomeOtherClass> and using MapFromAttributes() #926
Comments
Hey @goalie7960, I'm not able to reproduce this. What version of NEST are you running? |
Whatever the latest is from nuget, I think 1.0.2? |
Yea, that would be 1.0.2. Can you try writing a test (like one of these) to reproduce this? I've tried your example, but it works fine...maybe I'm missing something. |
Not sure what format you want the test in, but you can find it here. |
Since #731, this was causing an ArgumentException to be thrown when mapping generic objects with value type parameters (List<int>, Dictionary<long, string>, etc..). The check doesn't seem necessary since ElasticTypeAttribute is already constained to classes at compile time. Also cleaned up PropertyNameResolver a bit. Closes #926
@goalie7960 Good catch, I was able to reproduce this with your test. See the above PR for details. Thanks for reporting! |
@gmarz Good to hear, any idea when this will be released via nuget? |
@goalie7960, we are aiming for next week. In the mean time, you can grab our CI nuget package from myget: https://www.myget.org/gallery/elasticsearch-net |
This used to work in v0.12. Here is the class I want to index:
Then I do the following mapping:
I get the following exception:
"Type is not a class or interface Parameter name: type"
Call stack is as follows:
at Nest.Resolvers.ElasticAttributes._Type(Type type) in c:\Users\gmarz\code\elasticsearch-net\src\Nest\Resolvers\PropertyNameResolver.cs:line 52
at Nest.Resolvers.ElasticAttributes.Type(Type type) in c:\Users\gmarz\code\elasticsearch-net\src\Nest\Resolvers\PropertyNameResolver.cs:line 42
at Nest.Resolvers.TypeNameResolver.GetTypeNameFor(Type type) in c:\Users\gmarz\code\elasticsearch-net\src\Nest\Resolvers\TypeNameResolver.cs:line 32
at Nest.ElasticInferrer.TypeName(Type t) in c:\Users\gmarz\code\elasticsearch-net\src\Nest\ExposedInternals\ElasticInferrer.cs:line 127
at Nest.Resolvers.Writers.TypeMappingWriter.WriteProperties(JsonWriter jsonWriter) in c:\Users\gmarz\code\elasticsearch-net\src\Nest\Resolvers\Writers\TypeMappingWriter.cs:line 158
at Nest.Resolvers.Writers.TypeMappingWriter.MapFromAttributes() in c:\Users\gmarz\code\elasticsearch-net\src\Nest\Resolvers\Writers\TypeMappingWriter.cs:line 116
at Nest.Resolvers.Writers.TypeMappingWriter.RootObjectMappingFromAttributes() in c:\Users\gmarz\code\elasticsearch-net\src\Nest\Resolvers\Writers\TypeMappingWriter.cs:line 78
at Nest.PutMappingDescriptor
1.MapFromAttributes(Int32 maxRecursion) in c:\Users\gmarz\code\elasticsearch-net\src\Nest\DSL\PutMappingDescriptor.cs:line 111 at ElasticSearchUpgrade.Program.<Main>b__0(PutMappingDescriptor
1 m) in d:\test\ElasticSearchUpgrade\ElasticSearchUpgrade\Program.cs:line 22at Nest.ElasticClient.Map[T](Func`2 mappingSelector) in c:\Users\gmarz\code\elasticsearch-net\src\Nest\ElasticClient-MappingType.cs:line 16
at ElasticSearchUpgrade.Program.Main(String[] args) in d:\test\ElasticSearchUpgrade\ElasticSearchUpgrade\Program.cs:line 22
at System.AppDomain._nExecuteAssembly(RuntimeAssembly assembly, String[] args)
at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)
at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Threading.ThreadHelper.ThreadStart()
The text was updated successfully, but these errors were encountered: