fts

package
v0.8.0-beta.3 Latest Latest
Warning

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

Go to latest
Published: Apr 21, 2024 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AppQueryToTsquery

func AppQueryToTsquery(str string) string

func Tokenize

func Tokenize(str string) [][]string

func TokenizeFlat

func TokenizeFlat(str string) []string

Types

type Operator

type Operator string
const (
	OperatorAnd        Operator = "+"
	OperatorOr         Operator = "|"
	OperatorFollowedBy Operator = "."
)

type Token

type Token string
const (
	TokenQuoted      Token = "QUOTED"
	TokenOpenParens  Token = "OPEN_PARENS"
	TokenCloseParens Token = "CLOSE_PARENS"
	TokenOperator    Token = "OPERATOR"
	TokenNegation    Token = "NEGATION"
	TokenPhrase      Token = "PHRASE"
	TokenWildcard    Token = "WILDCARD"
)

type TokenValue

type TokenValue struct {
	StartPos int
	Length   int
	Token    Token
	Value    string
}

type Tsvector

type Tsvector map[string]map[int]TsvectorWeight

func ParseTsvector

func ParseTsvector(str string) (Tsvector, error)

func (Tsvector) AddText

func (v Tsvector) AddText(text string, weight TsvectorWeight)

func (Tsvector) Copy

func (v Tsvector) Copy() Tsvector

func (Tsvector) GormDataType

func (Tsvector) GormDataType() string

func (Tsvector) GormValue

func (v Tsvector) GormValue(context.Context, *gorm.DB) clause.Expr

func (*Tsvector) Scan

func (v *Tsvector) Scan(val interface{}) error

func (Tsvector) String

func (v Tsvector) String() string

func (Tsvector) Value

func (Tsvector) Value() (driver.Value, error)

type TsvectorLabel

type TsvectorLabel struct {
	Position int
	Weight   TsvectorWeight
}

type TsvectorWeight

type TsvectorWeight rune
const (
	TsvectorWeightA TsvectorWeight = 'A'
	TsvectorWeightB TsvectorWeight = 'B'
	TsvectorWeightC TsvectorWeight = 'C'
	TsvectorWeightD TsvectorWeight = 'D'
)

Jump to

Keyboard shortcuts

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