Also store (and return) the Size in the index

This commit is contained in:
André Duffeck
2022-04-08 10:57:44 +02:00
parent 3099d4a821
commit 6cc04872ee
2 changed files with 3 additions and 0 deletions

View File

@@ -117,6 +117,7 @@ func fromFields(fields map[string]interface{}) (search.Match, error) {
OpaqueId: IDParts[1],
},
Path: fields["Name"].(string),
Size: uint64(fields["Size"].(float64)),
},
}, nil
}

View File

@@ -42,6 +42,7 @@ var _ = Describe("Index", func() {
OpaqueId: "opaqueid",
},
Path: "foo.pdf",
Size: 12345,
}
})
@@ -78,6 +79,7 @@ var _ = Describe("Index", func() {
Expect(res.Matches[0].Reference.ResourceId).To(Equal(ref.ResourceId))
Expect(res.Matches[0].Info.Id).To(Equal(ri.Id))
Expect(res.Matches[0].Info.Path).To(Equal(ri.Path))
Expect(res.Matches[0].Info.Size).To(Equal(ri.Size))
})
PIt("finds files living deeper in the tree by prefix")