Revert "MM-24530-Add support for search terms with underscore using postgresql engine (#16618)" (#16950)
This reverts commit ba3b788e46.
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
58b3e8d92d
Коммит
9992a27a90
@@ -1487,16 +1487,7 @@ func (s *SqlPostStore) search(teamId string, userId string, params *model.Search
|
||||
queryParams["Terms"] = "(" + strings.Join(strings.Fields(terms), " & ") + ")" + excludeClause
|
||||
}
|
||||
|
||||
searchClause := ""
|
||||
if strings.Contains(terms, "_") {
|
||||
//Strip quotes off terms with it
|
||||
if strings.Contains(terms, "\"") {
|
||||
queryParams["Terms"] = strings.ReplaceAll(queryParams["Terms"].(string), "\"", "")
|
||||
}
|
||||
searchClause = fmt.Sprintf("AND lower(%s)::tsvector @@ lower(:Terms)::tsquery", searchType)
|
||||
} else {
|
||||
searchClause = fmt.Sprintf("AND to_tsvector('english', %s) @@ to_tsquery('english', :Terms)", searchType)
|
||||
}
|
||||
searchClause := fmt.Sprintf("AND to_tsvector('english', %s) @@ to_tsquery('english', :Terms)", searchType)
|
||||
searchQuery = strings.Replace(searchQuery, "SEARCH_CLAUSE", searchClause, 1)
|
||||
} else if s.DriverName() == model.DATABASE_DRIVER_MYSQL {
|
||||
if searchType == "Message" {
|
||||
|
||||
Ссылка в новой задаче
Block a user