go-elasticsearch: github.com/dustin/go-elasticsearch Index | Files

package elasticsearch

import "github.com/dustin/go-elasticsearch"

Go interface to elasticsearch.


Package Files

bulk.go bytesource.go es.go

func NewByteSource Uses

func NewByteSource(from <-chan []byte) *bytesource

type BulkUpdater Uses

type BulkUpdater interface {
    // Update the index with a new record (or delete a record).
    Update(ui Instruction)
    // Send the current batch.
    SendBatch() error
    // Shut down this bulk interface

Interface for writing bulk data into elasticsearch.

type DeleteInstruction Uses

type DeleteInstruction struct {
    Id      string `json:"_id"`
    Index   string `json:"_index"`
    Type    string `json:"_type"`
    Routing string `json:"_routing,omitempty"`

Instruction to delete an item from an index.

type ElasticSearch Uses

type ElasticSearch struct {
    // Base URL to elasticsearch
    URL string

Reference to an ElasticSearch server.

func (*ElasticSearch) Bulk Uses

func (e *ElasticSearch) Bulk() BulkUpdater

Get a bulk updater.

func (*ElasticSearch) Delete Uses

func (es *ElasticSearch) Delete(index, doctype, id string,
    params map[string]string) (bool, error)

Delete an index entry.

func (*ElasticSearch) Index Uses

func (es *ElasticSearch) Index(index, doctype, id string,
    doc map[string]interface{},
    params map[string]string) (string, error)

Store a document in the index.

The ID is optional in which case the ID will be generated by the server.

Returns the new ID on success, otherwise an error.

type Instruction Uses

type Instruction interface {
    // contains filtered or unexported methods

Abstract bulk update instruction.

type UpdateInstruction Uses

type UpdateInstruction struct {
    Id      string                 `json:"_id"`
    Index   string                 `json:"_index"`
    Type    string                 `json:"_type"`
    Routing string                 `json:"_routing,omitempty"`
    Body    map[string]interface{} `json:"-"`

Instruction to update an index entry.

Package elasticsearch imports 8 packages (graph) and is imported by 1 packages. Updated 2016-12-12. Refresh now. Tools for package owners.