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_queries_bool.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_queries_bool.go')
-rw-r--r-- | vendor/gopkg.in/olivere/elastic.v5/search_queries_bool.go | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/vendor/gopkg.in/olivere/elastic.v5/search_queries_bool.go b/vendor/gopkg.in/olivere/elastic.v5/search_queries_bool.go index a1ff17596..8ae223834 100644 --- a/vendor/gopkg.in/olivere/elastic.v5/search_queries_bool.go +++ b/vendor/gopkg.in/olivere/elastic.v5/search_queries_bool.go @@ -9,7 +9,7 @@ import "fmt" // A bool query matches documents matching boolean // combinations of other queries. // For more details, see: -// https://www.elastic.co/guide/en/elasticsearch/reference/6.0/query-dsl-bool-query.html +// https://www.elastic.co/guide/en/elasticsearch/reference/5.2/query-dsl-bool-query.html type BoolQuery struct { Query mustClauses []Query @@ -17,6 +17,7 @@ type BoolQuery struct { filterClauses []Query shouldClauses []Query boost *float64 + disableCoord *bool minimumShouldMatch string adjustPureNegative *bool queryName string @@ -57,6 +58,11 @@ func (q *BoolQuery) Boost(boost float64) *BoolQuery { return q } +func (q *BoolQuery) DisableCoord(disableCoord bool) *BoolQuery { + q.disableCoord = &disableCoord + return q +} + func (q *BoolQuery) MinimumShouldMatch(minimumShouldMatch string) *BoolQuery { q.minimumShouldMatch = minimumShouldMatch return q @@ -100,7 +106,7 @@ func (q *BoolQuery) Source() (interface{}, error) { // "term" : { "tag" : "elasticsearch" } // } // ], - // "minimum_should_match" : 1, + // "minimum_number_should_match" : 1, // "boost" : 1.0 // } // } @@ -189,6 +195,9 @@ func (q *BoolQuery) Source() (interface{}, error) { if q.boost != nil { boolClause["boost"] = *q.boost } + if q.disableCoord != nil { + boolClause["disable_coord"] = *q.disableCoord + } if q.minimumShouldMatch != "" { boolClause["minimum_should_match"] = q.minimumShouldMatch } |