Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

make the shard information returned by searches available #373

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions search.go
Original file line number Diff line number Diff line change
Expand Up @@ -360,6 +360,14 @@ type SearchResult struct {
Aggregations Aggregations `json:"aggregations"` // results from aggregations
TimedOut bool `json:"timed_out"` // true if the search timed out
Error string `json:"error,omitempty"` // used in MultiSearch only
Shards *ShardDetails `json:"_shards"` // details of shards used by the query
}

// ShardDetails holds counts of shards used by a query
type ShardDetails struct {
Total int64 `json:"total"`
Successful int64 `json:"successful"`
Failed int64 `json:"failed"`
}

// TotalHits is a convenience function to return the number of hits for
Expand Down