postgres use specific full text idx (#11022)

This commit is contained in:
Sven Hüster
2019-06-26 14:12:47 +02:00
committed by Jesse Hallam
parent 72d482de0e
commit 56e629e842
2 changed files with 2 additions and 2 deletions

View File

@@ -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) {

View File

@@ -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)