1
0
Fork 0
mirror of https://github.com/documize/community.git synced 2025-08-05 05:25:27 +02:00

refactored document & search codebase to new API

This commit is contained in:
Harvey Kandola 2017-07-31 18:17:30 +01:00
parent d90b3249c3
commit 65390ab67d
12 changed files with 1288 additions and 35 deletions

View file

@ -23,6 +23,7 @@ import (
org "github.com/documize/community/domain/organization/mysql"
page "github.com/documize/community/domain/page/mysql"
pin "github.com/documize/community/domain/pin/mysql"
search "github.com/documize/community/domain/search/mysql"
setting "github.com/documize/community/domain/setting/mysql"
space "github.com/documize/community/domain/space/mysql"
user "github.com/documize/community/domain/user/mysql"
@ -41,6 +42,7 @@ func AttachStore(r *env.Runtime, s *domain.Store) {
s.Attachment = attachment.Scope{Runtime: r}
s.Link = link.Scope{Runtime: r}
s.Page = page.Scope{Runtime: r}
s.Search = search.Scope{Runtime: r}
}
// https://github.com/golang-sql/sqlexp/blob/c2488a8be21d20d31abf0d05c2735efd2d09afe4/quoter.go#L46

View file

@ -18,13 +18,14 @@ import (
"github.com/documize/community/core/api"
"github.com/documize/community/core/api/request"
"github.com/documize/community/core/env"
"github.com/documize/community/domain"
"github.com/documize/community/domain/search"
"github.com/documize/community/domain/section"
"github.com/documize/community/edition/boot"
"github.com/documize/community/edition/logging"
_ "github.com/documize/community/embed" // the compressed front-end code and static data
"github.com/documize/community/server"
_ "github.com/go-sql-driver/mysql" // the mysql driver is required behind the scenes
"github.com/documize/community/domain"
)
var rt env.Runtime
@ -68,6 +69,9 @@ func main() {
// Register smart sections
section.Register(rt)
// Search indexer queue
search.Start(&rt, &s)
ready := make(chan struct{}, 1) // channel signals router ready
server.Start(&rt, &s, ready)
}