Documentation
¶
Index ¶
- Constants
- func AliasedIndex(esc *elastic.Client, alias string, aliasRegexp string) (error, string)
- func CollectionsScopeByContentUnit(mdb *sql.DB, cuUID string) ([]string, error)
- func CollectionsScopeByFile(mdb *sql.DB, fileUID string) ([]string, error)
- func ConcateFirstToLast(strings []string) string
- func ConvertDocx(db *sql.DB) error
- func DocText(uid string) (string, error)
- func DumpDB(mdb *sql.DB, title string) error
- func DumpIndexes(esc *elastic.Client, title string, resultType string) error
- func IndexName(namespace string, name string, lang string, date string) string
- func IndexNameForServing(namespace string, name string, lang string) string
- func InitConfigFolder(configKey string, value *string) (string, error)
- func InitVars()
- func IsWindows() bool
- func KeyIValues(t string, uids []string) []interface{}
- func KeyValue(t string, uid string) string
- func KeyValues(t string, uids []string) []string
- func KeyValuesToValues(t string, typedUIDs []string) ([]string, error)
- func ParseDocx(docxPath string) (string, error)
- func Prepare(uids []string) (error, bool, map[string]int)
- func ProdIndexDate(esc *elastic.Client) (error, string)
- func SourcesFolder() (string, error)
- func Suffixes(escapedTitle string) []string
- func SwitchAlias(alias string, prev string, next string, esc *elastic.Client) error
- func SwitchAliasToCurrentIndex(namespace string, name string, date string, esc *elastic.Client) error
- func SwitchProdAliasToCurrentIndex(date string, esc *elastic.Client) error
- func SynonymsFolder() (string, error)
- func Unique(s []string) []string
- func UpdateSynonyms(esc *elastic.Client, indexNameByLang IndexNameByLang) error
- type BaseIndex
- func (index *BaseIndex) CreateIndex() error
- func (index *BaseIndex) DeleteIndex() error
- func (index *BaseIndex) FilterByResultTypeQuery(resultType string) *elastic.BoolQuery
- func (index *BaseIndex) IndexDate() string
- func (index *BaseIndex) IndexName(lang string) string
- func (index *BaseIndex) Namespace() string
- func (index *BaseIndex) RefreshIndex() error
- func (index *BaseIndex) RefreshIndexByLang(lang string) error
- func (index *BaseIndex) RemoveFromIndexQuery(elasticScope elastic.Query) (map[string][]string, *IndexErrors)
- func (index *BaseIndex) ResultType() string
- func (index *BaseIndex) Scroll(indexName string, elasticScope elastic.Query) ([]ScrollResult, error)
- type BlogIndex
- type CollectionsIndex
- type ContentUnitsIndex
- type DocumentError
- type EffectiveDate
- type Index
- type IndexData
- type IndexErrors
- func (indexErrors *IndexErrors) CheckErrors(languagesMaxFailure int, documentsMaxFailure float32, index string) error
- func (indexErrors *IndexErrors) DocumentError(language string, e error, info string) *IndexErrors
- func (indexErrors *IndexErrors) DocumentErrorCount(language string, e error, info string, count int) *IndexErrors
- func (indexErrors *IndexErrors) FailedLanguages() string
- func (indexErrors *IndexErrors) Indexed(lang string) *IndexErrors
- func (indexErrors *IndexErrors) Join(other *IndexErrors, info string) *IndexErrors
- func (indexErrors *IndexErrors) LanguageError(language string, e error, info string) *IndexErrors
- func (indexErrors *IndexErrors) LanguagesError() error
- func (indexErrors *IndexErrors) PrintDocumentsErrors(info string)
- func (indexErrors *IndexErrors) PrintIndexCounts(index string)
- func (indexErrors *IndexErrors) PrintLanguageErrors(info string)
- func (indexErrors *IndexErrors) SetError(err error) *IndexErrors
- func (indexErrors *IndexErrors) ShouldIndex(lang string) *IndexErrors
- func (indexErrors *IndexErrors) Wrap(info string) *IndexErrors
- type IndexNameByLang
- type Indexer
- func (indexer *Indexer) BlogPostUpdate(id string) error
- func (indexer *Indexer) CollectionUpdate(uid string) error
- func (indexer *Indexer) ContentUnitUpdate(uid string) error
- func (indexer *Indexer) CreateIndexes() error
- func (indexer *Indexer) DeleteIndexes() error
- func (indexer *Indexer) FileUpdate(uid string) error
- func (indexer *Indexer) PersonUpdate(uid string) error
- func (indexer *Indexer) PublisherUpdate(uid string) error
- func (indexer *Indexer) RefreshAll() error
- func (indexer *Indexer) ReindexAll(esc *elastic.Client) error
- func (indexer *Indexer) SourceUpdate(uid string) error
- func (indexer *Indexer) TagUpdate(uid string) error
- func (indexer *Indexer) TweetUpdate(tid string) error
- func (indexer *Indexer) Update(scope Scope) error
- type MdbUid
- type OffsetLimitJob
- type Result
- type ResultType
- type Scope
- type ScrollResult
- type SourcesIndex
- type SuggestField
- type TagsIndex
- type TweeterIndex
Constants ¶
View Source
const ( LANGUAGES_MAX_FAILURE = 3 DOCUMENT_MAX_FAILIRE_RATIO = 0.1 )
Variables ¶
This section is empty.
Functions ¶
func AliasedIndex ¶ added in v1.6.8
func CollectionsScopeByContentUnit ¶ added in v0.7.7
func CollectionsScopeByFile ¶ added in v0.7.7
func ConcateFirstToLast ¶ added in v1.6.8
func ConvertDocx ¶
func DumpIndexes ¶ added in v0.7.7
func IndexNameForServing ¶ added in v1.4.9
func InitConfigFolder ¶ added in v0.8.9
func KeyIValues ¶ added in v1.0.5
func KeyValuesToValues ¶ added in v1.0.5
func ProdIndexDate ¶ added in v1.6.8
func SourcesFolder ¶ added in v0.8.9
func SwitchAlias ¶ added in v1.6.8
func SwitchAliasToCurrentIndex ¶ added in v1.0.5
func SwitchProdAliasToCurrentIndex ¶ added in v1.0.5
func SynonymsFolder ¶ added in v1.4.9
func UpdateSynonyms ¶ added in v1.5.4
func UpdateSynonyms(esc *elastic.Client, indexNameByLang IndexNameByLang) 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 (*BaseIndex) DeleteIndex ¶ added in v0.6.7
func (*BaseIndex) FilterByResultTypeQuery ¶ added in v1.0.5
func (*BaseIndex) RefreshIndex ¶ added in v0.6.7
func (*BaseIndex) RefreshIndexByLang ¶ added in v0.6.7
func (*BaseIndex) RemoveFromIndexQuery ¶ added in v1.0.5
func (index *BaseIndex) RemoveFromIndexQuery(elasticScope elastic.Query) (map[string][]string, *IndexErrors)
func (*BaseIndex) ResultType ¶ added in v1.0.5
type BlogIndex ¶ added in v1.1.8
func MakeBlogIndex ¶ added in v1.1.8
func (*BlogIndex) AddToIndex ¶ added in v1.3.4
func (*BlogIndex) ReindexAll ¶ added in v1.1.8
type CollectionsIndex ¶ added in v0.6.7
type CollectionsIndex struct {
BaseIndex
}
func MakeCollectionsIndex ¶ added in v0.6.9
func MakeCollectionsIndex(namespace string, indexDate string, db *sql.DB, esc *elastic.Client) *CollectionsIndex
func (*CollectionsIndex) AddToIndex ¶ added in v1.3.4
func (index *CollectionsIndex) AddToIndex(scope Scope, removedUIDs []string) error
func (*CollectionsIndex) ReindexAll ¶ added in v0.6.9
func (index *CollectionsIndex) ReindexAll() error
func (*CollectionsIndex) RemoveFromIndex ¶ added in v1.3.4
func (index *CollectionsIndex) RemoveFromIndex(scope Scope) (map[string][]string, error)
type ContentUnitsIndex ¶ added in v0.6.7
func MakeContentUnitsIndex ¶ added in v0.6.7
func MakeContentUnitsIndex(namespace string, indexDate string, db *sql.DB, esc *elastic.Client) *ContentUnitsIndex
func (*ContentUnitsIndex) AddToIndex ¶ added in v1.3.4
func (index *ContentUnitsIndex) AddToIndex(scope Scope, removedUIDs []string) error
func (*ContentUnitsIndex) ReindexAll ¶ added in v0.6.7
func (index *ContentUnitsIndex) ReindexAll() error
func (*ContentUnitsIndex) RemoveFromIndex ¶ added in v1.3.4
func (index *ContentUnitsIndex) RemoveFromIndex(scope Scope) (map[string][]string, error)
type DocumentError ¶ added in v1.3.4
type EffectiveDate ¶ added in v0.6.9
type Index ¶ added in v0.6.7
type Index interface { ReindexAll() error RemoveFromIndex(scope Scope) (map[string][]string, error) AddToIndex(scope Scope, removedUIDs []string) error CreateIndex() error DeleteIndex() error RefreshIndex() error ResultType() string IndexName(language string) string IndexDate() string Namespace() string }
type IndexData ¶ added in v0.6.7
type IndexErrors ¶ added in v1.3.4
type IndexErrors struct { Error error LanguageErrors map[string][]error DocumentsCount map[string]int DocumentsErrors map[string][]DocumentError ShouldIndexCount map[string]int IndexedCount map[string]int }
func MakeIndexErrors ¶ added in v1.3.4
func MakeIndexErrors() *IndexErrors
func (*IndexErrors) CheckErrors ¶ added in v1.3.4
func (indexErrors *IndexErrors) CheckErrors(languagesMaxFailure int, documentsMaxFailure float32, index string) error
func (*IndexErrors) DocumentError ¶ added in v1.3.4
func (indexErrors *IndexErrors) DocumentError(language string, e error, info string) *IndexErrors
func (*IndexErrors) DocumentErrorCount ¶ added in v1.3.4
func (indexErrors *IndexErrors) DocumentErrorCount(language string, e error, info string, count int) *IndexErrors
func (*IndexErrors) FailedLanguages ¶ added in v1.3.4
func (indexErrors *IndexErrors) FailedLanguages() string
func (*IndexErrors) Indexed ¶ added in v1.3.6
func (indexErrors *IndexErrors) Indexed(lang string) *IndexErrors
func (*IndexErrors) Join ¶ added in v1.3.4
func (indexErrors *IndexErrors) Join(other *IndexErrors, info string) *IndexErrors
func (*IndexErrors) LanguageError ¶ added in v1.3.4
func (indexErrors *IndexErrors) LanguageError(language string, e error, info string) *IndexErrors
func (*IndexErrors) LanguagesError ¶ added in v1.3.4
func (indexErrors *IndexErrors) LanguagesError() error
func (*IndexErrors) PrintDocumentsErrors ¶ added in v1.3.4
func (indexErrors *IndexErrors) PrintDocumentsErrors(info string)
func (*IndexErrors) PrintIndexCounts ¶ added in v1.3.6
func (indexErrors *IndexErrors) PrintIndexCounts(index string)
func (*IndexErrors) PrintLanguageErrors ¶ added in v1.3.4
func (indexErrors *IndexErrors) PrintLanguageErrors(info string)
func (*IndexErrors) SetError ¶ added in v1.3.4
func (indexErrors *IndexErrors) SetError(err error) *IndexErrors
func (*IndexErrors) ShouldIndex ¶ added in v1.3.6
func (indexErrors *IndexErrors) ShouldIndex(lang string) *IndexErrors
func (*IndexErrors) Wrap ¶ added in v1.3.4
func (indexErrors *IndexErrors) Wrap(info string) *IndexErrors
type IndexNameByLang ¶ added in v1.6.6
func IndexNameFuncByNamespaceAndDate ¶ added in v1.6.6
func IndexNameFuncByNamespaceAndDate(namespace string, indexDate string) IndexNameByLang
type Indexer ¶ added in v0.6.7
type Indexer struct {
// contains filtered or unexported fields
}
func MakeFakeIndexer ¶ added in v0.7.0
func MakeIndexer ¶ added in v0.6.7
func MakeIndexer(namespace string, date string, names []string, mdb *sql.DB, esc *elastic.Client) (*Indexer, error)
Receives namespace and list of indexes names.
func MakeProdIndexer ¶ added in v0.6.7
func (*Indexer) BlogPostUpdate ¶ added in v1.1.8
func (*Indexer) CollectionUpdate ¶ added in v0.6.7
Set of MDB event handlers to incrementally change all indexes.
func (*Indexer) ContentUnitUpdate ¶ added in v0.6.7
func (*Indexer) CreateIndexes ¶ added in v0.6.7
func (*Indexer) DeleteIndexes ¶ added in v0.6.7
func (*Indexer) FileUpdate ¶ added in v0.6.7
func (*Indexer) PersonUpdate ¶ added in v0.6.7
func (*Indexer) PublisherUpdate ¶ added in v0.6.7
func (*Indexer) RefreshAll ¶ added in v0.6.7
func (*Indexer) ReindexAll ¶ added in v0.6.7
func (*Indexer) SourceUpdate ¶ added in v0.6.7
func (*Indexer) TweetUpdate ¶ added in v1.1.8
type OffsetLimitJob ¶ added in v1.0.5
type Result ¶ added in v1.0.5
type Result struct { // Document type. ResultType string `json:"result_type"` IndexDate *utils.Date `json:"index_date,omitempty"` MDB_UID string `json:"mdb_uid"` TypedUids []string `json:"typed_uids"` FilterValues []string `json:"filter_values"` // Result content fields. Title string `json:"title"` FullTitle string `json:"full_title"` Description string `json:"description,omitempty"` Content string `json:"content,omitempty"` EffectiveDate *utils.Date `json:"effective_date,omitempty"` // Suggest field for autocomplete. TitleSuggest SuggestField `json:"title_suggest"` }
For full description see make.py RESULTS TEMPLATE.
func (*Result) ToDebugString ¶ added in v1.1.3
type ResultType ¶ added in v1.0.5
type ResultType struct {
ResultType string `json:"result_type"`
}
type ScrollResult ¶ added in v1.3.4
type SourcesIndex ¶ added in v0.8.9
func MakeSourcesIndex ¶ added in v0.8.9
func MakeSourcesIndex(namespace string, indexDate string, db *sql.DB, esc *elastic.Client) *SourcesIndex
func (*SourcesIndex) AddToIndex ¶ added in v1.3.4
func (index *SourcesIndex) AddToIndex(scope Scope, removedUIDs []string) error
func (*SourcesIndex) ReindexAll ¶ added in v0.8.9
func (index *SourcesIndex) ReindexAll() error
func (*SourcesIndex) RemoveFromIndex ¶ added in v1.3.4
func (index *SourcesIndex) RemoveFromIndex(scope Scope) (map[string][]string, error)
type SuggestField ¶ added in v1.6.8
type TagsIndex ¶ added in v1.0.5
type TagsIndex struct {
BaseIndex
}
func MakeTagsIndex ¶ added in v1.0.5
func (*TagsIndex) AddToIndex ¶ added in v1.3.4
func (*TagsIndex) ReindexAll ¶ added in v1.0.5
type TweeterIndex ¶ added in v1.1.8
func MakeTweeterIndex ¶ added in v1.1.8
func MakeTweeterIndex(namespace string, indexDate string, db *sql.DB, esc *elastic.Client) *TweeterIndex
func (*TweeterIndex) AddToIndex ¶ added in v1.3.4
func (index *TweeterIndex) AddToIndex(scope Scope, removedUIDs []string) error
func (*TweeterIndex) ReindexAll ¶ added in v1.1.8
func (index *TweeterIndex) ReindexAll() error
func (*TweeterIndex) RemoveFromIndex ¶ added in v1.3.4
func (index *TweeterIndex) RemoveFromIndex(scope Scope) (map[string][]string, error)
Click to show internal directories.
Click to hide internal directories.