trgm

package
v0.0.0-...-bbd1545 Latest Latest
Warning

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

Go to latest
Published: Dec 23, 2022 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Stemmed

func Stemmed(str string) []string

Types

type DIYTrigrams

type DIYTrigrams struct {
	Conn *pgx.Conn
}

func (*DIYTrigrams) Description

func (s *DIYTrigrams) Description() string

func (*DIYTrigrams) Query

func (s *DIYTrigrams) Query(ctx context.Context, query string) ([]string, error)

type Food

type Food struct {
	FDCID int64  `json:"fdcId"`
	Name  string `json:"description"`
	Brand string `json:"brandName"`
	Type  string `json:"dataType"`
	// contains filtered or unexported fields
}

func (*Food) AnalyzedFullName

func (f *Food) AnalyzedFullName() string

func (*Food) FullName

func (f *Food) FullName() string

func (*Food) ID

func (f *Food) ID() uuid.UUID

func (*Food) StemmedFullName

func (f *Food) StemmedFullName() []string

func (*Food) Weight

func (f *Food) Weight() float64

type ILike

type ILike struct {
	Conn *pgx.Conn
}

func (*ILike) Description

func (s *ILike) Description() string

func (*ILike) Query

func (s *ILike) Query(ctx context.Context, query string) ([]string, error)

type Indexer

type Indexer struct {
	Conn *pgx.Conn
	// contains filtered or unexported fields
}

func (*Indexer) LoadChunk

func (i *Indexer) LoadChunk(ctx context.Context, chunk []*Food) error

func (*Indexer) PostLoad

func (i *Indexer) PostLoad(ctx context.Context) error

func (*Indexer) Search

func (i *Indexer) Search(ctx context.Context, query string) ([]string, error)

func (*Indexer) Setup

func (i *Indexer) Setup(ctx context.Context) error

type Naive

type Naive struct {
	Conn                    *pgx.Conn
	ForceIndex              bool
	AnalyzedField           bool
	AnalyzedQuery           bool
	TuneSimilarityThreshold bool
}

func (*Naive) Description

func (s *Naive) Description() string

func (*Naive) Query

func (s *Naive) Query(ctx context.Context, query string) ([]string, error)

type Querier

type Querier interface {
	Description() string
	Query(context.Context, string) ([]string, error)
}

type Tokenized

type Tokenized struct {
	Conn *pgx.Conn
}

func (*Tokenized) Description

func (s *Tokenized) Description() string

func (*Tokenized) Query

func (s *Tokenized) Query(ctx context.Context, query string) ([]string, error)

Jump to

Keyboard shortcuts

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