Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Best practices for field names in ElasticSearch

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 ?

like image 344
Fabien Coppens Avatar asked Mar 04 '15 18:03

Fabien Coppens


1 Answers

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.

like image 179
Justin Warkentin Avatar answered Oct 17 '22 20:10

Justin Warkentin