elastic

package
v0.1.7 Latest Latest
Warning

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

Go to latest
Published: Sep 30, 2022 License: BSD-3-Clause Imports: 17 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Index

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

Index is an ElasticSearch index

func NewIndex

func NewIndex(addr, name, typ string, disableCache bool, md *index.Metadata, user, pass string, shardCount, replicaCount, indexerNumCPUs int, tlsSkipVerify bool, bulkIndexerFlushIntervalSeconds int, bulkIndexerRefresh string) (*Index, error)

NewIndex creates a new elasticSearch index with the given address and name. typ is the entity type

func (*Index) Create

func (i *Index) Create() error

Create creates the index and posts a mapping corresponding to our Metadata

func (*Index) Delete

func (i *Index) Delete() error

Delete the suggestion index, currently just calls Drop()

func (*Index) DocumentCount added in v0.1.3

func (i *Index) DocumentCount() int64

func (*Index) Drop

func (i *Index) Drop() error

Drop deletes the index

func (*Index) FullTextQuerySingleField

func (i *Index) FullTextQuerySingleField(q query.Query, verbose int) ([]index.Document, int, error)

Search searches the index for the given query, and returns documents, the total number of results, or an error if something went wrong https://www.elastic.co/guide/en/elasticsearch/reference/current/full-text-queries.html

func (*Index) GetName

func (i *Index) GetName() string

func (*Index) Index

func (i *Index) Index(docs []index.Document, opts interface{}) error

Index indexes multiple documents

Jump to

Keyboard shortcuts

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