commons

package
v5.0.0-...-3817779 Latest Latest
Warning

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

Go to latest
Published: Mar 7, 2025 License: AGPL-3.0 Imports: 25 Imported by: 0

Documentation

Overview

Package commons implements the search engine

Index

Constants

This section is empty.

Variables

View Source
var (
	BatchPoolInit sync.Once
)
View Source
var (
	BatchSize = 2000
)

Functions

func NewBatch

func NewBatch(ctx context.Context, nsProvider *meta.NsProvider, options BatchOptions, inputOpts ...indexer.BatchOption) indexer.Batch

Types

type BatchOptions

type BatchOptions struct {
	// contains filtered or unexported fields
}

type LocalBatch

type LocalBatch struct {
	sync.Mutex
	// contains filtered or unexported fields
}

LocalBatch avoids overflowing bleve index by batching indexation events (index/delete)

func (*LocalBatch) Flush

func (b *LocalBatch) Flush(ctx context.Context, batchOpts ...indexer.BatchOption) error

func (*LocalBatch) LoadIndexableNode

func (b *LocalBatch) LoadIndexableNode(indexNode *tree.IndexableNode, excludes map[string]struct{}) error

type QueryCodecProvider

type QueryCodecProvider func(values configx.Values, metaProvider *meta.NsProvider) indexer.IndexCodex

type Server

type Server struct {
	indexer.Indexer
	// contains filtered or unexported fields
}

func NewServer

func NewServer(ctx context.Context, idx indexer.Indexer, provider QueryCodecProvider, batchOptions ...indexer.BatchOption) *Server

func (*Server) ClearIndex

func (s *Server) ClearIndex(ctx context.Context) error

func (*Server) Close

func (s *Server) Close(ctx context.Context) error

func (*Server) DeleteNode

func (s *Server) DeleteNode(c context.Context, n *tree.Node) error

func (*Server) Flush

func (s *Server) Flush(ctx context.Context) error

func (*Server) IndexNode

func (s *Server) IndexNode(c context.Context, n *tree.Node, reloadCore bool) error

func (*Server) SearchNodes

func (s *Server) SearchNodes(ctx context.Context, queryObject *tree.Query, from int32, size int32, sortField string, sortDesc bool, resultChan chan *tree.Node, facets chan *tree.SearchFacet, doneChan chan bool) error

Jump to

Keyboard shortcuts

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