Documentation ¶
Overview ¶
2017-04-02 02:04 package gxelasticsearch provides a Elasticsearch driver
Index ¶
- type EsClient
- func (ec EsClient) BulkInsert(index, typ string, arr []interface{}) error
- func (ec EsClient) CreateEsIndex(index string, shardNum, replicaNum, refreshInterval int32) error
- func (ec EsClient) CreateEsIndexWithTimestamp(index string, shardNum, replicaNum, refreshInterval int32, ...) error
- func (ec EsClient) DeleteEsIndex(index string) error
- func (ec EsClient) Insert(index, typ string, msg interface{}) error
- func (ec EsClient) InsertWithDocId(index, typ, docID string, msg interface{}) error
- func (ec EsClient) SetTemplate(index, template string, force bool) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type EsClient ¶
func CreateEsClient ¶
func (EsClient) BulkInsert ¶
BulkInsert 批量插入@arr !!! 如果@arr[0]的类型是string 或者 []byte,则被当做Json String类型直接存进去 https://www.elastic.co/guide/en/elasticsearch/guide/current/bulk.html A good place to start is with batches of 1,000 to 5,000 documents
func (EsClient) CreateEsIndex ¶
func (EsClient) CreateEsIndexWithTimestamp ¶ added in v0.2.0
func (EsClient) DeleteEsIndex ¶
func (EsClient) Insert ¶
InsertWithDocId 插入@msg !!! 如果@msg的类型是string 或者 []byte,则被当做Json String类型直接存进去
func (EsClient) InsertWithDocId ¶
InsertWithDocId 插入@msg时候指定@docID !!! 如果@msg的类型是string 或者 []byte,则被当做Json String类型直接存进去
func (EsClient) SetTemplate ¶ added in v0.3.0
[template](https://github.com/inloco/kafka-elasticsearch-injector/blob/master/src/elasticsearch/elasticsearch_test.go#L39) `
{ "template": "my-topic-*", "settings": {}, "mappings": { "my-topic": { "_source": { "enabled": "true" }, "dynamic_templates": [ { "strings": { "mapping": { "index": "not_analyzed", "type": "string" }, "match_mapping_type": "string" } } ], "properties": { "id": { "type": "keyword" } } } }, "aliases": {} }
` set mapping & settings
Click to show internal directories.
Click to hide internal directories.