summaryrefslogtreecommitdiffstats
path: root/vendor/gopkg.in/olivere/elastic.v5/search_queries_range.go
diff options
context:
space:
mode:
authorChristopher Speller <crspeller@gmail.com>2018-04-16 05:37:14 -0700
committerJoram Wilander <jwawilander@gmail.com>2018-04-16 08:37:14 -0400
commit6e2cb00008cbf09e556b00f87603797fcaa47e09 (patch)
tree3c0eb55ff4226a3f024aad373140d1fb860a6404 /vendor/gopkg.in/olivere/elastic.v5/search_queries_range.go
parentbf24f51c4e1cc6286885460672f7f449e8c6f5ef (diff)
downloadchat-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_range.go')
-rw-r--r--vendor/gopkg.in/olivere/elastic.v5/search_queries_range.go13
1 files changed, 12 insertions, 1 deletions
diff --git a/vendor/gopkg.in/olivere/elastic.v5/search_queries_range.go b/vendor/gopkg.in/olivere/elastic.v5/search_queries_range.go
index 1b92dee23..da7b5f965 100644
--- a/vendor/gopkg.in/olivere/elastic.v5/search_queries_range.go
+++ b/vendor/gopkg.in/olivere/elastic.v5/search_queries_range.go
@@ -7,7 +7,7 @@ package elastic
// RangeQuery matches documents with fields that have terms within a certain range.
//
// For details, see
-// https://www.elastic.co/guide/en/elasticsearch/reference/6.0/query-dsl-range-query.html
+// https://www.elastic.co/guide/en/elasticsearch/reference/5.2/query-dsl-range-query.html
type RangeQuery struct {
name string
from interface{}
@@ -18,6 +18,7 @@ type RangeQuery struct {
boost *float64
queryName string
format string
+ relation string
}
// NewRangeQuery creates and initializes a new RangeQuery.
@@ -112,6 +113,13 @@ func (q *RangeQuery) Format(format string) *RangeQuery {
return q
}
+// Relation is used for range fields. which can be one of
+// "within", "contains", "intersects" (default) and "disjoint".
+func (q *RangeQuery) Relation(relation string) *RangeQuery {
+ q.relation = relation
+ return q
+}
+
// Source returns JSON for the query.
func (q *RangeQuery) Source() (interface{}, error) {
source := make(map[string]interface{})
@@ -130,6 +138,9 @@ func (q *RangeQuery) Source() (interface{}, error) {
if q.format != "" {
params["format"] = q.format
}
+ if q.relation != "" {
+ params["relation"] = q.relation
+ }
if q.boost != nil {
params["boost"] = *q.boost
}