index

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Nov 5, 2026 License: Apache-2.0 Imports: 25 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddOrRemoveESAlias

func AddOrRemoveESAlias(c zhttp.Context)

@Id AddOrRemoveESAlias @Summary Add or remove index alias for compatible ES @security BasicAuth @Tags Index @Produce json @Success 200 {object} map[string]interface{} @Failure 400 {object} meta.HTTPResponseError @Router /es/_aliases [post]

func Analyze

func Analyze(c zhttp.Context)

@Id Analyze @Summary Analyze @security BasicAuth @Tags Index @Accept json @Produce json @Param query body object true "Query" @Success 200 {object} AnalyzeResponse @Failure 400 {object} meta.HTTPResponseError @Router /api/_analyze [post]

func AnalyzeIndexForSDK

func AnalyzeIndexForSDK()

@Id AnalyzeIndex @Summary Analyze @security BasicAuth @Tags Index @Accept json @Produce json @Param index path string true "Index" @Param query body object true "Query" @Success 200 {object} AnalyzeResponse @Failure 400 {object} meta.HTTPResponseError @Router /api/{index}/_analyze [post]

func Create

func Create(c zhttp.Context)

@Id CreateIndex @Summary Create index @security BasicAuth @Tags Index @Accept json @Produce json @Param data body meta.IndexSimple true "Index data" @Success 200 {object} meta.HTTPResponseIndex @Failure 400 {object} meta.HTTPResponseError @Router /api/index [post]

func CreateES

func CreateES(c zhttp.Context)

@Id ESCreateIndex @Summary Create index for compatible ES @security BasicAuth @Tags Index @Produce json @Param index path string true "Index" @Param data body meta.IndexSimple true "Index data" @Success 200 {object} map[string]interface{} @Failure 400 {object} meta.HTTPResponse @Router /es/{index} [put]

func CreateIndexWorker

func CreateIndexWorker(newIndex *meta.IndexSimple, indexName string) error

func CreateTemplate

func CreateTemplate(c zhttp.Context)

@Id CreateTemplate @Summary Create update index template @security BasicAuth @Tags Index @Accept json @Produce json @Param template body meta.IndexTemplate true "Template data" @Success 200 {object} meta.HTTPResponseTemplate @Failure 400 {object} meta.HTTPResponseError @Router /es/_index_template [post]

func Delete

func Delete(c zhttp.Context)

Delete deletes a zed index and its associated data. Be careful using thus as you ca't undo this action.

@Id DeleteIndex @Summary Delete index @security BasicAuth @Tags Index @Produce json @Param index path string true "Index" @Success 200 {object} meta.HTTPResponseIndex @Failure 400 {object} meta.HTTPResponseError @Failure 500 {object} meta.HTTPResponseError @Router /api/index/{index} [delete]

func DeleteILMPolicy

func DeleteILMPolicy(c zhttp.Context)

@Id DeleteILMPolicy @Summary Delete an index lifecycle policy @security BasicAuth @Tags Index @Produce json @Param name path string true "Policy" @Success 200 {object} meta.HTTPResponse @Failure 500 {object} meta.HTTPResponseError @Router /es/_ilm/policy/{name} [delete]

func DeleteTemplate

func DeleteTemplate(c zhttp.Context)

@Id DeleteTemplate @Summary Delete template @security BasicAuth @Tags Index @Produce json @Param name path string true "Template" @Success 200 {object} meta.HTTPResponse @Failure 400 {object} meta.HTTPResponseError @Router /es/_index_template/{name} [delete]

func ESExists

func ESExists()

@Id EsExists @Summary Checks if the index exists for compatible ES @security BasicAuth @Tags Index @Produce json @Param index path string true "Index" @Success 200 {object} meta.HTTPResponse @Failure 404 {object} meta.HTTPResponse @Router /es/{index} [head]

func Exists

func Exists(c zhttp.Context)

@Id Exists @Summary Checks if the index exists @security BasicAuth @Tags Index @Produce json @Param index path string true "Index" @Success 200 {object} meta.HTTPResponse @Failure 404 {object} meta.HTTPResponse @Router /api/index/{index} [head]

func ExplainILM

func ExplainILM(c zhttp.Context)

@Id ExplainILM @Summary Explain the lifecycle state of an index @security BasicAuth @Tags Index @Produce json @Param index path string true "Index" @Success 200 {object} map[string]interface{} @Failure 400 {object} meta.HTTPResponseError @Router /es/{index}/_ilm/explain [get]

func FieldCaps

func FieldCaps(c zhttp.Context)

FieldCaps returns the capabilities of the fields of the given indexes

@Id FieldCaps @Summary Get field capabilities for compatible ES @security BasicAuth @Tags Index @Accept json @Produce json @Param index path string true "Index" @Param fields query string false "Field patterns, comma separated" @Success 200 {object} elastic.FieldCapsResponse @Failure 400 {object} meta.HTTPResponseError @Router /es/{index}/_field_caps [post]

func Get

func Get(c zhttp.Context)

@Id GetIndex @Summary Get index metadata @security BasicAuth @Tags Index @Produce json @Param index path string true "Index" @Success 200 {object} core.Index @Failure 404 {object} meta.HTTPResponseError @Router /api/index/{index} [get]

func GetESAliases

func GetESAliases(c zhttp.Context)

@Id GetESAliases @Summary Get index alias for compatible ES @security BasicAuth @Tags Index @Produce json @Param target path string false "Target Index" @Param target_alias path string false "Target Alias" @Success 200 {object} map[string]interface{} @Failure 400 {object} meta.HTTPResponseError @Router /es/{target}/_alias/{target_alias} [get]

func GetESMapping

func GetESMapping(c zhttp.Context)

@Id ESGetMapping @Summary Get index mappings for compatible ES @security BasicAuth @Tags Index @Produce json @Param index path string true "Index" @Success 200 {object} map[string]interface{} @Failure 400 {object} meta.HTTPResponse @Router /es/{index}/_mapping [get]

func GetILMPolicy

func GetILMPolicy(c zhttp.Context)

@Id GetILMPolicy @Summary Get an index lifecycle policy @security BasicAuth @Tags Index @Produce json @Param name path string true "Policy" @Success 200 {object} map[string]interface{} @Failure 404 {object} meta.HTTPResponseError @Router /es/_ilm/policy/{name} [get]

func GetMapping

func GetMapping(c zhttp.Context)

@Id GetMapping @Summary Get index mappings @security BasicAuth @Tags Index @Produce json @Param index path string true "Index" @Success 200 {object} map[string]interface{} @Failure 400 {object} meta.HTTPResponseError @Router /api/{index}/_mapping [get]

func GetSettings

func GetSettings(c zhttp.Context)

@Id GetSettings @Summary Get index settings @security BasicAuth @Tags Index @Produce json @Param index path string true "Index" @Success 200 {object} map[string]interface{} @Failure 400 {object} meta.HTTPResponseError @Router /api/{index}/_settings [get]

func GetTemplate

func GetTemplate(c zhttp.Context)

@Id GetTemplate @Summary Get index template @security BasicAuth @Tags Index @Produce json @Param name path string true "Template" @Success 200 {object} meta.IndexTemplate @Failure 400 {object} meta.HTTPResponseError @Router /es/_index_template/{name} [get]

func GetTier

func GetTier(c zhttp.Context)

@Id GetIndexTier @Summary Get index data tier @security BasicAuth @Tags Index @Produce json @Param index path string true "Index" @Success 200 {object} map[string]interface{} @Failure 400 {object} meta.HTTPResponseError @Router /api/index/{index}/_tier [get]

func IndexNameList

func IndexNameList(c zhttp.Context)

@Id IndexNameList @Summary List index Name @security BasicAuth @Tags Index @Param name query string false "IndexName" @Produce json @Success 200 {object} []string @Router /api/index_name [get]

func List

func List(c zhttp.Context)

@Id ListIndexes @Summary List indexes @security BasicAuth @Tags Index @Param page_num query integer false "page num" @Param page_size query integer false "page size" @Param sort_by query string false "sort by" @Param desc query bool false "desc" @Param name query string false "name" @Produce json @Success 200 {object} IndexListResponse @Router /api/index [get]

func ListILMPolicy

func ListILMPolicy(c zhttp.Context)

@Id ListILMPolicy @Summary List index lifecycle policies @security BasicAuth @Tags Index @Produce json @Success 200 {object} map[string]interface{} @Failure 500 {object} meta.HTTPResponseError @Router /es/_ilm/policy [get]

func ListTemplate

func ListTemplate(c zhttp.Context)

@Id ListTemplates @Summary List index teplates @security BasicAuth @Tags Index @Produce json @Success 200 {object} []meta.Template @Failure 400 {object} meta.HTTPResponseError @Router /es/_index_template [get]

func PutILMPolicy

func PutILMPolicy(c zhttp.Context)

@Id PutILMPolicy @Summary Create or update an index lifecycle policy @security BasicAuth @Tags Index @Accept json @Produce json @Param name path string true "Policy" @Param policy body index.ILMPolicyRequest true "Policy" @Success 200 {object} meta.HTTPResponse @Failure 400 {object} meta.HTTPResponseError @Failure 500 {object} meta.HTTPResponseError @Router /es/_ilm/policy/{name} [put]

func Refresh

func Refresh(c zhttp.Context)

@Id Refresh @Summary Resfresh index @security BasicAuth @Tags Index @Produce json @Param index path string true "Index" @Success 200 {object} meta.HTTPResponse @Failure 400 {object} meta.HTTPResponseError @Router /api/index/{index}/refresh [post]

func Reindex

func Reindex(c zhttp.Context)

Reindex copies the documents of one index into another one

@Id Reindex @Summary Reindex documents for compatible ES @security BasicAuth @Tags Index @Accept json @Produce json @Param query body ReindexRequest true "Reindex" @Success 200 {object} elastic.ReindexResponse @Failure 400 {object} meta.HTTPResponseError @Router /es/_reindex [post]

func SetMapping

func SetMapping(c zhttp.Context)

@Id SetMapping @Summary Set index mappings @security BasicAuth @Tags Index @Accept json @Produce json @Param index path string true "Index" @Param mapping body meta.Mappings true "Mapping" @Success 200 {object} meta.HTTPResponse @Failure 400 {object} meta.HTTPResponseError @Failure 500 {object} meta.HTTPResponseError @Router /api/{index}/_mapping [put]

func SetSettings

func SetSettings(c zhttp.Context)

@Id SetSettings @Summary Set index Settings @security BasicAuth @Tags Index @Accept json @Produce json @Param index path string true "Index" @Param settings body meta.IndexSettings true "Settings" @Success 200 {object} meta.HTTPResponse @Failure 400 {object} meta.HTTPResponseError @Failure 500 {object} meta.HTTPResponseError @Router /api/{index}/_settings [put]

func SetTier

func SetTier(c zhttp.Context)

@Id SetIndexTier @Summary Move index to another data tier @security BasicAuth @Tags Index @Accept json @Produce json @Param index path string true "Index" @Param tier body index.TierRequest true "Tier" @Success 200 {object} meta.HTTPResponse @Failure 400 {object} meta.HTTPResponseError @Failure 500 {object} meta.HTTPResponseError @Router /api/index/{index}/_tier [put]

func UpdateTemplateForSDK

func UpdateTemplateForSDK()

@Id UpdateTemplate @Summary Create update index template @security BasicAuth @Tags Index @Accept json @Produce json @Param name path string true "Template" @Param template body meta.IndexTemplate true "Template data" @Success 200 {object} meta.HTTPResponseTemplate @Failure 400 {object} meta.HTTPResponseError @Router /es/_index_template/{name} [put]

Types

type Action

type Action struct {
	Add    *base `json:"add"`
	Remove *base `json:"remove"`
}

type Alias

type Alias struct {
	Actions []Action `json:"actions"`
}

type AnalyzeRequest

type AnalyzeRequest struct {
	Analyzer    string      `json:"analyzer"`
	Filed       string      `json:"field"`
	Text        string      `json:"text"`
	Tokenizer   interface{} `json:"tokenizer"`
	CharFilter  interface{} `json:"char_filter"`
	TokenFilter interface{} `json:"token_filter"`
	Filter      interface{} `json:"filter"` // compatibility with es, alias for TokenFilter
}

type AnalyzeResponse

type AnalyzeResponse struct {
	Tokens []AnalyzeResponseToken `json:"tokens"`
}

type AnalyzeResponseToken

type AnalyzeResponseToken struct {
	Token       string `json:"token"`
	StartOffset int    `json:"start_offset"`
	EndOffset   int    `json:"end_offset"`
	Position    int    `json:"position"`
	Type        string `json:"type"`
	Keyword     bool   `json:"keyword"`
}

type FieldCapsRequest

type FieldCapsRequest struct {
	Fields []string `json:"fields"`
}

FieldCapsRequest is the optional request body of the _field_caps API.

type ILMPolicyRequest

type ILMPolicyRequest struct {
	Policy metadata.ILMPolicy `json:"policy"`
}

ILMPolicyRequest is the Elasticsearch body of a policy update.

type IndexListResponse

type IndexListResponse struct {
	List []*core.Index `json:"list"`
	Page *meta.Page    `json:"page"`
}

type ReindexDest

type ReindexDest struct {
	Index string `json:"index"`
}

type ReindexRequest

type ReindexRequest struct {
	Source ReindexSource `json:"source"`
	Dest   ReindexDest   `json:"dest"`
	// MaxDocs limits the number of copied documents, 0 means all of them.
	MaxDocs int `json:"max_docs"`
}

ReindexRequest is the request body of the _reindex API.

type ReindexSource

type ReindexSource struct {
	Index string      `json:"index"`
	Query interface{} `json:"query"`
}

type TierRequest

type TierRequest struct {
	Tier string `json:"tier"`
}

TierRequest is the body of a tier change.

Jump to

Keyboard shortcuts

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