fix backwards compatibility when index meta does not specify
the index type
This commit is contained in:
parent
ad82b4b33e
commit
1c9feaf792
|
@ -21,6 +21,7 @@ import (
|
|||
"github.com/blevesearch/bleve/index"
|
||||
"github.com/blevesearch/bleve/index/store"
|
||||
"github.com/blevesearch/bleve/index/store/inmem"
|
||||
"github.com/blevesearch/bleve/index/upside_down"
|
||||
"github.com/blevesearch/bleve/registry"
|
||||
"github.com/blevesearch/bleve/search"
|
||||
"github.com/blevesearch/bleve/search/collectors"
|
||||
|
@ -183,6 +184,11 @@ func openIndexUsing(path string, runtimeConfig map[string]interface{}) (rv *inde
|
|||
return nil, err
|
||||
}
|
||||
|
||||
// backwards compatability if index type is missing
|
||||
if rv.meta.IndexType == "" {
|
||||
rv.meta.IndexType = upside_down.Name
|
||||
}
|
||||
|
||||
storeConstructor := registry.KVStoreConstructorByName(rv.meta.Storage)
|
||||
if storeConstructor == nil {
|
||||
return nil, ErrorUnknownStorageType
|
||||
|
|
Loading…
Reference in New Issue