Skip to content
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

Ability to specify field type #16

Open
verglor opened this issue Oct 14, 2018 · 2 comments
Open

Ability to specify field type #16

verglor opened this issue Oct 14, 2018 · 2 comments

Comments

@verglor
Copy link
Collaborator

verglor commented Oct 14, 2018

It would be great if it was possible to explicitly specify elasticsearch type for the field.
Something like this:

class Domain {

    OffsetDateTime date

    static searchable = {
        date converter: OffsetDateTimeConverter, type: 'date'
    }

}
@verglor
Copy link
Collaborator Author

verglor commented Oct 14, 2018

Actually looking at ElasticSearchMappingFactory#L197 I have found out that if converter is string representing elasticsearch type, it is interpreted as type. Like this:

class Domain {

    OffsetDateTime date

    static searchable = {
        date converter: 'date'
    }

}

This is undocumented and quite confusing.

@paulbarker
Copy link

+1. I have an 'Address' domain with the 'country' property as a String which gets mapped as 'text'. So the only way I can get aggregations on Elastic is by changing it to an enum to get the 'keyword' type.
Lots of changes to my code (arguably for the better but still...)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants