mirror of
https://github.com/documize/community.git
synced 2025-07-24 15:49:44 +02:00
add entries to search index
This commit is contained in:
parent
2c5f73a486
commit
1b96c9093f
15 changed files with 244 additions and 417 deletions
|
@ -28,6 +28,7 @@ import (
|
|||
"github.com/documize/community/core/uniqueid"
|
||||
"github.com/documize/community/domain"
|
||||
"github.com/documize/community/domain/document"
|
||||
indexer "github.com/documize/community/domain/search"
|
||||
"github.com/documize/community/model/attachment"
|
||||
"github.com/documize/community/model/audit"
|
||||
"github.com/documize/community/model/doc"
|
||||
|
@ -40,6 +41,7 @@ import (
|
|||
type Handler struct {
|
||||
Runtime *env.Runtime
|
||||
Store *domain.Store
|
||||
Indexer indexer.Indexer
|
||||
}
|
||||
|
||||
// SavedList returns all templates saved by the user
|
||||
|
@ -363,5 +365,8 @@ func (h *Handler) Use(w http.ResponseWriter, r *http.Request) {
|
|||
|
||||
event.Handler().Publish(string(event.TypeAddDocument), nd.Title)
|
||||
|
||||
a, _ := h.Store.Attachment.GetAttachments(ctx, documentID)
|
||||
go h.Indexer.IndexDocument(ctx, nd, a)
|
||||
|
||||
response.WriteJSON(w, nd)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue