summaryrefslogtreecommitdiffstats
path: root/vendor/gopkg.in/olivere/elastic.v5/search_queries_bool.go
diff options
context:
space:
mode:
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.go13
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
}