I'm looking at simple ways of defining, in Java, some lightweight service and data access layers on top of ElasticSearch. My POJO data objects will naturally have property names in camelCase, but I'm wondering if I should use camelCase for the field names in the ElasticSearch type mappings. In the data repository world, and in particular in traditional RDBMS, field names are definitely not camel cased. If I'm not mistaken, there seems to be a trend in the NoSql world to use underscores in field names, e.g. first_name. Is this a common practice for ElasticSearch ? If so, does this mean I have to configure a Jackson based conversion service that is able to map back and forth between the camelCase and underscored field names ?
Just do what is best for your application. Having a mapping service introduces overhead that will slow things down, especially with large amounts of data. I'm using it primarily with JavaScript applications and I use camelCase.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With