Documentation
¶
Index ¶
- Constants
- Variables
- func ItemsIngestPipeline(modelID string) opensearchapi.IngestPutPipelineReq
- type IndexConfig
- func (c *IndexConfig) InitIndex(ctx context.Context, osc *opensearch.Client) error
- func (c *IndexConfig) UpdateAlias(ctx context.Context, osc *opensearch.Client, aliasType string) error
- func (c *IndexConfig) UpdateIndex(ctx context.Context, osc *opensearch.Client) error
- func (c *IndexConfig) UpdateTemplates(ctx context.Context, osc *opensearch.Client) error
Constants ¶
const ( // FeedsIndex is the index containing [model.Feed] documents. FeedsIndex opensearch.Index = "feeds" // ItemsIndex is the index containing [models.Item] documents. ItemsIndex opensearch.Index = "items" // FavoritesIndex is the index containing [models.Article] that a user has favorited. FavoritesIndex opensearch.Index = "favorites" // UsersIndex is the index containing [model.User] documents. UsersIndex opensearch.Index = "users" // SubscriptionsIndex is the index containing [models.Subscription] documents. SubscriptionsIndex opensearch.Index = "subscriptions" // SchedulerIndex is the index containing data for scheduled jobs and job data. SchedulerIndex opensearch.Index = "scheduler" // SessionsIndex is the index containing user session data. SessionsIndex opensearch.Index = "sessions" // ImportsIndex is the index containing user import jobs data. ImportsIndex opensearch.Index = "imports" )
Variables ¶
var AllIndices = []opensearch.Index{ FeedsIndex, ItemsIndex, FavoritesIndex, UsersIndex, SubscriptionsIndex, SchedulerIndex, SessionsIndex, ImportsIndex, }
var ArticleFiltersMapping = indices.WithMapping("article_filters", indices.WithObjectMappingDynamic(opensearchapi.NewCommonMappingDynamicFromBool(false)), indices.WithObjectMappingProperties( indices.WithMapping("text", indices.WithKeywordIgnoreAbove(512), indices.WithKeywordDocValues(false), indices.WithKeywordIndex(false), ), indices.WithMapping("categories", indices.WithKeywordIgnoreAbove(512), indices.WithKeywordDocValues(false), indices.WithKeywordIndex(false), ), indices.WithMapping("authors", indices.WithKeywordIgnoreAbove(512), indices.WithKeywordDocValues(false), indices.WithKeywordIndex(false), ), ), )
ArticleFiltersMapping is a common mapping configuration for article filtering fields.
var CommonComponentTemplate = indices.NewComponentTemplateRequest("common", indices.WithIndexSettings( indices.WithMappings(CommonMappings), indices.WithAnalyzer(englishExactAnalyzer), indices.WithAnalyzer(personAnalyzer), indices.WithAnalyzer(htmlAnalyzer), indices.WithTokenizer(emailTokenizer), indices.WithNormalizer(lowercaseNormalizer), ), )
CommonComponentTemplate is a component template containing the common mappings.
var CommonMappings = indices.NewMappings( indices.WithMapping[opensearchapi.CommonMappingDateNanosProperty]("published"), indices.WithMapping[opensearchapi.CommonMappingDateNanosProperty]("updated"), indices.WithMapping("title", indices.WithTextMappingProperties( indices.WithMapping("exact", indices.WithTextMappingAnalyzer(englishExactAnalyzer), ), indices.WithMapping[opensearchapi.CommonMappingSearchAsYouTypeProperty]("search"), ), ), indices.WithMapping("description", indices.WithTextMappingAnalyzer(htmlAnalyzer)), indices.WithMapping("authors", indices.WithTextMappingAnalyzer(personAnalyzer), indices.WithTextMappingProperties( indices.WithMapping("raw", indices.WithKeywordIgnoreAbove(256)), indices.WithMapping("exact", indices.WithTextMappingAnalyzer(englishExactAnalyzer), ), indices.WithMapping[opensearchapi.CommonMappingSearchAsYouTypeProperty]("search"), ), ), indices.WithMapping("contributors", indices.WithTextMappingAnalyzer(personAnalyzer), indices.WithTextMappingProperties( indices.WithMapping("raw", indices.WithKeywordIgnoreAbove(256)), indices.WithMapping("exact", indices.WithTextMappingAnalyzer(englishExactAnalyzer), ), indices.WithMapping[opensearchapi.CommonMappingSearchAsYouTypeProperty]("search"), ), ), indices.WithMapping("categories", indices.WithTextMappingProperties( indices.WithMapping("raw", indices.WithKeywordIgnoreAbove(256), ), indices.WithMapping("raw_nocase", indices.WithKeywordMappingNormalizer(lowercaseNormalizer), indices.WithKeywordIgnoreAbove(256), ), indices.WithMapping("exact", indices.WithTextMappingAnalyzer(englishExactAnalyzer), ), indices.WithMapping[opensearchapi.CommonMappingSearchAsYouTypeProperty]("search"), ), ), indices.WithMapping("language", indices.WithKeywordIgnoreAbove(24)), indices.WithMapping[opensearchapi.CommonMappingTextProperty]("copyright"), indices.WithMapping("source_type", indices.WithKeywordIgnoreAbove(256)), indices.WithMapping("url", indices.WithKeywordIgnoreAbove(256)), ImageMapping, )
CommonMappings are field mappings common across [models.Item] and [models.Feed].
var FavoritesComponentTemplate = indices.NewComponentTemplateRequest(FavoritesIndex.String(), indices.WithIndexSettings( indices.WithMappings(FavoritesMappings), ), )
FavoritesComponentTemplate is a component template containing FavoritesMappings.
var FavoritesIndexTemplate = indices.NewIndexTemplateRequest(FavoritesIndex.String(), indices.WithComponentTemplates("common", ItemsIndex.String(), FavoritesIndex.String()), indices.WithIndexPatterns(FavoritesIndex.String()+"-*"), indices.WithIndexTemplatePriority(999), )
FavoritesIndexTemplate is a index template for user favorites of [models.Item].
var FavoritesMappings = indices.NewMappings( indices.WithMapping("subscription_id", indices.WithKeywordIgnoreAbove(32)), indices.WithMapping("user_id", indices.WithKeywordIgnoreAbove(32)), )
var FeedsComponentTemplate = indices.NewComponentTemplateRequest(FeedsIndex.String(), indices.WithIndexSettings( indices.WithMappings(FeedsMappings), indices.WithAnalyzer(englishExactAnalyzer), indices.WithAnalyzer(domainNameAnalyzer), indices.WithTokenizer(domainTokenizer), indices.WithAnalyzer(htmlAnalyzer), indices.WithTokenizer(emailTokenizer), ), )
FeedsComponentTemplate is a component template containing [FeedMappings].
var FeedsIndexTemplate = indices.NewIndexTemplateRequest(FeedsIndex.String(), indices.WithComponentTemplates("common", FeedsIndex.String()), indices.WithIndexPatterns(FeedsIndex.String()+"-*"), indices.WithIndexTemplatePriority(999), )
FeedsIndexTemplate is a index template for [models.Feed].
var FeedsMappings = indices.NewMappings( indices.WithMapping("feed_id", indices.WithKeywordIgnoreAbove(32)), indices.WithMapping[opensearchapi.CommonMappingDateNanosProperty]("created_at"), indices.WithMapping[opensearchapi.CommonMappingDateNanosProperty]("last_fetched"), indices.WithMapping[opensearchapi.CommonMappingUnsignedLongNumberProperty]("update_interval"), indices.WithMapping[opensearchapi.CommonMappingBooleanProperty]("updates_disabled"), indices.WithMapping("source_urls", indices.WithKeywordIgnoreAbove(256)), indices.WithMapping("fetch_method", indices.WithKeywordIgnoreAbove(24)), indices.WithMapping[opensearchapi.CommonMappingFlatObjectProperty]("fetch_options"), indices.WithMapping[opensearchapi.CommonMappingFlatObjectProperty]("quirks"), indices.WithMapping("domain", indices.WithTextMappingAnalyzer(domainNameAnalyzer), indices.WithTextMappingProperties( indices.WithMapping("raw", indices.WithKeywordIgnoreAbove(256)), indices.WithMapping[opensearchapi.CommonMappingSearchAsYouTypeProperty]("search"), ), ), indices.WithMapping[opensearchapi.CommonMappingFlatObjectProperty]("source_data"), indices.WithMapping("customisation", indices.WithObjectMappingDynamic(opensearchapi.NewCommonMappingDynamicFromBool(false)), indices.WithObjectMappingProperties( indices.WithMapping("title", indices.WithTextMappingProperties( indices.WithMapping("exact", indices.WithTextMappingAnalyzer(englishExactAnalyzer), ), indices.WithMapping[opensearchapi.CommonMappingSearchAsYouTypeProperty]("search"), ), ), indices.WithMapping("description", indices.WithTextMappingAnalyzer(htmlAnalyzer)), ), ), )
var ImageMapping = indices.WithMapping("image", indices.WithObjectMappingDynamic(opensearchapi.NewCommonMappingDynamicFromBool(false)), indices.WithObjectMappingProperties( indices.WithMapping("url", indices.WithKeywordIgnoreAbove(256)), indices.WithMapping[opensearchapi.CommonMappingTextProperty]("title"), ), )
ImageMapping is a common mapping configuration for an image.
var ImportsComponentTemplate = indices.NewComponentTemplateRequest(ImportsIndex.String(), indices.WithIndexSettings( indices.WithMappings(ImportsMappings), ), )
ImportsComponentTemplate is a component template containing ImportsMappings.
var ImportsIndexTemplate = indices.NewIndexTemplateRequest(ImportsIndex.String(), indices.WithComponentTemplates(ImportsIndex.String()), indices.WithIndexPatterns(ImportsIndex.String()+"-*"), indices.WithIndexTemplatePriority(999), )
ImportsIndexTemplate is a index template for [models.ImportStatus].
var ImportsMappings = indices.NewMappings( indices.WithMapping[opensearchapi.CommonMappingDateNanosProperty]("created_at"), indices.WithMapping[opensearchapi.CommonMappingDateNanosProperty]("updated_at"), indices.WithMapping("doc_type", indices.WithKeywordIgnoreAbove(32)), indices.WithMapping("job_id", indices.WithKeywordIgnoreAbove(32)), indices.WithMapping("user_id", indices.WithKeywordIgnoreAbove(32)), indices.WithMapping("status", indices.WithKeywordIgnoreAbove(24)), indices.WithMapping("error", indices.WithObjectMappingDynamic(opensearchapi.NewCommonMappingDynamicFromBool(false)), indices.WithObjectMappingProperties( indices.WithMapping[opensearchapi.CommonMappingTextProperty]("summary"), indices.WithMapping[opensearchapi.CommonMappingTextProperty]("details"), indices.WithMapping("status", indices.WithKeywordIgnoreAbove(24)), ), ), indices.WithMapping("requests", indices.WithObjectMappingDynamic(opensearchapi.NewCommonMappingDynamicFromBool(false)), indices.WithObjectMappingProperties( indices.WithMapping("url", indices.WithKeywordIgnoreAbove(256)), indices.WithMapping("categories", indices.WithKeywordIgnoreAbove(256)), ), ), indices.WithMapping("url", indices.WithKeywordIgnoreAbove(256)), indices.WithMapping("feed_id", indices.WithKeywordIgnoreAbove(32)), indices.WithMapping("subscription_id", indices.WithKeywordIgnoreAbove(32)), indices.WithMapping("categories", indices.WithKeywordIgnoreAbove(256)), )
var ItemsComponentTemplate = indices.NewComponentTemplateRequest(ItemsIndex.String(), indices.WithIndexSettings( indices.WithMappings(ItemsMappings), indices.WithAnalyzer(englishExactAnalyzer), indices.WithAnalyzer(htmlAnalyzer), indices.WithTokenizer(emailTokenizer), indices.WithReplicas("2"), indices.WithKNN(), ), )
ItemsComponentTemplate is a component template containing [ItemMappings].
var ItemsISM = opensearchapi.ISMPolicy{ ISMTemplate: new(opensearchapi.NewISMPolicyTemplateFromISMTemplate( opensearchapi.ISMTemplate{ IndexPatterns: []string{ItemsIndex.String() + "-*"}, Priority: new(100.0), }, )), States: []opensearchapi.ISMStates{ { Name: new("hot"), Actions: []opensearchapi.ISMAction{ {Rollover: &opensearchapi.ISMActionRollover{MinSize: new("10gb")}}, }, Transitions: []opensearchapi.ISMTransition{ {StateName: new("merge")}, }, }, { Name: new("merge"), Actions: []opensearchapi.ISMAction{ {ForceMerge: &opensearchapi.ISMActionForceMerge{MaxNumSegments: new(1)}}, }, }, }, }
var ItemsIndexTemplate = indices.NewIndexTemplateRequest(ItemsIndex.String(), indices.WithComponentTemplates("common", ItemsIndex.String()), indices.WithIndexPatterns(ItemsIndex.String()+"-*"), indices.WithIndexTemplatePriority(999), )
ItemsIndexTemplate is a index template for [models.Item].
var ItemsMappings = indices.NewMappings( indices.WithMapping[opensearchapi.CommonMappingDateNanosProperty]("@timestamp"), indices.WithMapping[opensearchapi.CommonMappingDateNanosProperty]("created"), indices.WithMapping("feed_id", indices.WithKeywordIgnoreAbove(32)), indices.WithMapping("item_id", indices.WithKeywordIgnoreAbove(32)), indices.WithMapping("feed_title", indices.WithTextMappingProperties( indices.WithMapping("exact", indices.WithTextMappingAnalyzer(englishExactAnalyzer), ), indices.WithMapping[opensearchapi.CommonMappingSearchAsYouTypeProperty]("search"), ), ), indices.WithMapping("content", indices.WithTextMappingAnalyzer(htmlAnalyzer), ), indices.WithMapping("extension_type", indices.WithKeywordIgnoreAbove(256)), indices.WithMapping[opensearchapi.CommonMappingFlatObjectProperty]("extension_data"), indices.WithMapping("geo", indices.WithObjectMappingDynamic(opensearchapi.NewCommonMappingDynamicFromBool(false)), indices.WithObjectMappingProperties( indices.WithMapping[opensearchapi.CommonMappingGeoPointProperty]("point"), ), ), indices.WithMapping("comments_url", indices.WithKeywordIgnoreAbove(256)), indices.WithMapping("comments_rss", indices.WithKeywordIgnoreAbove(256)), )
var SchedulerComponentTemplate = indices.NewComponentTemplateRequest(SchedulerIndex.String(), indices.WithIndexSettings( indices.WithMappings(SchedulerMappings), ), )
SchedulerComponentTemplate is a component template containing SchedulerMappings.
var SchedulerIndexTemplate = indices.NewIndexTemplateRequest(SchedulerIndex.String(), indices.WithComponentTemplates(SchedulerIndex.String()), indices.WithIndexPatterns(SchedulerIndex.String()+"-*"), indices.WithIndexTemplatePriority(999), )
SchedulerIndexTemplate is a index template for [models.Feed].
var SchedulerMappings = indices.NewMappings( indices.WithMapping[opensearchapi.CommonMappingDateNanosProperty]("created_at"), indices.WithMapping[opensearchapi.CommonMappingDateNanosProperty]("updated_at"), indices.WithMapping[opensearchapi.CommonMappingFlatObjectProperty]("job_options"), indices.WithMapping[opensearchapi.CommonMappingFlatObjectProperty]("job_data"), indices.WithMapping("job_type", indices.WithKeywordIgnoreAbove(128)), indices.WithMapping("job_key", indices.WithKeywordIgnoreAbove(128)), indices.WithMapping[opensearchapi.CommonMappingTextProperty]("job_description"), indices.WithMapping("job_trigger_type", indices.WithKeywordIgnoreAbove(128)), indices.WithMapping[opensearchapi.CommonMappingFlatObjectProperty]("job_trigger"), indices.WithMapping[opensearchapi.CommonMappingDateNanosProperty]("job_next_run"), )
SchedulerMappings is the field mappings for [models.Session].
var SessionsComponentTemplate = indices.NewComponentTemplateRequest(SessionsIndex.String(), indices.WithIndexSettings( indices.WithMappings(SessionsMappings), indices.WithReplicas("2"), ), )
SessionsComponentTemplate is a component template containing SchedulerMappings.
var SessionsIndexTemplate = indices.NewIndexTemplateRequest(SessionsIndex.String(), indices.WithComponentTemplates(SessionsIndex.String()), indices.WithIndexPatterns(SessionsIndex.String()+"-*"), indices.WithIndexTemplatePriority(999), )
SessionsIndexTemplate is a index template for [models.Feed].
var SessionsMappings = indices.NewMappings( indices.WithMapping[opensearchapi.CommonMappingDateNanosProperty]("created_at"), indices.WithMapping[opensearchapi.CommonMappingDateNanosProperty]("expiry"), indices.WithMapping("token", indices.WithKeywordIgnoreAbove(128)), indices.WithMapping[opensearchapi.CommonMappingBinaryProperty]("data"), )
SessionsMappings is the field mappings for [models.Session].
var SubscriptionsComponentTemplate = indices.NewComponentTemplateRequest(SubscriptionsIndex.String(), indices.WithIndexSettings( indices.WithMappings(SubscriptionsMappings), indices.WithAnalyzer(englishExactAnalyzer), indices.WithAnalyzer(htmlAnalyzer), indices.WithTokenizer(emailTokenizer), ), )
SubscriptionsComponentTemplate is a component template containing SubscriptionsMappings.
var SubscriptionsIndexTemplate = indices.NewIndexTemplateRequest(SubscriptionsIndex.String(), indices.WithComponentTemplates(SubscriptionsIndex.String()), indices.WithIndexPatterns(SubscriptionsIndex.String()+"-*"), indices.WithIndexTemplatePriority(999), )
SubscriptionsIndexTemplate is a index template for [models.Subscription].
var SubscriptionsMappings = indices.NewMappings( indices.WithMapping("subscription_id", indices.WithKeywordIgnoreAbove(32)), indices.WithMapping("user_id", indices.WithKeywordIgnoreAbove(32)), indices.WithMapping("type", indices.WithKeywordIgnoreAbove(24)), indices.WithMapping[opensearchapi.CommonMappingBooleanProperty]("favorite"), indices.WithMapping[opensearchapi.CommonMappingDateNanosProperty]("created_at"), indices.WithMapping[opensearchapi.CommonMappingDateNanosProperty]("updated_at"), indices.WithMapping[opensearchapi.CommonMappingDateNanosProperty]("marked_read_at"), indices.WithMapping("customisation", indices.WithObjectMappingDynamic(opensearchapi.NewCommonMappingDynamicFromBool(false)), indices.WithObjectMappingProperties( indices.WithMapping("nickname", indices.WithTextMappingProperties( indices.WithMapping("exact", indices.WithTextMappingAnalyzer(englishExactAnalyzer), ), indices.WithMapping[opensearchapi.CommonMappingSearchAsYouTypeProperty]("search"), ), ), indices.WithMapping("categories", indices.WithTextMappingProperties( indices.WithMapping("exact", indices.WithTextMappingAnalyzer(englishExactAnalyzer), ), indices.WithMapping[opensearchapi.CommonMappingSearchAsYouTypeProperty]("search"), ), ), indices.WithMapping("image_url", indices.WithKeywordIgnoreAbove(256)), ), ), indices.WithMapping[opensearchapi.CommonMappingFlatObjectProperty]("settings"), indices.WithMapping("feed_data", indices.WithObjectMappingDynamic(opensearchapi.NewCommonMappingDynamicFromBool(false)), indices.WithObjectMappingProperties( indices.WithMapping("feed_id", indices.WithKeywordIgnoreAbove(32)), indices.WithMapping[opensearchapi.CommonMappingFlatObjectProperty]("article_states"), ArticleFiltersMapping, ), ), indices.WithMapping("group_data", indices.WithObjectMappingDynamic(opensearchapi.NewCommonMappingDynamicFromBool(false)), indices.WithObjectMappingProperties( indices.WithMapping("subscriptions", indices.WithKeywordIgnoreAbove(32)), indices.WithMapping("metadata", indices.WithObjectMappingDynamic(opensearchapi.NewCommonMappingDynamicFromBool(false)), indices.WithObjectMappingProperties( indices.WithMapping("feed_id", indices.WithKeywordIgnoreAbove(32)), indices.WithMapping("subscription_id", indices.WithKeywordIgnoreAbove(32)), ), ), ArticleFiltersMapping, ), ), indices.WithMapping("email_data", indices.WithObjectMappingDynamic(opensearchapi.NewCommonMappingDynamicFromBool(false)), indices.WithObjectMappingProperties( indices.WithMapping("feed_id", indices.WithKeywordIgnoreAbove(32)), indices.WithMapping("email_sender_id", indices.WithKeywordIgnoreAbove(256)), indices.WithMapping[opensearchapi.CommonMappingFlatObjectProperty]("article_states"), ArticleFiltersMapping, ), ), indices.WithMapping[opensearchapi.CommonMappingFlatObjectProperty]("search_data"), )
var UsersComponentTemplate = indices.NewComponentTemplateRequest(UsersIndex.String(), indices.WithIndexSettings( indices.WithMappings(UsersMappings), indices.WithReplicas("2"), ), )
UsersComponentTemplate is a component template containing UsersMappings.
var UsersIndexTemplate = indices.NewIndexTemplateRequest(UsersIndex.String(), indices.WithComponentTemplates(UsersIndex.String()), indices.WithIndexPatterns(UsersIndex.String()+"-*"), indices.WithIndexTemplatePriority(999), )
UsersIndexTemplate is a index template for [models.User].
var UsersMappings = indices.NewMappings( indices.WithMapping("user_id", indices.WithKeywordIgnoreAbove(32)), indices.WithMapping("nickname", indices.WithKeywordIgnoreAbove(128)), indices.WithMapping("avatar_url", indices.WithKeywordIgnoreAbove(256)), indices.WithMapping("external_user_id", indices.WithKeywordIgnoreAbove(64)), indices.WithMapping("email", indices.WithKeywordIgnoreAbove(128)), indices.WithMapping("provider", indices.WithKeywordIgnoreAbove(32)), indices.WithMapping("level", indices.WithKeywordIgnoreAbove(32)), indices.WithMapping[opensearchapi.CommonMappingDateNanosProperty]("created_at"), indices.WithMapping[opensearchapi.CommonMappingDateNanosProperty]("updated_at"), indices.WithMapping[opensearchapi.CommonMappingDateNanosProperty]("last_login"), indices.WithMapping[opensearchapi.CommonMappingUnsignedLongNumberProperty]("login_count"), indices.WithMapping("max_history", indices.WithKeywordIgnoreAbove(32)), indices.WithMapping[opensearchapi.CommonMappingFlatObjectProperty]("settings"), indices.WithMapping("subscription_type", indices.WithKeywordIgnoreAbove(32)), indices.WithMapping[opensearchapi.CommonMappingFlatObjectProperty]("subscription"), indices.WithMapping("customisation", indices.WithObjectMappingDynamic(opensearchapi.NewCommonMappingDynamicFromBool(false)), indices.WithObjectMappingProperties( indices.WithMapping[opensearchapi.CommonMappingBooleanProperty]("blocked"), indices.WithMapping[opensearchapi.CommonMappingBooleanProperty]("email_verified"), indices.WithMapping[opensearchapi.CommonMappingBooleanProperty]("policies_accepted"), indices.WithMapping[opensearchapi.CommonMappingBooleanProperty]("pending_deletion"), indices.WithMapping("susbcription_limit", indices.WithObjectMappingDynamic(opensearchapi.NewCommonMappingDynamicFromBool(false)), indices.WithObjectMappingProperties( indices.WithMapping[opensearchapi.CommonMappingBooleanProperty]("exceeded"), indices.WithMapping[opensearchapi.CommonMappingDateNanosProperty]("timestamp"), ), ), indices.WithMapping("newsletter_limit", indices.WithObjectMappingDynamic(opensearchapi.NewCommonMappingDynamicFromBool(false)), indices.WithObjectMappingProperties( indices.WithMapping[opensearchapi.CommonMappingBooleanProperty]("exceeded"), indices.WithMapping[opensearchapi.CommonMappingDateNanosProperty]("timestamp"), ), ), ), ), indices.WithMapping("item_favorites", indices.WithKeywordIgnoreAbove(32)), )
UsersMappings is the field mappings for [models.User].
Functions ¶
func ItemsIngestPipeline ¶ added in v0.260.0
func ItemsIngestPipeline(modelID string) opensearchapi.IngestPutPipelineReq
ItemsIngestPipeline defines an ingest pipeline for processing [models.Item] before indexing.
Types ¶
type IndexConfig ¶ added in v0.261.0
type IndexConfig struct {
// Name is the canonical name of the index.
Name string
// IndexTemplate is an index template for the index.
IndexTemplate opensearchapi.IndicesPutIndexTemplateReq
// ComponentTemplate is a component template for the index.
ComponentTemplate opensearchapi.ClusterPutComponentTemplateReq
// ReadAlias is the read-only index alias.
ReadAlias string
// WriteAlias is the read-write index alias.
WriteAlias string
// contains filtered or unexported fields
}
func NewIndexConfig ¶ added in v0.261.0
func NewIndexConfig(osc *opensearch.Client, index opensearch.Index) (IndexConfig, error)
NewIndexConfig generates an IndexConfig for the given opensearch.Index. This includes the appropriate canonical index name, index/component templates and read/write aliases for the index.
func (*IndexConfig) InitIndex ¶ added in v0.261.0
func (c *IndexConfig) InitIndex(ctx context.Context, osc *opensearch.Client) error
InitIndex will ensure all index templates and aliases exist and creates a new index ready for use.
func (*IndexConfig) UpdateAlias ¶ added in v0.261.0
func (c *IndexConfig) UpdateAlias(ctx context.Context, osc *opensearch.Client, aliasType string) error
UpdateAlias will update the read/write aliases for an index.
func (*IndexConfig) UpdateIndex ¶ added in v0.261.0
func (c *IndexConfig) UpdateIndex(ctx context.Context, osc *opensearch.Client) error
UpdateIndex will update all templates for an index.
func (*IndexConfig) UpdateTemplates ¶ added in v0.261.0
func (c *IndexConfig) UpdateTemplates(ctx context.Context, osc *opensearch.Client) error
UpdateTemplates will update the index and component templates for an index, and performs any index-specific configuration.