-
Notifications
You must be signed in to change notification settings - Fork 6.9k
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
[MM-25538] Adds the termOperator and takes it into account for terms and hashtag queries #14664
Conversation
…and hashtag queries
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.
LGTM
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.
One question
@@ -43,6 +43,11 @@ func (b *BleveEngine) SearchPosts(channels *model.ChannelList, searchParams []*m | |||
filters = append(filters, typeQ) | |||
|
|||
for i, params := range searchParams { | |||
var termOperator query.MatchQueryOperator = query.MatchQueryOperatorAnd |
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.
Question. Why don't do termOperator := query.MatchQueryOperatorAnd
?
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.
I'm not really sure why, but the type inference system doesn't play well with that assignment particularly:
# github.com/mattermost/mattermost-server/v5/services/searchengine/bleveengine
services/searchengine/bleveengine/search.go:149:25: cannot use termOperator (type int) as type query.MatchQueryOperator in argument to hashtagQ.SetOperator
services/searchengine/bleveengine/search.go:154:25: cannot use termOperator (type int) as type query.MatchQueryOperator in argument to hashtagQ.SetOperator
services/searchengine/bleveengine/search.go:161:25: cannot use termOperator (type int) as type query.MatchQueryOperator in argument to messageQ.SetOperator
services/searchengine/bleveengine/search.go:168:25: cannot use termOperator (type int) as type query.MatchQueryOperator in argument to messageQ.SetOperator
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.
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.
Awesome! Thanks for taking the time to send the PR!! ❤️
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.
Tested and looks good 👍
/update-branch |
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.
LGTM!
Will try to auto merge this PR once all tests and checks are passing. This might take up to an hour. |
1 similar comment
Will try to auto merge this PR once all tests and checks are passing. This might take up to an hour. |
Test server destroyed |
Will try to auto merge this PR once all tests and checks are passing. This might take up to an hour. |
Trying to auto merge this PR. |
Pull Request successfully merged |
Summary
Adds the term operator for both term and hashtag queries and for normal and excluded terms
Ticket Link
https://mattermost.atlassian.net/browse/MM-25538