storage

package
v0.0.0-...-5c72b2d Latest Latest
Warning

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

Go to latest
Published: Sep 8, 2021 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DocumentMatch

type DocumentMatch struct {
	Document interface{}         `json:"document"`
	Score    float64             `json:"score"`
	Expl     *search.Explanation `json:"explanation"`
	ID       string              `json:"id"`
}

type Index

type Index interface {
	Close() error
	Search(request *bluge.TopNSearch) (*SearchResponse, error)
	Update(documents []*bluge.Document) error
	Delete(id string) error
	BulkDelete(ids []string) error
	Snapshot(writer io.Writer, id string) error
	Restore(rc io.ReadCloser) error
}

func New

func New(directory string, logger logger.WriteLogger) (Index, error)

type MatchAllQuery

type MatchAllQuery struct {
	*bluge.MatchAllQuery
}

func NewAll

func NewAll() *MatchAllQuery

type MatchQuery

type MatchQuery struct {
	*bluge.MatchQuery
}

func NewMatchQuery

func NewMatchQuery(q string) *MatchQuery

func (*MatchQuery) Build

func (q *MatchQuery) Build() bluge.Query

func (*MatchQuery) SetAnalyzer

func (q *MatchQuery) SetAnalyzer(name string) *MatchQuery

type Metadata

type Metadata struct {
	NextPage     int     `json:"next_page,omitempty"`
	PreviousPage int     `json:"previous_page,omitempty"`
	TopScore     float64 `json:"top_score"`
	Total        uint64  `json:"total"`
}

func (*Metadata) CalcPage

func (m *Metadata) CalcPage(searchSize int, nowPage int)

type SearchResponse

type SearchResponse struct {
	Metadata  Metadata         `json:"metadata"`
	Documents []*DocumentMatch `json:"documents"`
}

type Term

type Term struct {
	*bluge.TermQuery
}

func NewTerm

func NewTerm(field, value string) *Term

type WildCard

type WildCard struct {
	*bluge.WildcardQuery
}

func NewWildCard

func NewWildCard(field, value string) *WildCard

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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