Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

switch default index to scorch with latest zap #1528

Merged
merged 1 commit into from
Dec 22, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 2 additions & 5 deletions config.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,11 @@ import (
"log"
"time"

"github.com/blevesearch/bleve/index/scorch"
"github.com/blevesearch/bleve/index/upsidedown/store/gtreap"
"github.com/blevesearch/bleve/index/upsidedown"
"github.com/blevesearch/bleve/registry"
"github.com/blevesearch/bleve/search/highlight/highlighter/html"
index "github.com/blevesearch/bleve_index_api"

// force import of scorch so its accessible by default
_ "github.com/blevesearch/bleve/index/scorch"
)

var bleveExpVar = expvar.NewMap("bleve")
Expand Down Expand Up @@ -79,7 +76,7 @@ func init() {
Config.DefaultMemKVStore = gtreap.Name

// default index
Config.DefaultIndexType = upsidedown.Name
Config.DefaultIndexType = scorch.Name

bootDuration := time.Since(bootStart)
bleveExpVar.Add("bootDuration", int64(bootDuration))
Expand Down
1 change: 1 addition & 0 deletions examples_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -449,6 +449,7 @@ func ExampleSearchRequest_SortByCustom() {
Field: "Age",
Missing: search.SortFieldMissingFirst,
},
&search.SortDocID{},
})
searchResults, err := exampleIndex.Search(searchRequest)
if err != nil {
Expand Down
3 changes: 2 additions & 1 deletion index.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ package bleve

import (
"context"
"github.com/blevesearch/bleve/index/upsidedown"

"github.com/blevesearch/bleve/document"
"github.com/blevesearch/bleve/mapping"
Expand Down Expand Up @@ -261,7 +262,7 @@ func New(path string, mapping mapping.IndexMapping) (Index, error) {
// The provided mapping will be used for all
// Index/Search operations.
func NewMemOnly(mapping mapping.IndexMapping) (Index, error) {
return newIndexUsing("", mapping, Config.DefaultIndexType, Config.DefaultMemKVStore, nil)
return newIndexUsing("", mapping, upsidedown.Name, Config.DefaultMemKVStore, nil)
}

// NewUsing creates index at the specified path,
Expand Down
4 changes: 2 additions & 2 deletions index/scorch/segment_plugin.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,11 +71,11 @@ var defaultSegmentPlugin SegmentPlugin

func init() {
ResetSegmentPlugins()
RegisterSegmentPlugin(&zapv15.ZapPlugin{}, false)
RegisterSegmentPlugin(&zapv15.ZapPlugin{}, true)
RegisterSegmentPlugin(&zapv14.ZapPlugin{}, false)
RegisterSegmentPlugin(&zapv13.ZapPlugin{}, false)
RegisterSegmentPlugin(&zapv12.ZapPlugin{}, false)
RegisterSegmentPlugin(&zapv11.ZapPlugin{}, true)
RegisterSegmentPlugin(&zapv11.ZapPlugin{}, false)
}

func ResetSegmentPlugins() {
Expand Down