Skip to content
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

Closed
wants to merge 39 commits into from
Closed

Conversation

jespino
Copy link
Member

@jespino jespino commented Nov 27, 2019

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.

@jespino jespino added the Work In Progress Not yet ready for review label Nov 27, 2019
jobServer *jobs.JobServer
}

var emailRegex = regexp.MustCompile(`^[^\s"]+@[^\s"]+$`)
Copy link
Contributor

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) {
Copy link
Contributor

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 {
Copy link
Contributor

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 {
Copy link
Contributor

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) {
Copy link
Contributor

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
Copy link
Contributor

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)

Suggested change
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,
Copy link
Contributor

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,
Copy link
Contributor

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)
Copy link
Contributor

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)
Copy link
Contributor

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)

@jasonblais
Copy link
Contributor

Copy link
Member

@agnivade agnivade left a 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.

go.mod Show resolved Hide resolved
services/searchengine/searchengine.go Show resolved Hide resolved
app/helper_test.go Show resolved Hide resolved
services/searchengine/nullengine/null.go Show resolved Hide resolved
app/enterprise.go Show resolved Hide resolved
app/enterprise.go Show resolved Hide resolved
app/app.go Show resolved Hide resolved
@jespino
Copy link
Member Author

jespino commented Mar 13, 2020

Closing this because is no longer needed, probably @mgdelacroix is going to address it in his own branches.

@jespino jespino closed this Mar 13, 2020
@cpanato cpanato deleted the bleve branch April 27, 2021 09:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Lifecycle/frozen Work In Progress Not yet ready for review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants