summaryrefslogtreecommitdiffstats
path: root/model/search_params.go
diff options
context:
space:
mode:
authorCorey Hulen <corey@hulen.com>2017-04-17 07:54:26 -0700
committerChristopher Speller <crspeller@gmail.com>2017-04-17 10:54:26 -0400
commit32078865147dc4779023e036aba164842067e58b (patch)
treed94cf763a265630ea0e963a0d847d6391627ed24 /model/search_params.go
parent7e29dc65aaf5b310f1c1e3b8e8849103892e1ffe (diff)
downloadchat-32078865147dc4779023e036aba164842067e58b.tar.gz
chat-32078865147dc4779023e036aba164842067e58b.tar.bz2
chat-32078865147dc4779023e036aba164842067e58b.zip
Adding the ability to disable full text search queries for master (#6102)
Diffstat (limited to 'model/search_params.go')
-rw-r--r--model/search_params.go10
1 files changed, 10 insertions, 0 deletions
diff --git a/model/search_params.go b/model/search_params.go
index 802ec1be8..070ac6d24 100644
--- a/model/search_params.go
+++ b/model/search_params.go
@@ -4,6 +4,7 @@
package model
import (
+ "encoding/json"
"regexp"
"strings"
)
@@ -19,6 +20,15 @@ type SearchParams struct {
OrTerms bool
}
+func (o *SearchParams) ToJson() string {
+ b, err := json.Marshal(o)
+ if err != nil {
+ return ""
+ } else {
+ return string(b)
+ }
+}
+
var searchFlags = [...]string{"from", "channel", "in"}
func splitWordsNoQuotes(text string) []string {