Skip to content

Commit

Permalink
Merge branch 'release-branch.v7' of github.com:olivere/elastic into r…
Browse files Browse the repository at this point in the history
…elease-branch.v7
  • Loading branch information
olivere committed Jun 16, 2021
2 parents 3747bd1 + 770e93c commit 9150da1
Showing 1 changed file with 35 additions and 3 deletions.
38 changes: 35 additions & 3 deletions indices_delete.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,12 @@ type IndicesDeleteService struct {
filterPath []string // list of filters used to reduce the response
headers http.Header // custom request-level HTTP headers

index []string
timeout string
masterTimeout string
index []string
timeout string
masterTimeout string
ignoreUnavailable *bool
allowNoIndices *bool
expandWildcards string
}

// NewIndicesDeleteService creates and initializes a new IndicesDeleteService.
Expand Down Expand Up @@ -99,6 +102,26 @@ func (s *IndicesDeleteService) MasterTimeout(masterTimeout string) *IndicesDelet
return s
}

// IgnoreUnavailable indicates whether to ignore unavailable indexes (default: false).
func (s *IndicesDeleteService) IgnoreUnavailable(ignoreUnavailable bool) *IndicesDeleteService {
s.ignoreUnavailable = &ignoreUnavailable
return s
}

// AllowNoIndices indicates whether to ignore if a wildcard expression
// resolves to no concrete indices (default: false).
func (s *IndicesDeleteService) AllowNoIndices(allowNoIndices bool) *IndicesDeleteService {
s.allowNoIndices = &allowNoIndices
return s
}

// ExpandWildcards indicates whether wildcard expressions should get
// expanded to open or closed indices (default: open).
func (s *IndicesDeleteService) ExpandWildcards(expandWildcards string) *IndicesDeleteService {
s.expandWildcards = expandWildcards
return s
}

// buildURL builds the URL for the operation.
func (s *IndicesDeleteService) buildURL() (string, url.Values, error) {
// Build URL
Expand Down Expand Up @@ -129,6 +152,15 @@ func (s *IndicesDeleteService) buildURL() (string, url.Values, error) {
if s.masterTimeout != "" {
params.Set("master_timeout", s.masterTimeout)
}
if s.ignoreUnavailable != nil {
params.Set("ignore_unavailable", fmt.Sprintf("%v", *s.ignoreUnavailable))
}
if s.allowNoIndices != nil {
params.Set("allow_no_indices", fmt.Sprintf("%v", *s.allowNoIndices))
}
if s.expandWildcards != "" {
params.Set("expand_wildcards", s.expandWildcards)
}
return path, params, nil
}

Expand Down

0 comments on commit 9150da1

Please sign in to comment.