mirror of
https://github.com/documize/community.git
synced 2025-08-05 05:25:27 +02:00
WIP SQL Server support
This commit is contained in:
parent
64403c402b
commit
a41f43c380
9 changed files with 804 additions and 749 deletions
|
@ -13,6 +13,8 @@ package search
|
|||
|
||||
import (
|
||||
"database/sql"
|
||||
|
||||
"github.com/documize/community/core/env"
|
||||
"github.com/documize/community/domain"
|
||||
"github.com/documize/community/model/attachment"
|
||||
"github.com/documize/community/model/category"
|
||||
|
@ -25,6 +27,10 @@ import (
|
|||
// IndexDocument adds search indesd entries for document inserting title, tags and attachments as
|
||||
// searchable items. Any existing document entries are removed.
|
||||
func (m *Indexer) IndexDocument(ctx domain.RequestContext, d doc.Document, a []attachment.Attachment) {
|
||||
if m.runtime.StoreProvider.Type() == env.StoreTypeSQLServer {
|
||||
return
|
||||
}
|
||||
|
||||
method := "search.IndexDocument"
|
||||
var err error
|
||||
|
||||
|
@ -47,6 +53,10 @@ func (m *Indexer) IndexDocument(ctx domain.RequestContext, d doc.Document, a []a
|
|||
|
||||
// DeleteDocument removes all search entries for document.
|
||||
func (m *Indexer) DeleteDocument(ctx domain.RequestContext, ID string) {
|
||||
if m.runtime.StoreProvider.Type() == env.StoreTypeSQLServer {
|
||||
return
|
||||
}
|
||||
|
||||
method := "search.DeleteDocument"
|
||||
var err error
|
||||
|
||||
|
@ -70,6 +80,10 @@ func (m *Indexer) DeleteDocument(ctx domain.RequestContext, ID string) {
|
|||
// IndexContent adds search index entry for document context.
|
||||
// Any existing document entries are removed.
|
||||
func (m *Indexer) IndexContent(ctx domain.RequestContext, p page.Page) {
|
||||
if m.runtime.StoreProvider.Type() == env.StoreTypeSQLServer {
|
||||
return
|
||||
}
|
||||
|
||||
method := "search.IndexContent"
|
||||
var err error
|
||||
|
||||
|
@ -97,6 +111,10 @@ func (m *Indexer) IndexContent(ctx domain.RequestContext, p page.Page) {
|
|||
|
||||
// DeleteContent removes all search entries for specific document content.
|
||||
func (m *Indexer) DeleteContent(ctx domain.RequestContext, pageID string) {
|
||||
if m.runtime.StoreProvider.Type() == env.StoreTypeSQLServer {
|
||||
return
|
||||
}
|
||||
|
||||
method := "search.DeleteContent"
|
||||
var err error
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue