index

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Sep 10, 2026 License: BSD-2-Clause Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultSearchLimit = 10000

Variables

This section is empty.

Functions

func And

func And(queries ...blevequery.Query) blevequery.Query

func BuildIndexPath

func BuildIndexPath(indexPath string) string

func NewKeyworldFieldMapping

func NewKeyworldFieldMapping() *mapping.FieldMapping

func NewMatchAny

func NewMatchAny(field string, values []string) blevequery.Query

func NewReindexer

func NewReindexer[T any](
	reindexBatchIndexProvider ReindexBatchIndexProviderTx[T],
	streamer ReindexStreamerTx[T],
	bleveIndex bleve.Index,
	batchSize uint64,
) libkv.RunnableTx

NewReindexer creates a Tx-based reindexer that operates within a transaction. The caller is responsible for wrapping this in db.View() to provide the transaction.

func NewResetIndexHandler

func NewResetIndexHandler(index bleve.Index, cancel context.CancelFunc) http.Handler

func OpenDir

func OpenDir(
	ctx context.Context,
	indexMapping mapping.IndexMapping,
	indexPath string,
) (bleve.Index, error)

func OpenPath

func OpenPath(
	ctx context.Context,
	indexMapping mapping.IndexMapping,
	indexPath string,
) (bleve.Index, error)

func OpenTemp

func OpenTemp(ctx context.Context, indexMapping mapping.IndexMapping) (bleve.Index, error)

func Or

func Or(queries ...blevequery.Query) blevequery.Query

func RemoveIndex

func RemoveIndex(ctx context.Context, indexPath string) error

Types

type Index

type Index interface {
	Index(id string, data interface{}) error
	Delete(id string) error
}

func NewBatchIndex

func NewBatchIndex(batch *bleve.Batch) Index

func NewIndex

func NewIndex(bleveIndex bleve.Index) Index

type IndexerTx

type IndexerTx[T any] interface {
	Add(ctx context.Context, tx libkv.Tx, object T) error
}

type ReindexBatchIndexProviderFuncTx

type ReindexBatchIndexProviderFuncTx[T any] func(batch *bleve.Batch) IndexerTx[T]

func (ReindexBatchIndexProviderFuncTx[T]) CreateIndexer

func (r ReindexBatchIndexProviderFuncTx[T]) CreateIndexer(batch *bleve.Batch) IndexerTx[T]

type ReindexBatchIndexProviderTx

type ReindexBatchIndexProviderTx[T any] interface {
	CreateIndexer(batch *bleve.Batch) IndexerTx[T]
}

type ReindexStreamerTx

type ReindexStreamerTx[T any] interface {
	Stream(ctx context.Context, tx libkv.Tx, ch chan<- T) error
}

Jump to

Keyboard shortcuts

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