From 824917b029826384129e504e83739fcc55541b4f Mon Sep 17 00:00:00 2001 From: nickago Date: Thu, 13 Aug 2015 15:52:52 -0700 Subject: Added wildcard highlighting and removed redundant whitespace parsing --- store/sql_post_store.go | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'store/sql_post_store.go') diff --git a/store/sql_post_store.go b/store/sql_post_store.go index fdff27b82..e30691154 100644 --- a/store/sql_post_store.go +++ b/store/sql_post_store.go @@ -419,15 +419,15 @@ func (s SqlPostStore) Search(teamId string, userId string, terms string, isHasht // cannot escape it so we replace it. terms = strings.Replace(terms, "@", " ", -1) - // Parse text for wildcards - if wildcard, err := regexp.Compile("\\*($| )"); err == nil { - terms = wildcard.ReplaceAllLiteralString(terms, ":* ") - terms = strings.Replace(terms, " ", " ", -1) - } - var posts []*model.Post if utils.Cfg.SqlSettings.DriverName == "postgres" { + + // Parse text for wildcards + if wildcard, err := regexp.Compile("\\*($| )"); err == nil { + terms = wildcard.ReplaceAllLiteralString(terms, ":* ") + } + searchQuery := fmt.Sprintf(`SELECT * FROM -- cgit v1.2.3-1-g7c22