diff options
Diffstat (limited to 'model')
-rw-r--r-- | model/client.go | 7 | ||||
-rw-r--r-- | model/search_params.go | 1 |
2 files changed, 6 insertions, 2 deletions
diff --git a/model/client.go b/model/client.go index f045401eb..1575df9e0 100644 --- a/model/client.go +++ b/model/client.go @@ -918,8 +918,11 @@ func (c *Client) DeletePost(channelId string, postId string) (*Result, *AppError } } -func (c *Client) SearchPosts(terms string) (*Result, *AppError) { - if r, err := c.DoApiGet(c.GetTeamRoute()+"/posts/search?terms="+url.QueryEscape(terms), "", ""); err != nil { +func (c *Client) SearchPosts(terms string, isOrSearch bool) (*Result, *AppError) { + data := map[string]interface{}{} + data["terms"] = terms + data["is_or_search"] = isOrSearch + if r, err := c.DoApiPost(c.GetTeamRoute()+"/posts/search", StringInterfaceToJson(data)); err != nil { return nil, err } else { return &Result{r.Header.Get(HEADER_REQUEST_ID), diff --git a/model/search_params.go b/model/search_params.go index d31782691..250c8e1f3 100644 --- a/model/search_params.go +++ b/model/search_params.go @@ -12,6 +12,7 @@ type SearchParams struct { IsHashtag bool InChannels []string FromUsers []string + OrTerms bool } var searchFlags = [...]string{"from", "channel", "in"} |