MM-45723: Include DM/GM channels for user indexing (#21391)
There were 2 separate issues here: 1. We were excluding DM/GM channels for user indexing. Not sure why. This prevented users to be shown as channel members in autocomplete results in both Bleve and Elasticsearch. 2. We were incorrectly deciding to search across the team based on if the current channel is in the list of allowed channels or not. But we were incorrectly wiping the list of allowed channels even if a channelid was passed. This makes it work same as a DB search. One catch is that for the correct results to appear, a re-indexing is required. ```release-note Autocompletion results using Elasticsearch or Bleve will correctly show a user as a channel member in DM/GM channels. To force this change to appear, a re-indexing will be necessary. ```
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
28698abb9f
Коммит
10a627fac1
@@ -1805,7 +1805,16 @@ func (us SqlUserStore) GetUsersBatchForIndexing(startTime int64, startFileID str
|
||||
`).
|
||||
From("ChannelMembers cm").
|
||||
Join("Channels c ON cm.ChannelId = c.Id").
|
||||
Where(sq.Eq{"c.Type": model.ChannelTypeOpen, "cm.UserId": userIds}).
|
||||
Where(sq.And{
|
||||
sq.Eq{
|
||||
"cm.UserId": userIds,
|
||||
},
|
||||
sq.Or{
|
||||
sq.Eq{"c.Type": model.ChannelTypeOpen},
|
||||
sq.Eq{"c.Type": model.ChannelTypeDirect},
|
||||
sq.Eq{"c.Type": model.ChannelTypeGroup},
|
||||
},
|
||||
}).
|
||||
ToSql()
|
||||
if err != nil {
|
||||
return nil, errors.Wrap(err, "GetUsersBatchForIndexing_ToSql2")
|
||||
|
||||
Ссылка в новой задаче
Block a user