index

package
v0.4.10 Latest Latest
Warning

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

Go to latest
Published: Jan 14, 2024 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddOrRemoveESAlias

func AddOrRemoveESAlias(c *gin.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 *gin.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 *gin.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 *gin.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 *gin.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 *gin.Context)

Delete deletes a zinc 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 DeleteTemplate

func DeleteTemplate(c *gin.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 *gin.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 Get

func Get(c *gin.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 *gin.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 *gin.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 GetMapping

func GetMapping(c *gin.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 *gin.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 *gin.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 IndexNameList

func IndexNameList(c *gin.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 *gin.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 ListTemplate

func ListTemplate(c *gin.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 Refresh

func Refresh(c *gin.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 SetMapping

func SetMapping(c *gin.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 *gin.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 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 IndexListResponse

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

Jump to

Keyboard shortcuts

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