function testSearchAll() { ESClient.search({ index: "imdb", body: { size: 10, from: 0, query: { match_all: {} } } }) .then(results => { console.log("|Test SearchAll|"); console.log("-----------------------------------"); console.log("Response Body: "); console.log(results); console.log(`found ${results.hits.total} items in ${results.took}ms`); console.log("returned 10 imdb titles:"); results.hits.hits.forEach((hit, index) => console.log(`\t${index} - ${hit._source.title}`) ); }) .catch(console.error); }
const response = await this.es.search(`${this.env.INDEX_PERF}-*`, this.route, blQuery); this.esTrace.push({ type: 'ES_RESPONSE', response: response }); this.es_took = response.took; if (response.hasOwnProperty('aggregations')) { this.baseline = this.checkBaseline(response);