UNPKG

@sugarcube/plugin-elasticsearch

Version:

Use [Elasticsearch](https://www.elastic.co/products/elasticsearch) for SugarCube data.

40 lines (35 loc) 625 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.default = void 0; const byIds = ids => ({ query: { ids: { values: ids } } }); const existing = ids => Object.assign({ _source: ["$sc_id_hash"] }, byIds(ids)); const reindex = (fromIndex, fromHost, fromPort, toIndex) => ({ source: { remote: { host: `http://${fromHost}:${fromPort}`, socket_timeout: "1m", connect_timeout: "1m" }, size: 500, index: fromIndex }, dest: { index: toIndex } }); var _default = { byIds, existing, reindex }; exports.default = _default;