es

package
v0.0.0-...-24adcff Latest Latest
Warning

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

Go to latest
Published: Jun 11, 2024 License: Unlicense Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConstructCategoryIDQuery

func ConstructCategoryIDQuery(id int64) interface{}

func ConstructHeightQuery

func ConstructHeightQuery(min, max int) interface{}

func ConstructPriceQuery

func ConstructPriceQuery(min, max int) interface{}

func ConstructTitleQuery

func ConstructTitleQuery(t string) interface{}

func ConstructWidthQuery

func ConstructWidthQuery(min, max int) interface{}

Types

type ESClient

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

ESClient represents an Elasticsearch client object.

func NewElasticsearchClient

func NewElasticsearchClient(addresses []string, indexName string) (*ESClient, error)

NewElasticsearchClient creates a new instance of ElasticsearchClient.

func (*ESClient) Delete

func (ec *ESClient) Delete(ctx context.Context, document docgen.Document) error

Delete deletes a document in Elasticsearch.

func (*ESClient) GetInfo

func (ec *ESClient) GetInfo() error

GetInfo retrieves and prints the Elasticsearch server information.

func (*ESClient) Index

func (ec *ESClient) Index(ctx context.Context, document docgen.Document) error

Index indexes a document in Elasticsearch.

func (*ESClient) Query

func (ec *ESClient) Query(ctx context.Context, q []interface{}, size int) ([]docgen.Document, error)

func (*ESClient) ScrollDocID

func (ec *ESClient) ScrollDocID(ctx context.Context, size int) ([]int, error)

func (*ESClient) Update

func (ec *ESClient) Update(ctx context.Context, document docgen.Document) error

Update updates a document in Elasticsearch.

Jump to

Keyboard shortcuts

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