Commit fd1ffef3 authored by Andrei Mihu's avatar Andrei Mihu
Browse files

Update 'bleve' dependency.

parent c0a2debb
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -31,7 +31,7 @@
  revision = "3a771d992973f24aa725d07868b467d1ddfceafb"

[[projects]]
  digest = "1:109a9e34c738730a57b729573cceffd58d082250337e5d7185c9ff8de3162a85"
  digest = "1:c4463bdc81ad05a0540a53e4a0e7895bb6f1c18870a919b7c5befdad26c18fe9"
  name = "github.com/blevesearch/bleve"
  packages = [
    ".",
@@ -74,7 +74,7 @@
    "size",
  ]
  pruneopts = ""
  revision = "89a815df0798b34feb44e4d3ade3c3a9d338aa63"
  revision = "5cf4e4e02e8a1aec8df8c6773d08e364ee694cea"

[[projects]]
  digest = "1:b9a6b4e079fea1e137c0f8caeb65030978a8dee9f37df5a6ffd9fabe98cdd32e"
+1 −1
Original line number Diff line number Diff line
@@ -72,7 +72,7 @@

[[constraint]]
  name = "github.com/blevesearch/bleve"
  revision = "89a815df0798b34feb44e4d3ade3c3a9d338aa63"
  revision = "5cf4e4e02e8a1aec8df8c6773d08e364ee694cea"

[[constraint]]
  name = "gopkg.in/natefinch/lumberjack.v2"
+8 −0
Original line number Diff line number Diff line
@@ -129,6 +129,14 @@ func (b *Batch) Merge(o *Batch) {
	}
}

func (b *Batch) SetPersistedCallback(f index.BatchCallback) {
	b.internal.SetPersistedCallback(f)
}

func (b *Batch) PersistedCallback() index.BatchCallback {
	return b.internal.PersistedCallback()
}

// An Index implements all the indexing and searching
// capabilities of bleve.  An Index can be created
// using the New() and Open() methods.
+14 −2
Original line number Diff line number Diff line
@@ -248,9 +248,12 @@ type DocIDReader interface {
	Close() error
}

type BatchCallback func(error)

type Batch struct {
	IndexOps          map[string]*document.Document
	InternalOps       map[string][]byte
	persistedCallback BatchCallback
}

func NewBatch() *Batch {
@@ -276,6 +279,14 @@ func (b *Batch) DeleteInternal(key []byte) {
	b.InternalOps[string(key)] = nil
}

func (b *Batch) SetPersistedCallback(f BatchCallback) {
	b.persistedCallback = f
}

func (b *Batch) PersistedCallback() BatchCallback {
	return b.persistedCallback
}

func (b *Batch) String() string {
	rv := fmt.Sprintf("Batch (%d ops, %d internal ops)\n", len(b.IndexOps), len(b.InternalOps))
	for k, v := range b.IndexOps {
@@ -298,6 +309,7 @@ func (b *Batch) String() string {
func (b *Batch) Reset() {
	b.IndexOps = make(map[string]*document.Document)
	b.InternalOps = make(map[string][]byte)
	b.persistedCallback = nil
}

func (b *Batch) Merge(o *Batch) {
+7 −2
Original line number Diff line number Diff line
@@ -19,6 +19,7 @@ import (
	"sync/atomic"

	"github.com/RoaringBitmap/roaring"
	"github.com/blevesearch/bleve/index"
	"github.com/blevesearch/bleve/index/scorch/segment"
	"github.com/blevesearch/bleve/index/scorch/segment/zap"
)
@@ -32,6 +33,7 @@ type segmentIntroduction struct {

	applied           chan error
	persisted         chan error
	persistedCallback index.BatchCallback
}

type persistIntroduction struct {
@@ -213,6 +215,9 @@ func (s *Scorch) introduceSegment(next *segmentIntroduction) error {
	if next.persisted != nil {
		s.rootPersisted = append(s.rootPersisted, next.persisted)
	}
	if next.persistedCallback != nil {
		s.persistedCallbacks = append(s.persistedCallbacks, next.persistedCallback)
	}
	// swap in new index snapshot
	newSnapshot.epoch = s.nextSnapshotEpoch
	s.nextSnapshotEpoch++
Loading