Skip to content

Commit

Permalink
feat(location): add bleve test
Browse files Browse the repository at this point in the history
  • Loading branch information
dschmidt committed Dec 6, 2023
1 parent 7e1db1d commit 1aec1c6
Showing 1 changed file with 33 additions and 0 deletions.
33 changes: 33 additions & 0 deletions services/search/pkg/engine/bleve_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -548,5 +548,38 @@ var _ = Describe("Bleve", func() {
})
})

Context("with location metadata", func() {
BeforeEach(func() {
resource := engine.Resource{
ID: "1$2!7",
ParentID: rootResource.ID,
RootID: rootResource.ID,
Path: "./team.jpg",
Type: uint64(sprovider.ResourceType_RESOURCE_TYPE_FILE),
Document: content.Document{
Name: "team.jpg",
MimeType: "image/jpeg",
Location: &libregraph.GeoCoordinates{
Altitude: libregraph.PtrFloat64(991),
Latitude: libregraph.PtrFloat64(49.48675890884328),
Longitude: libregraph.PtrFloat64(11.103870357204285),
},
},
}
err := eng.Upsert(resource.ID, resource)
Expect(err).ToNot(HaveOccurred())
})

It("returns audio metadata for search", func() {
matches := assertDocCount(rootResource.ID, `*team*`, 1)
location := matches[0].Entity.Location

Expect(location).ToNot(BeNil())

Expect(location.Altitude).To(Equal(libregraph.PtrFloat64(1047.7)))
Expect(location.Latitude).To(Equal(libregraph.PtrFloat64(49.48675890884328)))
Expect(location.Longitude).To(Equal(libregraph.PtrFloat64(11.103870357204285)))
})
})
})
})

0 comments on commit 1aec1c6

Please sign in to comment.