Skip to content

Commit

Permalink
Make sure to catch all children when doing recursive updates
Browse files Browse the repository at this point in the history
  • Loading branch information
aduffeck committed May 19, 2022
1 parent 2224855 commit dc47c5b
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions extensions/search/pkg/search/index/index.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ package index
import (
"context"
"errors"
"math"
"path"
"strings"
"time"
Expand Down Expand Up @@ -113,6 +114,7 @@ func (i *Index) markAsDeleted(id string, deleted bool) error {
bleve.NewQueryStringQuery("Path:"+doc.Path+"/*"),
)
bleveReq := bleve.NewSearchRequest(query)
bleveReq.Size = math.MaxInt
bleveReq.Fields = []string{"*"}
res, err := i.bleveIndex.Search(bleveReq)
if err != nil {
Expand Down Expand Up @@ -188,6 +190,7 @@ func (i *Index) Move(id *sprovider.ResourceId, fullPath string) error {
bleve.NewQueryStringQuery("Path:"+oldName+"/*"),
)
bleveReq := bleve.NewSearchRequest(query)
bleveReq.Size = math.MaxInt
bleveReq.Fields = []string{"*"}
res, err := i.bleveIndex.Search(bleveReq)
if err != nil {
Expand Down Expand Up @@ -294,6 +297,7 @@ func fieldsToEntity(fields map[string]interface{}) *indexDocument {
Mtime: fields["Mtime"].(string),
MimeType: fields["MimeType"].(string),
Type: uint64(fields["Type"].(float64)),
Deleted: fields["Deleted"].(bool),
}
return doc
}
Expand Down

0 comments on commit dc47c5b

Please sign in to comment.