summaryrefslogtreecommitdiffstats
path: root/app
diff options
context:
space:
mode:
authorGeorge Goldberg <george@gberg.me>2017-07-07 15:36:17 +0100
committerGitHub <noreply@github.com>2017-07-07 15:36:17 +0100
commitdb2f6cf0766543b6d9e9fb4ecd10947ce60b46b9 (patch)
treebadd2021308c320d893824bc1ac1b28ba92d384d /app
parent0495a519499d6cefa289982a94d8f42de541c1f0 (diff)
downloadchat-db2f6cf0766543b6d9e9fb4ecd10947ce60b46b9.tar.gz
chat-db2f6cf0766543b6d9e9fb4ecd10947ce60b46b9.tar.bz2
chat-db2f6cf0766543b6d9e9fb4ecd10947ce60b46b9.zip
PLT-6976: Elasticsearch capitalisation and tests. (#6839)
* Fixes Elasticsearch to have consistent capitalisation everywhere across the code and UI (except the config file unfortunately). * Adds basic unit tests for Elastichsearch. * Adds a Elasticsearch docker image to the Makefile to enable testing the Elasticsearch feature.
Diffstat (limited to 'app')
-rw-r--r--app/elasticsearch.go2
-rw-r--r--app/post.go12
2 files changed, 7 insertions, 7 deletions
diff --git a/app/elasticsearch.go b/app/elasticsearch.go
index c021b15e8..87687ddcc 100644
--- a/app/elasticsearch.go
+++ b/app/elasticsearch.go
@@ -11,7 +11,7 @@ import (
)
func TestElasticsearch() *model.AppError {
- if esI := einterfaces.GetElasticSearchInterface(); esI != nil {
+ if esI := einterfaces.GetElasticsearchInterface(); esI != nil {
if err := esI.TestConfig(); err != nil {
return err
}
diff --git a/app/post.go b/app/post.go
index f5eb29367..d9e08c864 100644
--- a/app/post.go
+++ b/app/post.go
@@ -99,7 +99,7 @@ func CreatePost(post *model.Post, teamId string, triggerWebhooks bool) (*model.P
rpost = result.Data.(*model.Post)
}
- esInterface := einterfaces.GetElasticSearchInterface()
+ esInterface := einterfaces.GetElasticsearchInterface()
if esInterface != nil && *utils.Cfg.ElasticSearchSettings.EnableIndexing {
go esInterface.IndexPost(rpost, teamId)
}
@@ -284,7 +284,7 @@ func UpdatePost(post *model.Post, safeUpdate bool) (*model.Post, *model.AppError
} else {
rpost := result.Data.(*model.Post)
- esInterface := einterfaces.GetElasticSearchInterface()
+ esInterface := einterfaces.GetElasticsearchInterface()
if esInterface != nil && *utils.Cfg.ElasticSearchSettings.EnableIndexing {
go func() {
if rchannel := <-Srv.Store.Channel().GetForPost(rpost.Id); rchannel.Err != nil {
@@ -471,7 +471,7 @@ func DeletePost(postId string) (*model.Post, *model.AppError) {
go DeletePostFiles(post)
go DeleteFlaggedPosts(post.Id)
- esInterface := einterfaces.GetElasticSearchInterface()
+ esInterface := einterfaces.GetElasticsearchInterface()
if esInterface != nil && *utils.Cfg.ElasticSearchSettings.EnableIndexing {
go esInterface.DeletePost(post.Id)
}
@@ -502,8 +502,8 @@ func DeletePostFiles(post *model.Post) {
func SearchPostsInTeam(terms string, userId string, teamId string, isOrSearch bool) (*model.PostList, *model.AppError) {
paramsList := model.ParseSearchParams(terms)
- esInterface := einterfaces.GetElasticSearchInterface()
- if esInterface != nil && *utils.Cfg.ElasticSearchSettings.EnableSearching && utils.IsLicensed && *utils.License.Features.ElasticSearch {
+ esInterface := einterfaces.GetElasticsearchInterface()
+ if esInterface != nil && *utils.Cfg.ElasticSearchSettings.EnableSearching && utils.IsLicensed && *utils.License.Features.Elasticsearch {
finalParamsList := []*model.SearchParams{}
for _, params := range paramsList {
@@ -539,7 +539,7 @@ func SearchPostsInTeam(terms string, userId string, teamId string, isOrSearch bo
return nil, err
}
- postIds, err := einterfaces.GetElasticSearchInterface().SearchPosts(userChannels, finalParamsList)
+ postIds, err := einterfaces.GetElasticsearchInterface().SearchPosts(userChannels, finalParamsList)
if err != nil {
return nil, err
}