Last active
August 29, 2015 14:13
-
-
Save muminoff/6f09ca9785c8bd795675 to your computer and use it in GitHub Desktop.
Elasticsearch javascript example
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var jsBody = {}, | |
| i, | |
| arr_1 = [row1, row2, row3, row4]; | |
| arr_2 = [field1, field2, field3, field4]; | |
| for (i = 0; i < arr_1.length; i++) { | |
| jsBody[arr_1[i]] = arr_2[i]; | |
| } | |
| client.index( | |
| index: name_index, | |
| type: name_type, | |
| body: jsBody | |
| ... | |
| } | |
| ) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment