elasticsearch

package
v1.2.2 Latest Latest
Warning

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

Go to latest
Published: Dec 1, 2019 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	IKSmart   = "ik_smart"
	IKMaxWrod = "ik_max_word"
)

Variables

This section is empty.

Functions

func AnalyzerText

func AnalyzerText(client elastic.Client, content string) ([]string, error)

AnalyzerText will seperate the content into a slice of meaning words with original order in content the default seperate mode is 'ik_smart'

func CommonSearch

func CommonSearch(client *elastic.Client, indexName string, key string, propertyName string, pageNo int, pageRow int) ([]*elastic.SearchHit, error)

func DeleteData

func DeleteData(client *elastic.Client, indexName string, typeName string, id string) (bool, error)

func DeleteIndex

func DeleteIndex(client *elastic.Client, indexNames []string) (bool, error)

func GetCount

func GetCount(client *elastic.Client, indexName string) (int, error)

GetCount return count for certain index

func GetLLClient

func GetLLClient() (*elastic.Client, error)

GetLLClient returns a long-lived client

func GetSLClient

func GetSLClient() (*elastic.Client, error)

GetSLClient return a short-lived client

func InitialESConfig

func InitialESConfig(serverUrls []string, forceReload bool)

func InsertData

func InsertData(client *elastic.Client, indexName string, typeName string, item interface{}, id string) (bool, string, error)

func IsIndexExisted

func IsIndexExisted(client *elastic.Client, indexName string) (bool, error)

func NewIndexWithMapping

func NewIndexWithMapping(indexName string, typeName string, mapping string) (bool, error)

func UpdateMapping

func UpdateMapping(client *elastic.Client, indexName string, typeName string, mapping string) (bool, error)

Types

type ESConfig

type ESConfig struct {
	ServerUrls []string
}

Jump to

Keyboard shortcuts

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