phillro/node-elasticsearch-client

Why not send JSON object on data event than a string which needs parsing?

Closed this issue · 3 comments

elasticSearchClient.index(indexName, objName, {'name':'name', id:"1111"})
                .on('data', function(data) { // <- why can't the data be a JSON object?

                })
                .exec();

That would have been better, but for the moment I'd rather not break anything that expects a string.

@phillro, if I submitted a PR to introduce a parseJson parameter into the server options, having it default to false for 0.5.x branch and then changing the default to true for 0.6.x - would you accept that?

Sure. Reason I did not default this was performance as I was often just
handing the data off.
On Sep 10, 2013 11:00 AM, "Eric Caron" notifications@github.com wrote:

@phillro https://github.com/phillro, if I submitted a PR to introduce a
parseJson parameter into the server options, having it default to falsefor 0.5.x branch and then changing the default to
true for 0.6.x - would you accept that?


Reply to this email directly or view it on GitHubhttps://github.com//issues/35#issuecomment-24166672
.