Skip to content

Multifield: MapperParsingException when using dot #1707

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
tomasfalt opened this issue Jan 11, 2016 · 6 comments
Closed

Multifield: MapperParsingException when using dot #1707

tomasfalt opened this issue Jan 11, 2016 · 6 comments

Comments

@tomasfalt
Copy link

When I map a Multifield called Name I get the following error:

MapperParsingException[Field name [name.raw] which is a multi field of [name] cannot contain '.']

I know that field name with dots is not longer allowed in ES 2.0 but I can't see a solution to this then using Multifields.

@tomasfalt tomasfalt changed the title Multifield: MapperParsingException then using dot Multifield: MapperParsingException when using dot Jan 11, 2016
@russcam
Copy link
Contributor

russcam commented Jan 11, 2016

@tomasfalt Can you provide the relevant mapping please? In addition, what version of NEST and Elasticsearch are you using?

@tomasfalt
Copy link
Author

@russcam I'm using NEST 2.0.0-alpha1 and ES 2.1.1.

The mapping:

var mapping = propertiesDescriptor.String(
                    s1 =>
                        s1.Name(p => p.Name)
                            .Analyzer("standard")
                            .Fields(fs => fs.String(s2 => s2.Name(p2 => p2.Name.Suffix("raw")).Index(FieldIndexOption.NotAnalyzed))))

I found this: https://discuss.elastic.co/t/elasticsearch-2-mapping/34366. It sounds like the same problem?

@tomasfalt
Copy link
Author

Sorry... Wrong button

@tomasfalt tomasfalt reopened this Jan 11, 2016
@gmarz
Copy link
Contributor

gmarz commented Jan 11, 2016

@tomasfalt yea, that's correct. You don't need to supply the suffix explicitly anymore, since it's a multi-field, ES will create this for you automatically.

Just try:

 .Fields(fs => fs.String(s2 => s2.Name(p2 => p2.Name("raw").Index(FieldIndexOption.NotAnalyzed))))

@gmarz
Copy link
Contributor

gmarz commented Jan 11, 2016

@tomasfalt while my above comment will fix the issue, after some internal discussion we should change PropertyName to always resolve to the last token. I've opened #1708 for this.

@tomasfalt
Copy link
Author

Ok, great. Thanks!

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