parseDocCount parses document count string, returning 0 for empty values (e.g., closed indices).
(s string)
| 338 | |
| 339 | // parseDocCount parses document count string, returning 0 for empty values (e.g., closed indices). |
| 340 | func parseDocCount(s string) (int64, error) { |
| 341 | if s == "" { |
| 342 | return 0, nil |
| 343 | } |
| 344 | count, err := strconv.Atoi(s) |
| 345 | return int64(count), err |
| 346 | } |
| 347 | |
| 348 | func unitConversion(sizeWithUnit string) (int64, error) { |
| 349 | // Empty size is expected for closed indices (ES returns null → unmarshals to "") |