diff options
author | Steve Manuel <nilslice@gmail.com> | 2017-04-06 12:31:04 -0700 |
---|---|---|
committer | Steve Manuel <nilslice@gmail.com> | 2017-04-06 12:31:04 -0700 |
commit | 582c47da170b79e6f4e64fe2ed85a3931e519c2b (patch) | |
tree | 23737157162503213f1bb0e6edf14672a64e075a /system/db | |
parent | 38a6c611da7d5f4aa3a1d4fbb94ab5371b9cae5f (diff) |
update index path to include the search dir
Diffstat (limited to 'system/db')
-rw-r--r-- | system/db/search.go | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/system/db/search.go b/system/db/search.go index 8b642ff..2474e19 100644 --- a/system/db/search.go +++ b/system/db/search.go @@ -28,7 +28,7 @@ func MapIndex(typeName string) error { mapping := bleve.NewIndexMapping() mapping.StoreDynamic = false - idxPath := typeName + ".index" + idxName := typeName + ".index" var idx bleve.Index // check if index exists, use it or create new one @@ -44,7 +44,8 @@ func MapIndex(typeName string) error { return err } - if _, err = os.Stat(filepath.Join(searchPath, idxPath)); os.IsNotExist(err) { + idxPath := filepath.Join(searchPath, idxName) + if _, err = os.Stat(idxPath); os.IsNotExist(err) { idx, err = bleve.New(idxPath, mapping) if err != nil { return err |