textsearch

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Apr 12, 2026 License: AGPL-3.0 Imports: 1 Imported by: 0

Documentation

Overview

Package search defines an interface for a search index management structure

Index

Constants

View Source
const (
	// QueryKeySearch is the query param key to find search queries in requests.
	QueryKeySearch = "q"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Index

type Index[T any] interface {
	IndexSearcher[T]
	IndexManager
}

Index is our wrapper interface for a text search index.

type IndexManager

type IndexManager interface {
	Index(ctx context.Context, id string, value any) error
	Delete(ctx context.Context, id string) (err error)
	Wipe(ctx context.Context) error
}

IndexManager is our wrapper interface for a text search index.

type IndexRequest

type IndexRequest struct {
	RequestID string `json:"id"`
	RowID     string `json:"rowID"`
	IndexType string `json:"type"`
	TestID    string `json:"testID,omitempty"`
	Delete    bool   `json:"delete"`
}

type IndexSearcher

type IndexSearcher[T any] interface {
	Search(ctx context.Context, query string) (ids []*T, err error)
}

Directories

Path Synopsis
Package algolia provides an interface-compatible wrapper around the algolia indexer
Package algolia provides an interface-compatible wrapper around the algolia indexer
Package elasticsearch provides an interface-compatible wrapper around the elasticsearch indexer
Package elasticsearch provides an interface-compatible wrapper around the elasticsearch indexer
Package mocksearch provides moq-generated mocks for the search/text package.
Package mocksearch provides moq-generated mocks for the search/text package.

Jump to

Keyboard shortcuts

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