Skip to content

Commit

Permalink
rogue one (bracket)
Browse files Browse the repository at this point in the history
  • Loading branch information
HarveyKandola committed Aug 15, 2017
1 parent 1b96c90 commit d4463b5
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions domain/search/mysql/store.go
Original file line number Diff line number Diff line change
Expand Up @@ -132,14 +132,14 @@ func (s Scope) DeleteDocument(ctx domain.RequestContext, ID string) (err error)
func (s Scope) IndexContent(ctx domain.RequestContext, p page.Page) (err error) {
// remove previous search entries
var stmt1 *sqlx.Stmt
stmt1, err = ctx.Transaction.Preparex("DELETE FROM search WHERE orgid=? AND documentid=? AND itemid=? AND itemtype='page' )")
stmt1, err = ctx.Transaction.Preparex("DELETE FROM search WHERE orgid=? AND documentid=? AND itemid=? AND itemtype='page'")
defer streamutil.Close(stmt1)
if err != nil {
err = errors.Wrap(err, "prepare delete document content entry")
return
}

_, err = stmt1.Exec(ctx.OrgID, p.DocumentID)
_, err = stmt1.Exec(ctx.OrgID, p.DocumentID, p.RefID)
if err != nil {
err = errors.Wrap(err, "execute delete document content entry")
return
Expand All @@ -157,7 +157,7 @@ func (s Scope) IndexContent(ctx domain.RequestContext, p page.Page) (err error)
// prepare content
content, err := stringutil.HTML(p.Body).Text(false)
if err != nil {
err = errors.Wrap(err, "search strip HTMl failed")
err = errors.Wrap(err, "search strip HTML failed")
return
}
content = strings.TrimSpace(content)
Expand All @@ -175,14 +175,14 @@ func (s Scope) IndexContent(ctx domain.RequestContext, p page.Page) (err error)
func (s Scope) DeleteContent(ctx domain.RequestContext, pageID string) (err error) {
// remove all search entries
var stmt1 *sqlx.Stmt
stmt1, err = ctx.Transaction.Preparex("DELETE FROM search WHERE orgid=? AND itemid=? AND itemtype='page'")
stmt1, err = ctx.Transaction.Preparex("DELETE FROM search WHERE orgid=? AND itemid=? AND itemtype=?")
defer streamutil.Close(stmt1)
if err != nil {
err = errors.Wrap(err, "prepare delete document content entry")
return
}

_, err = stmt1.Exec(ctx.OrgID, pageID)
_, err = stmt1.Exec(ctx.OrgID, pageID, "page")
if err != nil {
err = errors.Wrap(err, "execute delete document content entry")
return
Expand Down

0 comments on commit d4463b5

Please sign in to comment.