From 527e802b05d808531381ce3020e34f19c8a3aeb1 Mon Sep 17 00:00:00 2001 From: Stefan Wehner Date: Tue, 24 Mar 2015 11:37:26 +0100 Subject: [PATCH] Limit ElasticSearch return to title and tags --- src/app/features/elasticsearch/datasource.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/app/features/elasticsearch/datasource.js b/src/app/features/elasticsearch/datasource.js index 3c82d98f8d2..8fb9d8c12d5 100644 --- a/src/app/features/elasticsearch/datasource.js +++ b/src/app/features/elasticsearch/datasource.js @@ -270,7 +270,8 @@ function (angular, _, config, kbn, moment) { query: { query_string: { query: queryString } }, facets: { tags: { terms: { field: "tags", order: "term", size: 50 } } }, size: this.searchMaxResults, - sort: ["_uid"] + sort: ["_uid"], + fields: ["title", "tags"] }; return this._post('/dashboard/_search', query) @@ -286,8 +287,8 @@ function (angular, _, config, kbn, moment) { var hit = resultsHits[i]; displayHits.dashboards.push({ id: hit._id, - title: hit._source.title, - tags: hit._source.tags + title: hit.fields.title, + tags: hit.fields.tags }); }