mirror of
https://github.com/mattermost/mattermost.git
synced 2025-02-25 18:55:24 -06:00
postgres use specific full text idx (#11022)
This commit is contained in:
committed by
Jesse Hallam
parent
72d482de0e
commit
56e629e842
@@ -2218,7 +2218,7 @@ func (s SqlChannelStore) buildFulltextClause(term string, searchColumns string)
|
||||
|
||||
fulltextTerm = strings.Join(splitTerm, " ")
|
||||
|
||||
fulltextClause = fmt.Sprintf("((%s) @@ to_tsquery(:FulltextTerm))", convertMySQLFullTextColumnsToPostgres(searchColumns))
|
||||
fulltextClause = fmt.Sprintf("((to_tsvector('english', %s)) @@ to_tsquery(:FulltextTerm))", convertMySQLFullTextColumnsToPostgres(searchColumns))
|
||||
} else if s.DriverName() == model.DATABASE_DRIVER_MYSQL {
|
||||
splitTerm := strings.Fields(fulltextTerm)
|
||||
for i, t := range strings.Fields(fulltextTerm) {
|
||||
|
||||
@@ -893,7 +893,7 @@ func (s *SqlPostStore) Search(teamId string, userId string, params *model.Search
|
||||
terms = strings.Join(strings.Fields(terms), " & ")
|
||||
}
|
||||
|
||||
searchClause := fmt.Sprintf("AND %s @@ to_tsquery(:Terms)", searchType)
|
||||
searchClause := fmt.Sprintf("AND to_tsvector('english', %s) @@ to_tsquery(:Terms)", searchType)
|
||||
searchQuery = strings.Replace(searchQuery, "SEARCH_CLAUSE", searchClause, 1)
|
||||
} else if s.DriverName() == model.DATABASE_DRIVER_MYSQL {
|
||||
searchClause := fmt.Sprintf("AND MATCH (%s) AGAINST (:Terms IN BOOLEAN MODE)", searchType)
|
||||
|
||||
Reference in New Issue
Block a user