New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
SearchEngine architecture and experimental Bleve feature #13228
Conversation
jobServer *jobs.JobServer | ||
} | ||
|
||
var emailRegex = regexp.MustCompile(`^[^\s"]+@[^\s"]+$`) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
emailRegex
is unused (from varcheck
)
} | ||
|
||
// ToDo: this is a duplicate | ||
func getMatchesForHit(highlights map[string][]string) ([]string, error) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
getMatchesForHit
is unused (from deadcode
)
} | ||
|
||
// ToDo: from elastic/testlib, generalise for both? | ||
func createPostAtTime(userId string, channelId string, message string, createAt int64) *model.Post { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
createPostAtTime
is unused (from deadcode
)
} | ||
|
||
// ToDo: from elastic/testlib, generalise for both? | ||
func createPostWithHashtags(userId string, channelId string, message string, hashtags string) *model.Post { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
createPostWithHashtags
is unused (from deadcode
)
} | ||
|
||
// ToDo: from elastic/testlib, generalise for both? | ||
func checkMatchesEqual(t *testing.T, expected model.PostSearchMatches, actual map[string][]string) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
checkMatchesEqual
is unused (from deadcode
)
for i, params := range searchParams { | ||
// ToDo: needs email filtering | ||
/* | ||
Not valid, probably will be TermQueries on the emails |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
File is not gofmt
-ed with -s
(from gofmt
)
Not valid, probably will be TermQueries on the emails | |
Not valid, probably will be TermQueries on the emails |
|
||
func BLVPostFromPost(post *model.Post, teamId string) *BLVPost { | ||
return &BLVPost{ | ||
Id: post.Id, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
File is not gofmt
-ed with -s
(from gofmt
)
} | ||
|
||
s.engine = &BleveEngine{ | ||
postIndex: postIndex, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
File is not gofmt
-ed with -s
(from gofmt
)
} | ||
|
||
// Check the post is found as expected | ||
ids, matches, err := s.engine.SearchPosts(channels, searchParams, 0, 20) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ineffectual assignment to matches
(from ineffassign
)
err := c.ChannelStore.PermanentDeleteMembersByChannel(channelId) | ||
|
||
if err == nil { | ||
profiles, err := c.rootStore.User().GetAllProfilesInChannel(channelId, false) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
shadow: declaration of "err" shadows declaration at line 146 (from govet
)
Prioritization being considered. Follow-up Jira tickets: https://mattermost.atlassian.net/browse/MM-20978, https://mattermost.atlassian.net/browse/MM-20979, https://mattermost.atlassian.net/browse/MM-20980, https://mattermost.atlassian.net/browse/MM-20981. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seriously great piece of work ! I just have some small comments which I think can improve this further.
Closing this because is no longer needed, probably @mgdelacroix is going to address it in his own branches. |
This changes included a redesign of the search approach, generalizing the search backends behind a search engine interface, and moving all the searches into a database layer. Beside it implements the initial experimental implementation for Bleve.