mirror of
https://github.com/finos/SymphonyElectron.git
synced 2024-12-29 02:11:28 -06:00
SEARCH-155
Index real-time data. - Read messages from data feed - Index the messages in real-time index.
This commit is contained in:
parent
59505ed93d
commit
652a3389f3
@ -6,6 +6,7 @@ const electron = require('electron');
|
|||||||
const childProcess = require('child_process');
|
const childProcess = require('child_process');
|
||||||
const app = electron.app;
|
const app = electron.app;
|
||||||
const path = require('path');
|
const path = require('path');
|
||||||
|
const isObject = require('lodash.isplainobject');
|
||||||
const isDevEnv = require('../utils/misc.js').isDevEnv;
|
const isDevEnv = require('../utils/misc.js').isDevEnv;
|
||||||
const isMac = require('../utils/misc.js').isMac;
|
const isMac = require('../utils/misc.js').isMac;
|
||||||
|
|
||||||
@ -151,15 +152,15 @@ class Search {
|
|||||||
* @param message
|
* @param message
|
||||||
*/
|
*/
|
||||||
realTimeIndexing(message) {
|
realTimeIndexing(message) {
|
||||||
if (!Array.isArray(message)) {
|
if (!message && !isObject(JSON.parse(message))) {
|
||||||
return new Error('Messages should be an array');
|
return new Error('Messages must be an object');
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!this.isInitialized) {
|
if (!this.isInitialized) {
|
||||||
return new Error('Library not initialized');
|
return new Error('Library not initialized');
|
||||||
}
|
}
|
||||||
|
|
||||||
let result = libSymphonySearch.symSEIndexRealTime(this.realTimeIndex, JSON.stringify(message));
|
let result = libSymphonySearch.symSEIndexRealTime(this.realTimeIndex, [ message ]);
|
||||||
return result === 0 ? "Successful" : result
|
return result === 0 ? "Successful" : result
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -109,6 +109,7 @@
|
|||||||
"ffi": "^2.2.0",
|
"ffi": "^2.2.0",
|
||||||
"filesize": "^3.5.10",
|
"filesize": "^3.5.10",
|
||||||
"keymirror": "0.1.1",
|
"keymirror": "0.1.1",
|
||||||
|
"lodash.isplainobject": "^4.0.6",
|
||||||
"node-forge": "^0.7.1",
|
"node-forge": "^0.7.1",
|
||||||
"randomstring": "^1.1.5",
|
"randomstring": "^1.1.5",
|
||||||
"ref": "^1.3.4",
|
"ref": "^1.3.4",
|
||||||
|
Loading…
Reference in New Issue
Block a user