Skip to content
REST Layer ElasticSearch resource storage handler
Go
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.travis.yml
README.md
elastic.go
elastic_test.go
query.go
query_test.go Due to change in rs/rest-layer #204, receive `Expression` query param… Nov 27, 2018
util.go
util_test.go

README.md

REST Layer ElasticSearch Backend

godoc license build

This REST Layer resource storage backend stores data in an ElasticSearch cluster using olivere/elastic.

ElasticSearch v5+ is required.

Usage

import "github.com/rs/rest-layer-es"

Create an elastic client:

client, err := elastic.NewClient()

Create a resource storage handler with a given DB/collection:

s := es.NewHandler(client, "index", "type")

Use this handler with a resource:

index.Bind("foo", foo, s, resource.DefaultConf)

You may want to create as many ElasticSearch handlers with different index and/or type. You can share the same elastic client across all you handlers.

You can’t perform that action at this time.