Documentation
¶
Index ¶
- func AddOrRemoveESAlias(c *gin.Context)
- func Analyze(c *gin.Context)
- func AnalyzeIndexForSDK()
- func Create(c *gin.Context)
- func CreateES(c *gin.Context)
- func CreateIndexWorker(newIndex *meta.IndexSimple, indexName string) error
- func CreateTemplate(c *gin.Context)
- func Delete(c *gin.Context)
- func DeleteTemplate(c *gin.Context)
- func ESExists()
- func Exists(c *gin.Context)
- func Get(c *gin.Context)
- func GetESAliases(c *gin.Context)
- func GetESMapping(c *gin.Context)
- func GetMapping(c *gin.Context)
- func GetSettings(c *gin.Context)
- func GetTemplate(c *gin.Context)
- func IndexNameList(c *gin.Context)
- func List(c *gin.Context)
- func ListTemplate(c *gin.Context)
- func Refresh(c *gin.Context)
- func SetMapping(c *gin.Context)
- func SetSettings(c *gin.Context)
- func UpdateTemplateForSDK()
- type Action
- type Alias
- type AnalyzeRequest
- type AnalyzeResponse
- type AnalyzeResponseToken
- type IndexListResponse
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddOrRemoveESAlias ¶
@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 ¶
@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 ¶
@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 ¶
@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 ¶
@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 ¶
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 ¶
@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 ¶
@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 ¶
@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 ¶
@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 ¶
@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 ¶
@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 ¶
@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 ¶
@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 ¶
@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 ¶
@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 ¶
@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 ¶
@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 ¶
@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 ¶
@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 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"`
}