diff options
author | Christopher Speller <crspeller@gmail.com> | 2018-07-22 20:14:05 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-07-22 20:14:05 -0700 |
commit | bac3376278bfd8125879ca86e8eb26df85858d4c (patch) | |
tree | 8dec71c9deadf8c2138998a3cb6e93b3fec1c380 /vendor/gopkg.in/olivere/elastic.v5/search_queries_has_parent.go | |
parent | 3539a9a60b24bd9c0c1360b17c8fe3e6ebf8cf3c (diff) | |
download | chat-bac3376278bfd8125879ca86e8eb26df85858d4c.tar.gz chat-bac3376278bfd8125879ca86e8eb26df85858d4c.tar.bz2 chat-bac3376278bfd8125879ca86e8eb26df85858d4c.zip |
Updating dependencies (#9139)
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.go | 11 |
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 } |