Documentation
¶
Overview ¶
Package synonyms serves the Elasticsearch compatible synonyms sets API.
Index ¶
- func DeleteRule(c zhttp.Context)
- func DeleteSet(c zhttp.Context)
- func GetRule(c zhttp.Context)
- func GetSet(c zhttp.Context)
- func ListSets(c zhttp.Context)
- func PutRule(c zhttp.Context)
- func PutSet(c zhttp.Context)
- func ReloadSearchAnalyzers(c zhttp.Context)
- type ListResponse
- type ReloadDetail
- type ReloadDetails
- type SetResponse
- type SetSummary
- type Shards
- type UpdateResponse
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DeleteRule ¶
DeleteRule deletes a synonym rule and reloads the analyzers using its set
@Id DeleteSynonymRule @Summary Delete synonym rule for compatible ES @security BasicAuth @Tags Synonyms @Produce json @Param id path string true "Synonyms set id" @Param rule path string true "Synonym rule id" @Success 200 {object} synonyms.UpdateResponse @Failure 404 {object} map[string]interface{} @Router /es/_synonyms/{id}/{rule} [delete]
func DeleteSet ¶
DeleteSet deletes a synonyms set not used by any index
@Id DeleteSynonymsSet @Summary Delete synonyms set for compatible ES @security BasicAuth @Tags Synonyms @Produce json @Param id path string true "Synonyms set id" @Success 200 {object} map[string]interface{} @Failure 400 {object} map[string]interface{} @Failure 404 {object} map[string]interface{} @Router /es/_synonyms/{id} [delete]
func GetRule ¶
GetRule returns a synonym rule of a synonyms set
@Id GetSynonymRule @Summary Get synonym rule for compatible ES @security BasicAuth @Tags Synonyms @Produce json @Param id path string true "Synonyms set id" @Param rule path string true "Synonym rule id" @Success 200 {object} meta.SynonymRule @Failure 404 {object} map[string]interface{} @Router /es/_synonyms/{id}/{rule} [get]
func GetSet ¶
GetSet returns a page of the rules of a synonyms set
@Id GetSynonymsSet @Summary Get synonyms set for compatible ES @security BasicAuth @Tags Synonyms @Produce json @Param id path string true "Synonyms set id" @Param from query int false "Starting offset" minimum(0) @Param size query int false "Max results, default 10" minimum(0) @Success 200 {object} synonyms.SetResponse @Failure 400 {object} map[string]interface{} "Negative or non-integer from or size" @Failure 404 {object} map[string]interface{} @Router /es/_synonyms/{id} [get]
func ListSets ¶
ListSets lists the synonyms sets sorted by id
@Id ListSynonymsSets @Summary List synonyms sets for compatible ES @security BasicAuth @Tags Synonyms @Produce json @Param from query int false "Starting offset" minimum(0) @Param size query int false "Max results, default 10" minimum(0) @Success 200 {object} synonyms.ListResponse @Failure 400 {object} map[string]interface{} @Router /es/_synonyms [get]
func PutRule ¶
PutRule creates or updates a synonym rule, creating the synonyms set when missing, and reloads the analyzers using it
@Id PutSynonymRule @Summary Create or update synonym rule for compatible ES @security BasicAuth @Tags Synonyms @Accept json @Produce json @Param id path string true "Synonyms set id" @Param rule path string true "Synonym rule id" @Param data body meta.SynonymRule true "Synonym rule" @Success 200 {object} synonyms.UpdateResponse @Success 201 {object} synonyms.UpdateResponse @Failure 400 {object} map[string]interface{} @Router /es/_synonyms/{id}/{rule} [put]
func PutSet ¶
PutSet creates or replaces a synonyms set and reloads the analyzers using it
@Id PutSynonymsSet @Summary Create or update synonyms set for compatible ES @security BasicAuth @Tags Synonyms @Accept json @Produce json @Param id path string true "Synonyms set id" @Param data body meta.SynonymSet true "Synonyms set" @Success 200 {object} synonyms.UpdateResponse @Success 201 {object} synonyms.UpdateResponse @Failure 400 {object} map[string]interface{} @Router /es/_synonyms/{id} [put]
func ReloadSearchAnalyzers ¶
ReloadSearchAnalyzers rebuilds the analyzers of an index, picking up changed synonyms sets and files
@Id ReloadSearchAnalyzers @Summary Reload search analyzers for compatible ES @security BasicAuth @Tags Synonyms @Produce json @Param index path string true "Index" @Success 200 {object} synonyms.ReloadDetails @Failure 404 {object} map[string]interface{} @Router /es/{index}/_reload_search_analyzers [post]
Types ¶
type ListResponse ¶
type ListResponse struct {
Count int `json:"count"`
Results []SetSummary `json:"results"`
}
ListResponse is a page of the synonyms sets.
type ReloadDetail ¶
type ReloadDetail struct {
Index string `json:"index"`
ReloadedAnalyzers []string `json:"reloaded_analyzers"`
ReloadedNodeIDs []string `json:"reloaded_node_ids"`
}
ReloadDetail lists the reloaded analyzers of an index.
type ReloadDetails ¶
type ReloadDetails struct {
Shards Shards `json:"_shards"`
ReloadDetails []ReloadDetail `json:"reload_details"`
}
ReloadDetails is the analyzers reload report of a change.
type SetResponse ¶
type SetResponse struct {
Count int `json:"count"`
SynonymsSet []meta.SynonymRule `json:"synonyms_set"`
}
SetResponse is a page of the rules of a synonyms set.
type SetSummary ¶
SetSummary is a synonyms set and its rules count.
type Shards ¶
type Shards struct {
Total int `json:"total"`
Successful int `json:"successful"`
Failed int `json:"failed"`
}
Shards counts the indexes whose analyzers were reloaded.
type UpdateResponse ¶
type UpdateResponse struct {
Result string `json:"result"`
ReloadAnalyzersDetails ReloadDetails `json:"reload_analyzers_details"`
}
UpdateResponse is the response of a synonyms set or rule change.