Skip to content

NullReference in DateMappingDescriptor #990

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

Closed
ThomasVer opened this issue Oct 15, 2014 · 1 comment
Closed

NullReference in DateMappingDescriptor #990

ThomasVer opened this issue Oct 15, 2014 · 1 comment

Comments

@ThomasVer
Copy link

When trying to add a field to a date mapping in a DynamicTemplate, I keep getting a NullReference.
See below for a snippet of my code:

.DynamicTemplates(d => d
                        .Add(dt => dt
                            .Name("date_template")
                            .Match("*_date")
                            .MatchMappingType("date")
                            .Mapping(mp => mp
                                .Date(date => date
                                    .Format("basic_date || date|| yyyy/MM/dd || dd/MM/yyyy || dd-MM-yyyy || MM/dd/yyyy || MM-dd-yyyy")
                                    .Fields(f => f
                                        .String(fs => fs
                                            .Name("raw")
                                            .Analyzer("number_delimiter")
                                        )
                                    )
                                )
                            )
                        )

Error is encountered on this line:

[NullReferenceException: Object reference not set to an instance of an object.]
   Nest.DateMappingDescriptor`1.Fields(Func`2 fieldSelector) in c:\Users\gmarz\code\elasticsearch-net\src\Nest\Domain\Mapping\Descriptors\DateMappingDescriptor.cs:87
@Mpdreamz
Copy link
Member

ty @ThomasVer using multifield on date properties indeed resulted in a NRE, this should now be fixed.

Thanks for reporting!

@gmarz gmarz added Bug and removed v1.1.3 labels Oct 17, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants