es

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jul 16, 2018 License: MIT Imports: 30 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CollectionsScopeByContentUnit added in v0.7.7

func CollectionsScopeByContentUnit(mdb *sql.DB, cuUID string) ([]string, error)

func CollectionsScopeByFile added in v0.7.7

func CollectionsScopeByFile(mdb *sql.DB, fileUID string) ([]string, error)

func ConvertDocx

func ConvertDocx(db *sql.DB) error

func DocFolder added in v0.8.9

func DocFolder() (string, error)

func DownloadAndConvert added in v0.7.4

func DownloadAndConvert(docBatch [][]string) error

func DumpDB added in v0.7.7

func DumpDB(mdb *sql.DB, title string) error

func DumpIndexes added in v0.7.7

func DumpIndexes(esc *elastic.Client, title string, indexType string) error

func IndexName

func IndexName(namespace string, name string, lang string) string

func InitConfigFolder added in v0.8.9

func InitConfigFolder(configKey string, value *string) (string, error)

func InitVars added in v0.7.7

func InitVars()

func IsWindows added in v0.8.9

func IsWindows() bool

func LoadDocFilename added in v0.7.4

func LoadDocFilename(db *sql.DB, fileUID string) (string, error)

Will return empty string if no rows returned.

func ParseDocx

func ParseDocx(docxPath string) (string, error)

func SourcesFolder added in v0.8.9

func SourcesFolder() (string, error)

func TypedUIDsToUids added in v0.8.1

func TypedUIDsToUids(t string, typedUIDs []string) ([]string, error)

Types

type BaseIndex added in v0.6.7

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

func (*BaseIndex) CreateIndex added in v0.6.7

func (index *BaseIndex) CreateIndex() error

func (*BaseIndex) DeleteIndex added in v0.6.7

func (index *BaseIndex) DeleteIndex() error

func (*BaseIndex) RefreshIndex added in v0.6.7

func (index *BaseIndex) RefreshIndex() error

func (*BaseIndex) RefreshIndexByLang added in v0.6.7

func (index *BaseIndex) RefreshIndexByLang(lang string) error

type Classification

type Classification struct {
	MDB_UID            string `json:"mdb_uid"`
	Name               string `json:"name,omitempty"`
	NameSuggest        string `json:"name_suggest,omitempty"`
	Description        string `json:"description,omitempty"`
	DescriptionSuggest string `json:"description_suggest,omitempty"`
	Type               string `json:"classification_type"`
}

type ClassificationIntent added in v0.8.9

type ClassificationIntent struct {
	MDB_UID        string                    `json:"mdb_uid"`
	Name           string                    `json:"name"`
	ContentType    string                    `json:"content_type"`
	Exist          bool                      `json:"exist"`
	Score          *float64                  `json:"score,omitempty"`
	Explanation    elastic.SearchExplanation `json:"explanation,omitempty"`
	MaxScore       *float64                  `json:"max_score,omitempty"`
	MaxExplanation elastic.SearchExplanation `json:"max_explanation,omitempty"`
}

type ClassificationsIndex added in v0.6.7

type ClassificationsIndex struct {
	BaseIndex
}

func MakeClassificationsIndex added in v0.6.7

func MakeClassificationsIndex(namespace string, db *sql.DB, esc *elastic.Client) *ClassificationsIndex

func (*ClassificationsIndex) ReindexAll added in v0.6.7

func (index *ClassificationsIndex) ReindexAll() error

func (*ClassificationsIndex) Update added in v0.6.7

func (index *ClassificationsIndex) Update(scope Scope) error

type Collection

type Collection struct {
	MDB_UID                  string      `json:"mdb_uid"`
	TypedUIDs                []string    `json:"typed_uids"`
	Name                     string      `json:"name"`
	Description              string      `json:"description"`
	ContentType              string      `json:"content_type"`
	ContentUnitsContentTypes []string    `json:"content_units_content_types,omitempty"`
	EffectiveDate            *utils.Date `json:"effective_date"`
	OriginalLanguage         string      `json:"original_language,omitempty"`
}

type CollectionsIndex added in v0.6.7

type CollectionsIndex struct {
	BaseIndex
}

func MakeCollectionsIndex added in v0.6.9

func MakeCollectionsIndex(namespace string, db *sql.DB, esc *elastic.Client) *CollectionsIndex

func (*CollectionsIndex) ReindexAll added in v0.6.9

func (index *CollectionsIndex) ReindexAll() error

func (*CollectionsIndex) Update added in v0.6.9

func (index *CollectionsIndex) Update(scope Scope) error

type ContentUnit

type ContentUnit struct {
	MDB_UID                 string      `json:"mdb_uid"`
	TypedUIDs               []string    `json:"typed_uids"`
	Name                    string      `json:"name,omitempty"`
	Description             string      `json:"description,omitempty"`
	ContentType             string      `json:"content_type"`
	CollectionsContentTypes []string    `json:"collections_content_types,omitempty"`
	EffectiveDate           *utils.Date `json:"effective_date,omitempty"`
	Duration                uint64      `json:"duration,omitempty"`
	OriginalLanguage        string      `json:"original_language,omitempty"`
	Translations            []string    `json:"translations,omitempty"`
	Tags                    []string    `json:"tags,omitempty"`
	Sources                 []string    `json:"sources,omitempty"`
	Authors                 []string    `json:"authors,omitempty"`
	Persons                 []string    `json:"persons,omitempty"`
	Transcript              string      `json:"transcript,omitempty"`
}

type ContentUnitsIndex added in v0.6.7

type ContentUnitsIndex struct {
	BaseIndex
}

func MakeContentUnitsIndex added in v0.6.7

func MakeContentUnitsIndex(namespace string, db *sql.DB, esc *elastic.Client) *ContentUnitsIndex

func (*ContentUnitsIndex) ReindexAll added in v0.6.7

func (index *ContentUnitsIndex) ReindexAll() error

func (*ContentUnitsIndex) Update added in v0.6.7

func (index *ContentUnitsIndex) Update(scope Scope) error

type EffectiveDate added in v0.6.9

type EffectiveDate struct {
	EffectiveDate *utils.Date `json:"effective_date"`
}

type File

type File struct {
	MDB_UID  string      `json:"mdb_uid"`
	Name     string      `json:"name"`
	Size     uint64      `json:"size"`
	URL      string      `json:"url"`
	Secure   int         `json:"secure"`
	FilmDate *utils.Date `json:"film_date"`
	Duration float64     `json:"duration,omitempty"`
	Language string      `json:"language,omitempty"`
	MimeType string      `json:"mimetype,omitempty"`
	Type     string      `json:"type,omitempty"`
	SubType  string      `json:"subtype,omitempty"`
}

type Index added in v0.6.7

type Index interface {
	ReindexAll() error
	Update(scope Scope) error
	CreateIndex() error
	DeleteIndex() error
	RefreshIndex() error
}

type IndexData added in v0.6.7

type IndexData struct {
	DB           *sql.DB
	Sources      map[string][]string
	Tags         map[string][]string
	Persons      map[string][]string
	Translations map[string][][]string
	Transcripts  map[string]map[string][]string
}

func MakeIndexData added in v0.7.7

func MakeIndexData(db *sql.DB, sqlScope string) (*IndexData, error)

type Indexer added in v0.6.7

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

func MakeFakeIndexer added in v0.7.0

func MakeFakeIndexer(mdb *sql.DB, esc *elastic.Client) *Indexer

func MakeIndexer added in v0.6.7

func MakeIndexer(namespace string, names []string, mdb *sql.DB, esc *elastic.Client) *Indexer

Receives namespace and list of indexes names.

func MakeProdIndexer added in v0.6.7

func MakeProdIndexer(mdb *sql.DB, esc *elastic.Client) *Indexer

func (*Indexer) CollectionUpdate added in v0.6.7

func (indexer *Indexer) CollectionUpdate(uid string) error

Set of MDB event handlers to incrementally change all indexes.

func (*Indexer) ContentUnitUpdate added in v0.6.7

func (indexer *Indexer) ContentUnitUpdate(uid string) error

func (*Indexer) CreateIndexes added in v0.6.7

func (indexer *Indexer) CreateIndexes() error

func (*Indexer) DeleteIndexes added in v0.6.7

func (indexer *Indexer) DeleteIndexes() error

func (*Indexer) FileUpdate added in v0.6.7

func (indexer *Indexer) FileUpdate(uid string) error

func (*Indexer) PersonUpdate added in v0.6.7

func (indexer *Indexer) PersonUpdate(uid string) error

func (*Indexer) PublisherUpdate added in v0.6.7

func (indexer *Indexer) PublisherUpdate(uid string) error

func (*Indexer) RefreshAll added in v0.6.7

func (indexer *Indexer) RefreshAll() error

func (*Indexer) ReindexAll added in v0.6.7

func (indexer *Indexer) ReindexAll() error

func (*Indexer) SourceUpdate added in v0.6.7

func (indexer *Indexer) SourceUpdate(uid string) error

func (*Indexer) TagUpdate added in v0.6.7

func (indexer *Indexer) TagUpdate(uid string) error

type Scope added in v0.6.7

type Scope struct {
	ContentUnitUID string
	FileUID        string
	CollectionUID  string
	TagUID         string
	SourceUID      string
	PersonUID      string
	PublisherUID   string
}

type Source added in v0.8.9

type Source struct {
	MDB_UID     string   `json:"mdb_uid"`
	Name        string   `json:"name"`
	Description string   `json:"description"`
	Content     string   `json:"content"`
	Sources     []string `json:"sources"`
	Authors     []string `json:"authors"`
	PathNames   []string `json:"path_names"`
	FullName    []string `json:"full_name"`
}

type SourcesIndex added in v0.8.9

type SourcesIndex struct {
	BaseIndex
}

func MakeSourcesIndex added in v0.8.9

func MakeSourcesIndex(namespace string, db *sql.DB, esc *elastic.Client) *SourcesIndex

func (*SourcesIndex) ReindexAll added in v0.8.9

func (index *SourcesIndex) ReindexAll() error

func (*SourcesIndex) Update added in v0.8.9

func (index *SourcesIndex) Update(scope Scope) error

Jump to

Keyboard shortcuts

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