summaryrefslogtreecommitdiffstats
path: root/store/sqlstore/channel_store.go
diff options
context:
space:
mode:
authorChris Duarte <csduarte@users.noreply.github.com>2018-06-26 10:47:39 -0700
committerHarrison Healey <harrisonmhealey@gmail.com>2018-06-26 13:47:39 -0400
commit41d2a9f4352b9ee32bfa77da9ffed03b302d1314 (patch)
tree999d022bc771926ad54d8660cc5912b240cdd956 /store/sqlstore/channel_store.go
parent3e9fe291f155e711bc2371f5dd57d1d15960bb1d (diff)
downloadchat-41d2a9f4352b9ee32bfa77da9ffed03b302d1314.tar.gz
chat-41d2a9f4352b9ee32bfa77da9ffed03b302d1314.tar.bz2
chat-41d2a9f4352b9ee32bfa77da9ffed03b302d1314.zip
Add Purpose as a searchable field (#8067)
* Add Purpose as a searchable field * Add New Index and Remove old for Channels * Include Purpose in FullTextSearch Clause * Move removeIndex for Channels into upgrade.go
Diffstat (limited to 'store/sqlstore/channel_store.go')
-rw-r--r--store/sqlstore/channel_store.go6
1 files changed, 3 insertions, 3 deletions
diff --git a/store/sqlstore/channel_store.go b/store/sqlstore/channel_store.go
index eb88bc42a..e062d41d1 100644
--- a/store/sqlstore/channel_store.go
+++ b/store/sqlstore/channel_store.go
@@ -298,7 +298,7 @@ func (s SqlChannelStore) CreateIndexesIfNotExists() {
s.CreateIndexIfNotExists("idx_channelmembers_channel_id", "ChannelMembers", "ChannelId")
s.CreateIndexIfNotExists("idx_channelmembers_user_id", "ChannelMembers", "UserId")
- s.CreateFullTextIndexIfNotExists("idx_channels_txt", "Channels", "Name, DisplayName")
+ s.CreateFullTextIndexIfNotExists("idx_channel_search_txt", "Channels", "Name, DisplayName, Purpose")
}
func (s SqlChannelStore) Save(channel *model.Channel, maxChannelsPerTeam int64) store.StoreChannel {
@@ -1573,7 +1573,7 @@ func (s SqlChannelStore) SearchMore(userId string, teamId string, term string) s
func (s SqlChannelStore) buildLIKEClause(term string) (likeClause, likeTerm string) {
likeTerm = term
- searchColumns := "Name, DisplayName"
+ searchColumns := "Name, DisplayName, Purpose"
// These chars must be removed from the like query.
for _, c := range ignoreLikeSearchChar {
@@ -1608,7 +1608,7 @@ func (s SqlChannelStore) buildFulltextClause(term string) (fulltextClause, fullt
// Copy the terms as we will need to prepare them differently for each search type.
fulltextTerm = term
- searchColumns := "Name, DisplayName"
+ searchColumns := "Name, DisplayName, Purpose"
// These chars must be treated as spaces in the fulltext query.
for _, c := range spaceFulltextSearchChar {