summaryrefslogtreecommitdiff
path: root/system/db/content.go
diff options
context:
space:
mode:
authorSteve Manuel <nilslice@gmail.com>2017-04-13 13:29:18 -0700
committerSteve Manuel <nilslice@gmail.com>2017-04-13 13:29:18 -0700
commitade7c2d69c9884c493fbc2f66f6a7405c0f4f96b (patch)
tree39d5fb68b9e959b55ec3a0dbde05375f8e4ef962 /system/db/content.go
parentfe9938cc4ce7885533bf751de5b2eb65a962e99c (diff)
moving search into own package and renaming funcs throughout
Diffstat (limited to 'system/db/content.go')
-rw-r--r--system/db/content.go13
1 files changed, 7 insertions, 6 deletions
diff --git a/system/db/content.go b/system/db/content.go
index fbdd8dd..b3e2642 100644
--- a/system/db/content.go
+++ b/system/db/content.go
@@ -12,6 +12,7 @@ import (
"time"
"github.com/ponzu-cms/ponzu/system/item"
+ "github.com/ponzu-cms/ponzu/system/search"
"github.com/boltdb/bolt"
"github.com/gorilla/schema"
@@ -125,9 +126,9 @@ func update(ns, id string, data url.Values, existingContent *[]byte) (int, error
go func() {
// update data in search index
target := fmt.Sprintf("%s:%s", ns, id)
- err = UpdateSearchIndex(target, j)
+ err = search.UpdateIndex(target, j)
if err != nil {
- log.Println("[search] UpdateSearchIndex Error:", err)
+ log.Println("[search] UpdateIndex Error:", err)
}
}()
@@ -253,9 +254,9 @@ func insert(ns string, data url.Values) (int, error) {
go func() {
// add data to seach index
target := fmt.Sprintf("%s:%s", ns, cid)
- err = UpdateSearchIndex(target, j)
+ err = search.UpdateIndex(target, j)
if err != nil {
- log.Println("[search] UpdateSearchIndex Error:", err)
+ log.Println("[search] UpdateIndex Error:", err)
}
}()
@@ -322,9 +323,9 @@ func DeleteContent(target string) error {
// delete indexed data from search index
if !strings.Contains(ns, "__") {
target = fmt.Sprintf("%s:%s", ns, id)
- err = DeleteSearchIndex(target)
+ err = search.DeleteIndex(target)
if err != nil {
- log.Println("[search] DeleteSearchIndex Error:", err)
+ log.Println("[search] DeleteIndex Error:", err)
}
}
}()