Documentation ¶
Index ¶
- Constants
- type ClassificationHit
- type Core
- func (c *Core) Classify(ctx context.Context, namespaceName string, queryText string, size int) ([]ClassificationHit, error)
- func (c *Core) Consolidate(ctx context.Context, namespaceName string) error
- func (c *Core) CreateNamespace(ctx context.Context, name string) (*models.Namespace, error)
- func (c *Core) DeleteDocument(ctx context.Context, namespaceName string, id string) error
- func (c *Core) DeleteNamespace(ctx context.Context, name string) error
- func (c *Core) Finalize() error
- func (c *Core) GetDocument(ctx context.Context, namespaceName string, id string) (*models.Document, error)
- func (c *Core) GetDocuments(ctx context.Context, namespaceName string, first int, after string) ([]models.Document, error)
- func (c *Core) GetNamespace(ctx context.Context, name string) (*models.Namespace, error)
- func (c *Core) GetNamespaces(ctx context.Context) ([]models.Namespace, error)
- func (c *Core) InsertDocuments(ctx context.Context, docs []models.Document) error
- func (c *Core) Search(ctx context.Context, namespaceName string, queryText string, offset int, ...) ([]SearchHit, error)
- type SearchHit
- type TextHighlight
Constants ¶
const ( // DocumentTextTitleIndex is the default Index of a Text representing // a Document's title. DocumentTextTitleIndex = 0 // DocumentTextBodyIndex is the default Index of a Text representing // a Document's body. DocumentTextBodyIndex = 1 )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ClassificationHit ¶
ClassificationHit is a single result from the Core.Classify function.
type Core ¶
type Core struct {
// contains filtered or unexported fields
}
Core implements all main functionalities.
func (*Core) Classify ¶
func (c *Core) Classify( ctx context.Context, namespaceName string, queryText string, size int, ) ([]ClassificationHit, error)
Classify performs a normal similarity/semantic over the set of Documents from a Namespace, then uses the tags from the document results to classify the input text.
func (*Core) Consolidate ¶
Consolidate (re)builds the HNSW index from the current set of documents from the given namespace.
func (*Core) CreateNamespace ¶
CreateNamespace creates a new Namespace.
func (*Core) DeleteDocument ¶
DeleteDocument deletes a document from a Namespace.
func (*Core) DeleteNamespace ¶
DeleteNamespace deletes a Namespace.
func (*Core) GetDocument ¶
func (c *Core) GetDocument(ctx context.Context, namespaceName string, id string) (*models.Document, error)
GetDocument returns one Document from a Namespace.
func (*Core) GetDocuments ¶
func (c *Core) GetDocuments(ctx context.Context, namespaceName string, first int, after string) ([]models.Document, error)
GetDocuments returns all Documents from a Namespace.
func (*Core) GetNamespace ¶
GetNamespace returns a Namespace by name.
func (*Core) GetNamespaces ¶
GetNamespaces returns all Namespaces.
func (*Core) InsertDocuments ¶
InsertDocuments augments the given Documents' Texts with Tags and inserts the documents in the database.