make DocCount() on IndexAlias consistent with partial results
it will now return the partial count of nodes that did respond without error
This commit is contained in:
parent
5408083ab5
commit
55c43ae6c2
|
@ -122,10 +122,10 @@ func (i *indexAliasImpl) DocCount() (uint64, error) {
|
|||
|
||||
for _, index := range i.indexes {
|
||||
otherCount, err := index.DocCount()
|
||||
if err != nil {
|
||||
return 0, err
|
||||
if err == nil {
|
||||
rv += otherCount
|
||||
}
|
||||
rv += otherCount
|
||||
// tolerate errors to produce partial counts
|
||||
}
|
||||
|
||||
return rv, nil
|
||||
|
|
Loading…
Reference in New Issue