Skip to content

SeaweedFS is a distributed storage system for object storage (S3), file systems, Iceberg table buckets, and Lance vector buckets, designed to handle billions of files with O(1) disk access and effortless horizontal scaling.

filer: fix elastic search pagination

Chris Lu2396ac234c06
diff --git a/weed/filer/elastic/v7/elastic_store.go b/weed/filer/elastic/v7/elastic_store.go
index 1e7f55599c..14719e6eda 100644
--- a/weed/filer/elastic/v7/elastic_store.go
+++ b/weed/filer/elastic/v7/elastic_store.go
@@ -218,7 +218,6 @@ func (store *ElasticStore) listRootDirectoryEntries(ctx context.Context, startFi
if entry, err := store.FindEntry(ctx,
weed_util.FullPath("/"+strings.Replace(index.Index, indexPrefix, "", 1))); err == nil {
fileName := getFileName(entry.FullPath)
- lastFileName = fileName
if fileName == startFileName && !inclusive {
continue
}
@@ -229,6 +228,7 @@ func (store *ElasticStore) listRootDirectoryEntries(ctx context.Context, startFi
if !eachEntryFunc(entry) {
break
}
+ lastFileName = fileName
}
}
}
@@ -278,13 +278,13 @@ func (store *ElasticStore) listDirectoryEntries(
}
nextStart = string(esEntry.Entry.FullPath)
fileName := getFileName(esEntry.Entry.FullPath)
- lastFileName = fileName
if fileName == startFileName && !inclusive {
continue
}
if !eachEntryFunc(esEntry.Entry) {
break
}
+ lastFileName = fileName
}
}
}