store

package
v0.0.0-...-56c857f Latest Latest
Warning

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

Go to latest
Published: Jun 18, 2023 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DocumentStore

type DocumentStore interface {
	Put(*model.Document) error
	Get(index int64) (*model.Document, error)
	GetAll(index []int64) ([]*model.Document, error)
	Count() (int64, error)
}

type IndexStore

type IndexStore interface {
	PutWord(index int64, word string, frequency float64) error
	PutAllWords(index int64, words map[string]float64) error
	// PutRank(index int64, rank int64) error
	Get(word string) ([]int64, []float64, error)
	Optimize() error
}

type SQLDocumentStore

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

func NewSQLDocumentStore

func NewSQLDocumentStore(db *sql.DB) (*SQLDocumentStore, error)

func (*SQLDocumentStore) Count

func (s *SQLDocumentStore) Count() (int64, error)

func (*SQLDocumentStore) Get

func (s *SQLDocumentStore) Get(index int64) (*model.Document, error)

func (*SQLDocumentStore) GetAll

func (s *SQLDocumentStore) GetAll(index []int64) ([]*model.Document, error)

func (*SQLDocumentStore) Put

func (s *SQLDocumentStore) Put(doc *model.Document) error

type SQLIndexStore

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

func NewSQLIndexStore

func NewSQLIndexStore(db *sql.DB) (*SQLIndexStore, error)

func (*SQLIndexStore) Get

func (s *SQLIndexStore) Get(word string) ([]int64, []float64, error)

func (*SQLIndexStore) Optimize

func (s *SQLIndexStore) Optimize() error

func (*SQLIndexStore) PutAllWords

func (s *SQLIndexStore) PutAllWords(index int64, words map[string]float64) error

func (*SQLIndexStore) PutWord

func (s *SQLIndexStore) PutWord(index int64, word string, frequency float64) error

Jump to

Keyboard shortcuts

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