Skip to content

Instantly share code, notes, and snippets.

View olivere's full-sized avatar

Oliver Eilhard olivere

  • Alt F4
  • Munich, Germany
View GitHub Profile
@olivere
olivere / logic.go
Created March 19, 2018 19:50
Testing with Elastic
package esi
import (
"context"
"github.com/olivere/elastic"
)
type BusinessLogic struct {
s Searcher
@olivere
olivere / elastic_v6_getting_started.go
Created March 1, 2018 07:27
Getting started with Elastic v6
package main
import (
"context"
"encoding/json"
"fmt"
"reflect"
"github.com/olivere/elastic"
)
@olivere
olivere / main.go
Created January 6, 2018 12:01
Issue 497: elastic 5.0.59 on ES 5.6.5
package main
import (
"context"
"log"
"os"
elastic "gopkg.in/olivere/elastic.v5"
)
@olivere
olivere / main.go
Last active January 6, 2018 12:02
Issue 497: elastic 6.1.0 on ES 6.1.1
package main
import (
"context"
"log"
"os"
"github.com/olivere/elastic"
)
@olivere
olivere / list_indices.go
Last active August 23, 2017 14:42
List open and closed indices with Elastic
// Copyright 2012-present Oliver Eilhard. All rights reserved.
// Use of this source code is governed by a MIT-license.
// See http://olivere.mit-license.org/license.txt for details.
// List open and closed indices in Elasticsearch.
//
// Example
//
//
// list -url=http://127.0.0.1:9200 -sniff=false
package main
import (
"context"
"encoding/json"
"fmt"
"reflect"
"time"
elastic "gopkg.in/olivere/elastic.v5"
@olivere
olivere / issue-501.go
Created May 10, 2017 21:06
Create and reindex a document with Index API
// Copyright 2012-present Oliver Eilhard. All rights reserved.
// Use of this source code is governed by a MIT-license.
// See http://olivere.mit-license.org/license.txt for details.
package main
import (
"context"
"log"
"os"
@olivere
olivere / hl1.go
Created April 17, 2017 17:38
Elastic highlighter
package main
import (
"context"
"log"
"os"
"gopkg.in/olivere/elastic.v5"
)
@olivere
olivere / issue-493.go
Created March 27, 2017 21:48
Elastic issue #493
// Copyright 2012-present Oliver Eilhard. All rights reserved.
// Use of this source code is governed by a MIT-license.
// See http://olivere.mit-license.org/license.txt for details.
package main
import (
"fmt"
"log"
"os"
import (
"errors"
"math/rand"
"sync/atomic"
)
// Balancer watches a list of Elasticsearch nodes and watches
// them as they get added or removed. It is also responsible
// for picking the next node to connect to for a request.
type Balancer interface {