We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 6681d0d commit 233b883Copy full SHA for 233b883
search.go
@@ -669,7 +669,7 @@ type SearchResultCluster struct {
669
// a search result. The return value might not be accurate, unless
670
// track_total_hits parameter has set to true.
671
func (r *SearchResult) TotalHits() int64 {
672
- if r.Hits != nil && r.Hits.TotalHits != nil {
+ if r != nil && r.Hits != nil && r.Hits.TotalHits != nil {
673
return r.Hits.TotalHits.Value
674
}
675
return 0
0 commit comments