miku / esbulk

Bulk indexing command line tool for elasticsearch.
GNU General Public License v3.0
281 stars 40 forks source link

Support for ids with multiple fields and '.' separated JSON nested fields #8

Closed sakshambathla closed 7 years ago

sakshambathla commented 7 years ago

To use multiple field ids, concatenate all those field to form an id field ( comma separated after -id ). Also support for nested JSON '.' separated format.

To make a new id field with concatenated fields, the command looks like:

esbulk -index index_name -type type_name -id field1,field2 -w 10 filename.ldj

Also, in case of nested JSON, a field name can be accessed like:

field1.subfield1.ssfield1

Example esbulk -index index_name -type type_name -id field1,field2.subfield1.ssfield1 -w 10 filename.ldj

sakshambathla commented 7 years ago

Completed the changes. Hope it is fine now.

miku commented 7 years ago

Thanks a lot! I created a new release adding these changes: 0.4.3