Skip to content

Commit

Permalink
Merge branch 'feature/search' of github.com:cayleygraph/cayley into f…
Browse files Browse the repository at this point in the history
…eature/search
  • Loading branch information
iddan committed Dec 15, 2019
2 parents 99f57ad + 889f9c8 commit 0056828
Show file tree
Hide file tree
Showing 4 changed files with 983 additions and 6 deletions.
3 changes: 1 addition & 2 deletions graph/kv/quadstore.go
Original file line number Diff line number Diff line change
Expand Up @@ -161,15 +161,14 @@ func Init(kv kv.KV, opt graph.Options) error {
return err
}
if searchConfig != nil {
// TODO(iddan): get search configuration from opt
mapping := search.NewIndexMapping(searchConfig)
searchIndex, err := bleve.New("temp.bleve", mapping)
search.InitIndex(context.TODO(), searchIndex, qs, searchConfig)

if err != nil {
return err
}

qs.search.config = searchConfig
qs.search.index = searchIndex
}
return nil
Expand Down
7 changes: 3 additions & 4 deletions graph/memstore/quadstore.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,16 +39,15 @@ func init() {
return nil, err
}
if searchConfig != nil {
// TODO(iddan): get search configuration from opt
var configs search.Configuration
mapping := search.NewIndexMapping(configs)
mapping := search.NewIndexMapping(searchConfig)
searchIndex, err := bleve.NewMemOnly(mapping)
search.InitIndex(context.TODO(), searchIndex, qs, configs)
search.InitIndex(context.TODO(), searchIndex, qs, searchConfig)

if err != nil {
return nil, err
}

qs.search.config = searchConfig
qs.search.index = searchIndex
}
return qs, nil
Expand Down
Loading

0 comments on commit 0056828

Please sign in to comment.