meili

package
v1.1.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 14, 2026 License: GPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MeiliSearchHit added in v1.0.0

type MeiliSearchHit struct {
	MeilisearchMessageDocument
	Formatted struct {
		ID        string `json:"id"`
		Type      string `json:"type"`
		Message   string `json:"message"`
		Ocred     string `json:"ocred"`
		UserID    string `json:"user_id"`
		MessageID string `json:"message_id"`
		ChatID    string `json:"chat_id"`
		Timestamp string `json:"timestamp"`
	} `json:"_formatted"`
}

func (*MeiliSearchHit) ToSearchHit added in v1.0.0

func (h *MeiliSearchHit) ToSearchHit() types.SearchHit

type Meilisearch

type Meilisearch struct {
	Client meilisearch.ServiceManager
	Index  string
	// contains filtered or unexported fields
}

func (*Meilisearch) AddDocuments

func (m *Meilisearch) AddDocuments(ctx context.Context, chatID int64, docs []*types.MessageDocument) error

AddDocuments implements engine.Searcher.

func (*Meilisearch) CreateIndex

func (m *Meilisearch) CreateIndex(ctx context.Context, _ int64) error

CreateIndex implements engine.Searcher. 对于 Meilisearch 实现,这里创建/配置的是共享索引 m.Index,chatID 参数不会被使用。

func (*Meilisearch) DeleteDocuments

func (m *Meilisearch) DeleteDocuments(ctx context.Context, chatID int64, ids []int) error

DeleteDocuments implements engine.Searcher.

func (*Meilisearch) DeleteIndex

func (m *Meilisearch) DeleteIndex(ctx context.Context, chatID int64) error

DeleteIndex implements engine.Searcher.

func (*Meilisearch) GetDocuments

func (m *Meilisearch) GetDocuments(ctx context.Context, chatID int64, messageIds []int) ([]*types.MessageDocument, error)

GetDocuments implements engine.Searcher.

func (*Meilisearch) Search

Search implements engine.Searcher.

type MeilisearchMessageDocument added in v1.0.0

type MeilisearchMessageDocument struct {
	// "chatid_messageid"
	ID   string `json:"id"`
	Type int    `json:"type"`
	// The original text of the message
	Message string `json:"message"`
	// The OCRed text of the message
	Ocred string `json:"ocred"`
	// The AI generated text of the message(summarization, caption, tagging, etc.)
	AIGenerated string `json:"aigenerated"`
	// The ID of the user who sent the message
	UserID int64 `json:"user_id"`
	ChatID int64 `json:"chat_id"`
	// Telegram MessageID
	MessageID int64 `json:"message_id"`
	Timestamp int64 `json:"timestamp"`
}

meilisearch 内部使用 chat_id_message_id 作为文档 ID 在接口中传递的 id 列表始终为 Telegram MessageID

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL