document

package
v0.5.0-beta Latest Latest
Warning

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

Go to latest
Published: Dec 16, 2023 License: Apache-2.0 Imports: 25 Imported by: 0

Documentation

Index

Constants

View Source
const HtmlAnalyzer = "html"
View Source
const (
	QueryDialectBleve = "bleve"
)

Variables

This section is empty.

Functions

func AnalyzerConstructor

func AnalyzerConstructor(config map[string]interface{}, cache *registry.Cache) (analysis.Analyzer, error)

Types

type BleveDocument

type BleveDocument struct {
	ID            string    `json:"id"`
	OID           int64     `json:"oid"`
	Name          string    `json:"name"`
	ParentEntryID int64     `json:"parent_entry_id"`
	Source        string    `json:"source"`
	KeyWords      []string  `json:"keywords,omitempty"`
	Content       string    `json:"content,omitempty"`
	Summary       string    `json:"summary,omitempty"`
	CreatedAt     time.Time `json:"created_at"`
	ChangedAt     time.Time `json:"changed_at"`
}

func (*BleveDocument) BleveType

func (d *BleveDocument) BleveType() string

type Indexer

type Indexer struct {
	// contains filtered or unexported fields
}

func NewDocumentIndexer

func NewDocumentIndexer(recorder metastore.DEntry, cfg config.Indexer) (*Indexer, error)

func (*Indexer) Delete

func (i *Indexer) Delete(ctx context.Context, docID int64) error

func (*Indexer) Index

func (i *Indexer) Index(ctx context.Context, doc *types.Document) error

func (*Indexer) Query

func (i *Indexer) Query(ctx context.Context, query, dialect string) ([]*types.Document, error)

type Manager

type Manager interface {
	ListDocuments(ctx context.Context, parentId int64) ([]*types.Document, error)
	QueryDocuments(ctx context.Context, query string) ([]*types.Document, error)
	SaveDocument(ctx context.Context, doc *types.Document) error
	GetDocument(ctx context.Context, id int64) (*types.Document, error)
	GetDocumentByEntryId(ctx context.Context, oid int64) (*types.Document, error)
	DeleteDocument(ctx context.Context, id int64) error

	EnableGroupFeed(ctx context.Context, id int64, feedID string) error
	DisableGroupFeed(ctx context.Context, id int64) error
	GetDocsByFeedId(ctx context.Context, feedID string, count int) (*types.FeedResult, error)

	CreateFridayAccount(ctx context.Context, account *types.FridayAccount) error
}

func NewManager

func NewManager(recorder metastore.DEntry, entryMgr dentry.Manager, indexerCfg *config.Indexer) (Manager, error)

Jump to

Keyboard shortcuts

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