feat(search): sync entity writes to indexer
This commit is contained in:
@@ -289,6 +289,61 @@ func (s *SearchService) IndexDocument(ctx context.Context, doc SearchDocument) e
|
||||
return s.engine.IndexDocument(ctx, doc)
|
||||
}
|
||||
|
||||
func (s *SearchService) IndexConversation(ctx context.Context, conversation *model.Conversation) error {
|
||||
if conversation == nil {
|
||||
return nil
|
||||
}
|
||||
return s.IndexDocument(ctx, ConversationDocument(*conversation))
|
||||
}
|
||||
|
||||
func (s *SearchService) DeleteConversation(ctx context.Context, accountID uint, id uint) error {
|
||||
return s.DeleteDocument(ctx, ResultTypeConversation, accountID, id)
|
||||
}
|
||||
|
||||
func (s *SearchService) IndexMessage(ctx context.Context, message *model.Message) error {
|
||||
if message == nil {
|
||||
return nil
|
||||
}
|
||||
return s.IndexDocument(ctx, MessageDocument(*message))
|
||||
}
|
||||
|
||||
func (s *SearchService) DeleteMessage(ctx context.Context, accountID uint, id uint) error {
|
||||
return s.DeleteDocument(ctx, ResultTypeMessage, accountID, id)
|
||||
}
|
||||
|
||||
func (s *SearchService) IndexContact(ctx context.Context, contact *model.Contact) error {
|
||||
if contact == nil {
|
||||
return nil
|
||||
}
|
||||
return s.IndexDocument(ctx, ContactDocument(*contact))
|
||||
}
|
||||
|
||||
func (s *SearchService) DeleteContact(ctx context.Context, accountID uint, id uint) error {
|
||||
return s.DeleteDocument(ctx, ResultTypeContact, accountID, id)
|
||||
}
|
||||
|
||||
func (s *SearchService) IndexCompany(ctx context.Context, company *model.Company) error {
|
||||
if company == nil {
|
||||
return nil
|
||||
}
|
||||
return s.IndexDocument(ctx, CompanyDocument(*company))
|
||||
}
|
||||
|
||||
func (s *SearchService) DeleteCompany(ctx context.Context, accountID uint, id uint) error {
|
||||
return s.DeleteDocument(ctx, ResultTypeCompany, accountID, id)
|
||||
}
|
||||
|
||||
func (s *SearchService) IndexArticle(ctx context.Context, article *model.Article) error {
|
||||
if article == nil {
|
||||
return nil
|
||||
}
|
||||
return s.IndexDocument(ctx, ArticleDocument(*article))
|
||||
}
|
||||
|
||||
func (s *SearchService) DeleteArticle(ctx context.Context, accountID uint, id uint) error {
|
||||
return s.DeleteDocument(ctx, ResultTypeArticle, accountID, id)
|
||||
}
|
||||
|
||||
func (s *SearchService) IndexBatch(ctx context.Context, docs []SearchDocument) error {
|
||||
if s.engine == nil {
|
||||
return nil
|
||||
|
||||
Reference in New Issue
Block a user