From 59505ed93d14495c9b16619f7bfa7dafe664ff54 Mon Sep 17 00:00:00 2001 From: Keerthi Niranjan Date: Mon, 28 Aug 2017 14:18:48 +0530 Subject: [PATCH] SEARCH-154 & SEARCH-116 1. Serialized the messages array from the client app --- js/search/search.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/js/search/search.js b/js/search/search.js index 7a329f6a..81ab1ec7 100644 --- a/js/search/search.js +++ b/js/search/search.js @@ -109,7 +109,7 @@ class Search { */ indexBatch(messages) { return new Promise((resolve, reject) => { - if (!Array.isArray(messages)) { + if (!messages && !(JSON.parse(messages) instanceof Array)) { reject(new Error('Messages must be an array')); return; } @@ -120,7 +120,7 @@ class Search { } const indexId = randomString.generate(BATCH_RANDOM_INDEX_PATH_LENGTH); - libSymphonySearch.symSECreatePartialIndexAsync(this.batchIndex, indexId, JSON.stringify(messages), (err, res) => { + libSymphonySearch.symSECreatePartialIndexAsync(this.batchIndex, indexId, messages, (err, res) => { if (err) { reject(new Error(err)); }