community: github.com/documize/community/domain/search Index | Files

package search

import "github.com/documize/community/domain/search"

Index

Package Files

endpoint.go handler.go search.go store.go store_sqlserver.go

func FilterCategoryProtected Uses

func FilterCategoryProtected(results []sm.QueryResult, cats []category.Category, members []category.Member) (filtered []sm.QueryResult)

FilterCategoryProtected removes search results that cannot be seen by user due to document cateogory viewing permissions.

type Handler Uses

type Handler struct {
    Runtime *env.Runtime
    Store   *store.Store
    Indexer Indexer
}

Handler contains the runtime information such as logging and database.

func (*Handler) Reindex Uses

func (h *Handler) Reindex(w http.ResponseWriter, r *http.Request)

Reindex indexes all documents and attachments.

func (*Handler) Status Uses

func (h *Handler) Status(w http.ResponseWriter, r *http.Request)

Status returns state of search index

type Indexer Uses

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

Indexer documents!

func NewIndexer Uses

func NewIndexer(rt *env.Runtime, s *store.Store) (i Indexer)

NewIndexer provides background search indexer

func (*Indexer) DeleteContent Uses

func (m *Indexer) DeleteContent(ctx domain.RequestContext, pageID string)

DeleteContent removes all search entries for specific document content.

func (*Indexer) DeleteDocument Uses

func (m *Indexer) DeleteDocument(ctx domain.RequestContext, ID string)

DeleteDocument removes all search entries for document.

func (*Indexer) IndexContent Uses

func (m *Indexer) IndexContent(ctx domain.RequestContext, p page.Page)

IndexContent adds search index entry for document context. Any existing document entries are removed.

func (*Indexer) IndexDocument Uses

func (m *Indexer) IndexDocument(ctx domain.RequestContext, d doc.Document, a []attachment.Attachment)

IndexDocument adds search indesd entries for document inserting title, tags and attachments as searchable items. Any existing document entries are removed.

func (*Indexer) Rebuild Uses

func (m *Indexer) Rebuild(ctx domain.RequestContext)

Rebuild recreates all search indexes.

type Store Uses

type Store struct {
    store.Context
    store.SearchStorer
}

Store provides data access to space information.

func (Store) DeleteContent Uses

func (s Store) DeleteContent(ctx domain.RequestContext, pageID string) (err error)

DeleteContent removes all search entries for specific document content.

func (Store) DeleteDocument Uses

func (s Store) DeleteDocument(ctx domain.RequestContext, ID string) (err error)

DeleteDocument removes all search entries for document.

func (Store) Documents Uses

func (s Store) Documents(ctx domain.RequestContext, q search.QueryOptions) (results []search.QueryResult, err error)

Documents searches the documents that the client is allowed to see, using the keywords search string, then audits that search. Visible documents include both those in the client's own organization and those that are public, or whose visibility includes the client.

func (Store) IndexContent Uses

func (s Store) IndexContent(ctx domain.RequestContext, p page.Page) (err error)

IndexContent adds search index entry for document context. Any existing document entries are removed.

func (Store) IndexDocument Uses

func (s Store) IndexDocument(ctx domain.RequestContext, doc doc.Document, a []attachment.Attachment) (err error)

IndexDocument adds search index entries for document inserting title, tags and attachments as searchable items. Any existing document entries are removed.

type StoreSQLServer Uses

type StoreSQLServer struct {
    store.Context
    store.SearchStorer
}

StoreSQLServer provides data access to space information.

func (StoreSQLServer) DeleteContent Uses

func (s StoreSQLServer) DeleteContent(ctx domain.RequestContext, pageID string) (err error)

DeleteContent removes all search entries for specific document content.

func (StoreSQLServer) DeleteDocument Uses

func (s StoreSQLServer) DeleteDocument(ctx domain.RequestContext, ID string) (err error)

DeleteDocument removes all search entries for document.

func (StoreSQLServer) Documents Uses

func (s StoreSQLServer) Documents(ctx domain.RequestContext, q search.QueryOptions) (results []search.QueryResult, err error)

Documents searches the documents that the client is allowed to see, using the keywords search string, then audits that search. Visible documents include both those in the client's own organization and those that are public, or whose visibility includes the client.

func (StoreSQLServer) IndexContent Uses

func (s StoreSQLServer) IndexContent(ctx domain.RequestContext, p page.Page) (err error)

IndexContent adds search index entry for document context. Any existing document entries are removed.

func (StoreSQLServer) IndexDocument Uses

func (s StoreSQLServer) IndexDocument(ctx domain.RequestContext, doc doc.Document, a []attachment.Attachment) (err error)

IndexDocument adds search index entries for document inserting title, tags and attachments as searchable items. Any existing document entries are removed.

Package search imports 16 packages (graph) and is imported by 10 packages. Updated 2019-09-28. Refresh now. Tools for package owners.