couch

package module
v0.0.0-...-4715832 Latest Latest
Warning

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

Go to latest
Published: Oct 10, 2023 License: MIT Imports: 4 Imported by: 0

README

couch - Go Reference

Simple full text search engine.

Usage

go get github.com/anoriqq/couch

example project is here. (WIP)

Development

# install dependencies
go install github.com/tenntenn/testtime@latest
go mod tidy

# run all test
go test -race -overlay=$(testtime) -shuffle on -count 1 ./...

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func WithAnalyzerExpirationAtSearch

func WithAnalyzerExpirationAtSearch(e time.Duration) withAnalyzerExpirationAtSearch

Types

type Analyzer

type Analyzer interface {
	Analyze(context.Context, string) ([]string, error)
}

type CouchSearch

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

func New

func New(a Analyzer, s Storage, opts ...option) (*CouchSearch, error)

func (*CouchSearch) Search

func (c *CouchSearch) Search(ctx context.Context, q string) ([]DocID, error)

func (*CouchSearch) UpdateIndex

func (c *CouchSearch) UpdateIndex(ctx context.Context, id DocID, doc string) error

type DocID

type DocID = string

type Storage

type Storage interface {
	Store(context.Context, DocID, []string) error
	SelectAtOR(context.Context, []string) ([]DocID, error)
}

Directories

Path Synopsis
internal

Jump to

Keyboard shortcuts

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