Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct { ID string CoordinatesForID CoordinatesForID DisablePersistence bool RootPath string Logger logrus.FieldLogger }
Config is passed to the GeoIndex when its created
type CoordinatesForID ¶
CoordinatesForID must provide the geo coordinates for the specified index id
func (CoordinatesForID) VectorForID ¶
VectorForID transforms the geo coordinates into a "vector" of fixed length two, where element 0 represents the latitude and element 1 represents the longitude. This way it is usable by a generic vector index such as HNSW
type Index ¶
type Index struct {
// contains filtered or unexported fields
}
Index wraps another index to provide geo searches. This allows us to reuse the hnsw vector index, without making geo searches dependent on hnsw-specific features.
In the future we could use this level of abstraction to provide a better suited geo-index if we deem it necessary
func (*Index) Add ¶
func (i *Index) Add(id uint64, coordinates *models.GeoCoordinates) error
Add extends the index with the specified GeoCoordinates. It is thread-safe and can be called concurrently.
func (*Index) PostStartup ¶
func (i *Index) PostStartup()