fix accessing store via Advanced() method which was broken
This commit is contained in:
parent
a236737a68
commit
c5dea9e882
|
@ -546,6 +546,10 @@ func (f *Firestorm) Wait(timeout time.Duration) error {
|
|||
return f.dictUpdater.waitTasksDone(timeout)
|
||||
}
|
||||
|
||||
func (f *Firestorm) Advanced() (store.KVStore, error) {
|
||||
return f.store, nil
|
||||
}
|
||||
|
||||
func init() {
|
||||
registry.RegisterIndexType(Name, NewFirestorm)
|
||||
}
|
||||
|
|
|
@ -15,6 +15,7 @@ import (
|
|||
"time"
|
||||
|
||||
"github.com/blevesearch/bleve/document"
|
||||
"github.com/blevesearch/bleve/index/store"
|
||||
)
|
||||
|
||||
var ErrorUnknownStorageType = fmt.Errorf("unknown storage type")
|
||||
|
@ -43,6 +44,8 @@ type Index interface {
|
|||
Stats() json.Marshaler
|
||||
|
||||
Analyze(d *document.Document) *AnalysisResult
|
||||
|
||||
Advanced() (store.KVStore, error)
|
||||
}
|
||||
|
||||
// AsyncIndex is an interface for indexes which perform
|
||||
|
|
|
@ -1024,6 +1024,10 @@ func (udc *UpsideDownCouch) Stats() json.Marshaler {
|
|||
return udc.stats
|
||||
}
|
||||
|
||||
func (udc *UpsideDownCouch) Advanced() (store.KVStore, error) {
|
||||
return udc.store, nil
|
||||
}
|
||||
|
||||
func (udc *UpsideDownCouch) fieldIndexOrNewRow(name string) (uint16, *FieldRow) {
|
||||
index, existed := udc.fieldCache.FieldNamed(name, true)
|
||||
if !existed {
|
||||
|
|
|
@ -32,7 +32,6 @@ type indexImpl struct {
|
|||
path string
|
||||
name string
|
||||
meta *indexMeta
|
||||
s store.KVStore
|
||||
i index.Index
|
||||
m *IndexMapping
|
||||
mutex sync.RWMutex
|
||||
|
@ -251,7 +250,11 @@ func openIndexUsing(path string, runtimeConfig map[string]interface{}) (rv *inde
|
|||
// Advanced returns implementation internals
|
||||
// necessary ONLY for advanced usage.
|
||||
func (i *indexImpl) Advanced() (index.Index, store.KVStore, error) {
|
||||
return i.i, i.s, nil
|
||||
s, err := i.i.Advanced()
|
||||
if err != nil {
|
||||
return nil, nil, err
|
||||
}
|
||||
return i.i, s, nil
|
||||
}
|
||||
|
||||
// Mapping returns the IndexMapping in use by this
|
||||
|
|
Loading…
Reference in New Issue