Merge pull request #4826 from kobergj/FixSpaceIndexing

[skip ci] FixSpaceIndexing
This commit is contained in:
Michael Barz authored and GitHub committed 2022-10-14 15:57:37 +02:00
commit f5689a6c26
2 files changed
+12 -7

No files matched your search

+1 -5
View File
@@ -167,11 +167,7 @@ func (b *Bleve) Search(_ context.Context, sir *searchService.SearchIndexRequest)
return nil, err
}
pID, err := storagespace.ParseID(getValue[string](hit.Fields, "ParentID"))
if err != nil {
return nil, err
}
pID, _ := storagespace.ParseID(getValue[string](hit.Fields, "ParentID"))
match := &searchMessage.Match{
Score: float32(hit.Score),
Entity: &searchMessage.Entity{
+11 -2
View File
@@ -265,9 +265,18 @@ func (p *Provider) IndexSpace(ctx context.Context, req *searchsvc.IndexSpaceRequ
p.logger.Error().Err(err).Msg("error extracting content")
}
var pid string
if info.ParentId != nil {
pid = storagespace.FormatResourceID(*info.ParentId)
}
r := engine.Resource{
ID: storagespace.FormatResourceID(*info.Id),
RootID: storagespace.FormatResourceID(*ref.ResourceId),
ID: storagespace.FormatResourceID(*info.Id),
RootID: storagespace.FormatResourceID(provider.ResourceId{
StorageId: info.Id.StorageId,
OpaqueId: info.Id.SpaceId,
SpaceId: info.Id.SpaceId,
}),
ParentID: pid,
Path: ref.Path,
Type: uint64(info.Type),
Document: doc,