MM-6992 Added highlighting to elasticsearch results (#8861)

* MM-6992 Added highlighting to elasticsearch results

* Added a unique type for post search matches

* Fixed Elasticsearch matches not being sent through API
Этот коммит содержится в:
Harrison Healey
2018-06-19 05:46:29 -04:00
коммит произвёл Carlos Tadeu Panato Junior
родитель 6d8140337e
Коммит 226d4b2ac8
6 изменённых файлов: 65 добавлений и 8 удалений

Просмотреть файл

@@ -341,7 +341,7 @@ func searchPosts(c *Context, w http.ResponseWriter, r *http.Request) {
startTime := time.Now()
posts, err := c.App.SearchPostsInTeam(terms, c.Session.UserId, c.Params.TeamId, isOrSearch)
results, err := c.App.SearchPostsInTeam(terms, c.Session.UserId, c.Params.TeamId, isOrSearch)
elapsedTime := float64(time.Since(startTime)) / float64(time.Second)
metrics := c.App.Metrics
@@ -355,8 +355,10 @@ func searchPosts(c *Context, w http.ResponseWriter, r *http.Request) {
return
}
results = model.MakePostSearchResults(c.App.PostListWithProxyAddedToImageURLs(results.PostList), results.Matches)
w.Header().Set("Cache-Control", "no-cache, no-store, must-revalidate")
w.Write([]byte(c.App.PostListWithProxyAddedToImageURLs(posts).ToJson()))
w.Write([]byte(results.ToJson()))
}
func updatePost(c *Context, w http.ResponseWriter, r *http.Request) {