rest-layer-es: Index | Files

package es

import ""

Package es is a REST Layer resource storage handler for ElasticSearch


Package Files

elastic.go query.go util.go

type Handler Uses

type Handler struct {

    // Refresh sets the refresh flag to true on all write operation to ensure
    // writes are reflected into search results immediately after the operation.
    // Setting this parameter to "true" has performance impacts.
    Refresh string
    // contains filtered or unexported fields

Handler handles resource storage in an ElasticSearch index.

func NewHandler Uses

func NewHandler(client *elastic.Client, index, typ string) *Handler

NewHandler creates an new ElasticSearch storage handler for the given index/type

func (*Handler) Clear Uses

func (h *Handler) Clear(ctx context.Context, q *query.Query) (int, error)

Clear clears all items from the ElasticSearch index matching the lookup

func (*Handler) Delete Uses

func (h *Handler) Delete(ctx context.Context, item *resource.Item) error

Delete deletes an item from the ElasticSearch index

func (*Handler) Find Uses

func (h *Handler) Find(ctx context.Context, q *query.Query) (*resource.ItemList, error)

Find items from the ElasticSearch index matching the provided lookup

func (*Handler) Insert Uses

func (h *Handler) Insert(ctx context.Context, items []*resource.Item) error

Insert inserts new items in the ElasticSearch index

func (*Handler) MultiGet Uses

func (h *Handler) MultiGet(ctx context.Context, ids []interface{}) ([]*resource.Item, error)

MultiGet implements the optional MultiGetter interface

func (*Handler) Update Uses

func (h *Handler) Update(ctx context.Context, item *resource.Item, original *resource.Item) error

Update replace an item by a new one in the ElasticSearch index

Package es imports 8 packages (graph). Updated 2018-12-01. Refresh now. Tools for package owners.