Browse Source

filer: fix elastic search pagination

possible fix for https://github.com/chrislusf/seaweedfs/issues/1774
pull/1778/head
Chris Lu 4 years ago
parent
commit
2396ac234c
  1. 4
      weed/filer/elastic/v7/elastic_store.go

4
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, if entry, err := store.FindEntry(ctx,
weed_util.FullPath("/"+strings.Replace(index.Index, indexPrefix, "", 1))); err == nil { weed_util.FullPath("/"+strings.Replace(index.Index, indexPrefix, "", 1))); err == nil {
fileName := getFileName(entry.FullPath) fileName := getFileName(entry.FullPath)
lastFileName = fileName
if fileName == startFileName && !inclusive { if fileName == startFileName && !inclusive {
continue continue
} }
@ -229,6 +228,7 @@ func (store *ElasticStore) listRootDirectoryEntries(ctx context.Context, startFi
if !eachEntryFunc(entry) { if !eachEntryFunc(entry) {
break break
} }
lastFileName = fileName
} }
} }
} }
@ -278,13 +278,13 @@ func (store *ElasticStore) listDirectoryEntries(
} }
nextStart = string(esEntry.Entry.FullPath) nextStart = string(esEntry.Entry.FullPath)
fileName := getFileName(esEntry.Entry.FullPath) fileName := getFileName(esEntry.Entry.FullPath)
lastFileName = fileName
if fileName == startFileName && !inclusive { if fileName == startFileName && !inclusive {
continue continue
} }
if !eachEntryFunc(esEntry.Entry) { if !eachEntryFunc(esEntry.Entry) {
break break
} }
lastFileName = fileName
} }
} }
} }

Loading…
Cancel
Save