indexo

package
v0.0.2-rc-ci Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 15, 2024 License: AGPL-3.0 Imports: 7 Imported by: 0

Documentation

Overview

Package indexo provides an operator with an index and a delete operation, that operates on a search index

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type GroupDocument

type GroupDocument struct {
	ID          string `json:"id"`
	Published   bool   `json:"published"`
	Name        string `json:"name"`
	Link        string `json:"link"`
	Email       string `json:"email"`
	Image       string `json:"image"`
	Description string `json:"description"`
	Listed      bool   `json:"listed"`
}

func (*GroupDocument) Identifier

func (g *GroupDocument) Identifier() string

Identifier returns an id which should uniquely identify the object for its type.

func (*GroupDocument) QueryText

func (g *GroupDocument) QueryText() string

QueryText returns the string to index for a text search.

func (*GroupDocument) SearchFields

func (g *GroupDocument) SearchFields() map[string]interface{}

SearchFields returns a map of fields to be index for searching.

func (*GroupDocument) Type

func (g *GroupDocument) Type() string

Type returns the type of the object.

type PlaceDocument

type PlaceDocument struct {
	ID          string   `json:"id"`
	Published   bool     `json:"published"`
	Name        string   `json:"name"`
	Address     string   `json:"address"`
	Lat         float64  `json:"lat"`
	Lng         float64  `json:"lng"`
	Link        string   `json:"link"`
	Email       string   `json:"email"`
	Description string   `json:"description"`
	Image       string   `json:"image"`
	OwnedBy     []string `json:"ownedBy"`
	Listed      bool     `json:"listed"`
}

func (*PlaceDocument) Identifier

func (p *PlaceDocument) Identifier() string

Identifier returns an id which should uniquely identify the object for its type.

func (*PlaceDocument) QueryText

func (p *PlaceDocument) QueryText() string

QueryText returns the string to index for a text search.

func (*PlaceDocument) SearchFields

func (p *PlaceDocument) SearchFields() map[string]interface{}

SearchFields returns a map of fields to be index for searching.

func (*PlaceDocument) Type

func (p *PlaceDocument) Type() string

Type returns the type of the object.

type Service

type Service interface {
	// Reindex takes all models, that are searchable and indexes them into the
	// search index.
	Reindex(ctx context.Context) error
}

Service defines an operation indexer service.

func NewService

func NewService(
	queue oqueue.Service,
	searchService search.Service,
	eventService event.Storer,
	groupService group.Service,
	placeService place.Service,
) Service

NewService returns a new index operator service.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL