diff options
author | Christopher Speller <crspeller@gmail.com> | 2018-04-16 05:37:14 -0700 |
---|---|---|
committer | Joram Wilander <jwawilander@gmail.com> | 2018-04-16 08:37:14 -0400 |
commit | 6e2cb00008cbf09e556b00f87603797fcaa47e09 (patch) | |
tree | 3c0eb55ff4226a3f024aad373140d1fb860a6404 /vendor/gopkg.in/olivere/elastic.v5/search_request.go | |
parent | bf24f51c4e1cc6286885460672f7f449e8c6f5ef (diff) | |
download | chat-6e2cb00008cbf09e556b00f87603797fcaa47e09.tar.gz chat-6e2cb00008cbf09e556b00f87603797fcaa47e09.tar.bz2 chat-6e2cb00008cbf09e556b00f87603797fcaa47e09.zip |
Depenancy upgrades and movign to dep. (#8630)
Diffstat (limited to 'vendor/gopkg.in/olivere/elastic.v5/search_request.go')
-rw-r--r-- | vendor/gopkg.in/olivere/elastic.v5/search_request.go | 27 |
1 files changed, 9 insertions, 18 deletions
diff --git a/vendor/gopkg.in/olivere/elastic.v5/search_request.go b/vendor/gopkg.in/olivere/elastic.v5/search_request.go index 7ee4ce82c..f9dff52d9 100644 --- a/vendor/gopkg.in/olivere/elastic.v5/search_request.go +++ b/vendor/gopkg.in/olivere/elastic.v5/search_request.go @@ -13,7 +13,7 @@ import ( // query details (see SearchSource). // It is used in combination with MultiSearch. type SearchRequest struct { - searchType string // default in ES is "query_then_fetch" + searchType string indices []string types []string routing *string @@ -31,38 +31,29 @@ func NewSearchRequest() *SearchRequest { return &SearchRequest{} } -// SearchRequest must be one of "query_then_fetch", "query_and_fetch", -// "scan", "count", "dfs_query_then_fetch", or "dfs_query_and_fetch". -// Use one of the constants defined via SearchType. +// SearchRequest must be one of dfs_query_then_fetch, query_then_fetch +// or query_and_fetch (deprecated in 5.3). func (r *SearchRequest) SearchType(searchType string) *SearchRequest { r.searchType = searchType return r } +// SearchTypeDfsQueryThenFetch sets search type to dfs_query_then_fetch. func (r *SearchRequest) SearchTypeDfsQueryThenFetch() *SearchRequest { return r.SearchType("dfs_query_then_fetch") } -func (r *SearchRequest) SearchTypeDfsQueryAndFetch() *SearchRequest { - return r.SearchType("dfs_query_and_fetch") -} - +// SearchTypeQueryThenFetch sets search type to query_then_fetch. func (r *SearchRequest) SearchTypeQueryThenFetch() *SearchRequest { return r.SearchType("query_then_fetch") } +// SearchTypeQueryAndFetch sets search type to query_and_fetch which +// was deprecated in 5.3. func (r *SearchRequest) SearchTypeQueryAndFetch() *SearchRequest { return r.SearchType("query_and_fetch") } -func (r *SearchRequest) SearchTypeScan() *SearchRequest { - return r.SearchType("scan") -} - -func (r *SearchRequest) SearchTypeCount() *SearchRequest { - return r.SearchType("count") -} - func (r *SearchRequest) Index(indices ...string) *SearchRequest { r.indices = append(r.indices, indices...) return r @@ -139,7 +130,7 @@ func (r *SearchRequest) Source(source interface{}) *SearchRequest { // header is used e.g. by MultiSearch to get information about the search header // of one SearchRequest. -// See https://www.elastic.co/guide/en/elasticsearch/reference/6.0/search-multi-search.html +// See https://www.elastic.co/guide/en/elasticsearch/reference/5.2/search-multi-search.html func (r *SearchRequest) header() interface{} { h := make(map[string]interface{}) if r.searchType != "" { @@ -192,7 +183,7 @@ func (r *SearchRequest) header() interface{} { // // Body is used e.g. by MultiSearch to get information about the search body // of one SearchRequest. -// See https://www.elastic.co/guide/en/elasticsearch/reference/6.0/search-multi-search.html +// See https://www.elastic.co/guide/en/elasticsearch/reference/5.6/search-multi-search.html func (r *SearchRequest) Body() (string, error) { switch t := r.source.(type) { default: |