From 582c47da170b79e6f4e64fe2ed85a3931e519c2b Mon Sep 17 00:00:00 2001 From: Steve Manuel Date: Thu, 6 Apr 2017 12:31:04 -0700 Subject: update index path to include the search dir --- system/db/search.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'system/db') 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 -- cgit v1.2.3