Commit 22b78aa0 by Torkel Ödegaard

Merge pull request #1632 from swehner/limit-search-results

Limit ElasticSearch to return only title and tags for dashboard search
parents 15cb1d89 527e802b
...@@ -270,7 +270,8 @@ function (angular, _, config, kbn, moment) { ...@@ -270,7 +270,8 @@ function (angular, _, config, kbn, moment) {
query: { query_string: { query: queryString } }, query: { query_string: { query: queryString } },
facets: { tags: { terms: { field: "tags", order: "term", size: 50 } } }, facets: { tags: { terms: { field: "tags", order: "term", size: 50 } } },
size: this.searchMaxResults, size: this.searchMaxResults,
sort: ["_uid"] sort: ["_uid"],
fields: ["title", "tags"]
}; };
return this._post('/dashboard/_search', query) return this._post('/dashboard/_search', query)
...@@ -286,8 +287,8 @@ function (angular, _, config, kbn, moment) { ...@@ -286,8 +287,8 @@ function (angular, _, config, kbn, moment) {
var hit = resultsHits[i]; var hit = resultsHits[i];
displayHits.dashboards.push({ displayHits.dashboards.push({
id: hit._id, id: hit._id,
title: hit._source.title, title: hit.fields.title,
tags: hit._source.tags tags: hit.fields.tags
}); });
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment