go4xs

package module
v0.0.0-...-8416b7a Latest Latest
Warning

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

Go to latest
Published: Aug 20, 2021 License: Apache-2.0 Imports: 9 Imported by: 0

README

go4xs

介绍
  1. GO SDK for xunsearch(http://www.xunsearch.com/)
  2. 实现基本的搜索与管理索引功能
  3. 增加连接池支持
  4. 样例参考test目录

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Indexer

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

func (*Indexer) Add

func (i *Indexer) Add(values ...map[string]string) error

func (*Indexer) AddSynonym

func (i *Indexer) AddSynonym(word string, synonym string) error

func (*Indexer) BeginRebuild

func (i *Indexer) BeginRebuild() error

func (*Indexer) Clean

func (i *Indexer) Clean() error

func (*Indexer) Close

func (i *Indexer) Close()

func (*Indexer) Connect

func (i *Indexer) Connect() error

func (*Indexer) DelSynonym

func (i *Indexer) DelSynonym(word string, synonym string) error

func (*Indexer) Delete

func (i *Indexer) Delete(ids ...string) error

func (*Indexer) EndRebuild

func (i *Indexer) EndRebuild() error

func (*Indexer) FlushIndex

func (i *Indexer) FlushIndex() error

func (*Indexer) FlushLogging

func (i *Indexer) FlushLogging() error

func (*Indexer) GetScwsMulti

func (i *Indexer) GetScwsMulti() (int, error)

func (*Indexer) LoadConf

func (i *Indexer) LoadConf(setting *xs.Setting)

func (*Indexer) SetScwsMulti

func (i *Indexer) SetScwsMulti(level uint8) error

func (*Indexer) StopRebuild

func (i *Indexer) StopRebuild() error

func (*Indexer) Update

func (i *Indexer) Update(value map[string]string) error

type Pool

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

func NewPool

func NewPool(addr string, fn func(addr string) (*xs.Connection, error), size uint) *Pool

func (*Pool) Acquire

func (p *Pool) Acquire() (*xs.Connection, error)

func (*Pool) Close

func (p *Pool) Close()

func (*Pool) Release

func (p *Pool) Release(r *xs.Connection)

type Result

type Result struct {
	Count     uint32         `json:"count"`
	Documents []*xs.Document `json:"documents"`
}

type Searcher

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

func (*Searcher) Close

func (s *Searcher) Close()

func (*Searcher) Connect

func (s *Searcher) Connect() error

func (*Searcher) GetAllSynonyms

func (s *Searcher) GetAllSynonyms(stemmed bool) map[string][]string

func (*Searcher) GetExpandedQuery

func (s *Searcher) GetExpandedQuery(keyword string, size uint8) ([]string, error)

func (*Searcher) GetSynonyms

func (s *Searcher) GetSynonyms(word string) []string

func (*Searcher) LoadConf

func (s *Searcher) LoadConf(setting *xs.Setting, pool *Pool)

func (*Searcher) Query

func (s *Searcher) Query(keyword string, args ...uint32) (*Result, error)

func (*Searcher) SetAutoSynonyms

func (s *Searcher) SetAutoSynonyms()

func (*Searcher) SetFuzzy

func (s *Searcher) SetFuzzy(fuzzy bool)

func (*Searcher) Terms

func (s *Searcher) Terms(keyword string) ([]string, error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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