ftsearch

package
v0.0.5 Latest Latest
Warning

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

Go to latest
Published: Apr 19, 2022 License: BSD-3-Clause Imports: 5 Imported by: 0

Documentation

Overview

create provides an interface to RedisSearch's create index functionality.

create provides an interface to RedisSearch's create index functionality.

query provides an interface to RedisSearch's query functionality.

ftsearch main module - defines the client class

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DefaultQueryLimit

func DefaultQueryLimit() *queryLimit

DefaultQueryLimit returns an initialzied QueryLimit struct with the default limit range

func DefaultQuerySummarize

func DefaultQuerySummarize() *querySummarize

func FilterValue

func FilterValue(val float64, exclusive bool) interface{}

FilterValue formats a value for use in a filter and returns it

func NewCreate added in v0.0.4

func NewCreate() *create

FT.CREATE echoTokenStoreIdx ON JSON SCHEMA $.metadata.type AS type TEXT $.metadata.client_id AS client_id TEXT $.metadata.subject AS subject TEXT

NewCreate creates a new create with defaults set https://redis.io/commands/ft.create/

func NewDropIndex added in v0.0.4

func NewDropIndex() *dropindex

FT.DROPINDEX echoTokenStoreIdx

NewDropIndex creates a new dropindex with defaults set https://redis.io/commands/ft.dropindex/

func NewQuery

func NewQuery() *query

NewQuery creates a new query with defaults set

func NewQueryFilter

func NewQueryFilter(attribute string) *queryFilter

func NewQueryHighlight

func NewQueryHighlight() *queryHighlight

func NewQueryLimit

func NewQueryLimit(first int64, num int64) *queryLimit

NewQueryLimit returns an initialized QueryLimit struct

func NewQuerySummarize

func NewQuerySummarize() *querySummarize

func NewSchema added in v0.0.4

func NewSchema() *schema

NewSchema creates a new schema with defaults set

Types

type Client

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

func NewClient

func NewClient(c *redis.Client) *Client

NewClient returns a new search client

func (*Client) CreateIndex added in v0.0.4

func (c *Client) CreateIndex(ctx context.Context, qry *create) (*CreateIndexResults, error)

func (*Client) DropIndex added in v0.0.4

func (c *Client) DropIndex(ctx context.Context, qry *dropindex) (*DropIndexResults, error)

func (*Client) ReIndex added in v0.0.4

func (c *Client) ReIndex(ctx context.Context, index string, qry *create) (*CreateIndexResults, error)

func (*Client) Search

func (c *Client) Search(ctx context.Context, qry *query) (*QueryResults, error)

type CreateIndexResults added in v0.0.4

type CreateIndexResults struct {
	RawResults interface{}
}

type DropIndexResults added in v0.0.4

type DropIndexResults struct {
	RawResults interface{}
}

type QueryResult

type QueryResult struct {
	Score       float64
	Value       map[string]string
	Explanation []interface{}
}

type QueryResults

type QueryResults struct {
	Count int64
	Data  map[string]QueryResult
}

Jump to

Keyboard shortcuts

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