summaryrefslogtreecommitdiffstats
path: root/vendor/gopkg.in/olivere/elastic.v5/search_queries_has_parent.go
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/gopkg.in/olivere/elastic.v5/search_queries_has_parent.go')
-rw-r--r--vendor/gopkg.in/olivere/elastic.v5/search_queries_has_parent.go11
1 files changed, 11 insertions, 0 deletions
diff --git a/vendor/gopkg.in/olivere/elastic.v5/search_queries_has_parent.go b/vendor/gopkg.in/olivere/elastic.v5/search_queries_has_parent.go
index 7df110cd2..aa46b34c9 100644
--- a/vendor/gopkg.in/olivere/elastic.v5/search_queries_has_parent.go
+++ b/vendor/gopkg.in/olivere/elastic.v5/search_queries_has_parent.go
@@ -19,6 +19,7 @@ type HasParentQuery struct {
score *bool
queryName string
innerHit *InnerHit
+ ignoreUnmapped *bool
}
// NewHasParentQuery creates and initializes a new has_parent query.
@@ -55,6 +56,13 @@ func (q *HasParentQuery) InnerHit(innerHit *InnerHit) *HasParentQuery {
return q
}
+// IgnoreUnmapped specifies whether unmapped types should be ignored.
+// If set to false, the query failes when an unmapped type is found.
+func (q *HasParentQuery) IgnoreUnmapped(ignore bool) *HasParentQuery {
+ q.ignoreUnmapped = &ignore
+ return q
+}
+
// Source returns JSON for the function score query.
func (q *HasParentQuery) Source() (interface{}, error) {
// {
@@ -93,5 +101,8 @@ func (q *HasParentQuery) Source() (interface{}, error) {
}
query["inner_hits"] = src
}
+ if q.ignoreUnmapped != nil {
+ query["ignore_unmapped"] = *q.ignoreUnmapped
+ }
return source, nil
}