synonyms

package
v0.0.0-...-0fffe9f Latest Latest
Warning

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

Go to latest
Published: Feb 23, 2026 License: Apache-2.0 Imports: 24 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AppendIndexToSynonymID

func AppendIndexToSynonymID(ID string, index string) string

AppendIndexToSynonymID will append the index name to the synonym's ID.

func RemoveIndexFromSynonymID

func RemoveIndexFromSynonymID(ID string) (string, string)

RemoveIndexFromSynonymID will remove the index name from the synonym's ID

This function will return the raw ID and the index

Types

type BaseSynonymStruct

type BaseSynonymStruct struct {
	Type    SynonymType `json:"type"`
	Synonym string      `json:"synonym"`
	Index   string      `json:"index"`
}

type SynonymType

type SynonymType int
const (
	OneWay SynonymType = iota // after
	Equivalent
	IndexPattern = "__index__"
)

func (SynonymType) MarshalJSON

func (o SynonymType) MarshalJSON() ([]byte, error)

func (SynonymType) String

func (o SynonymType) String() string

String is the implementation of Stringer interface that returns the string representation of ActionType type.

func (*SynonymType) UnmarshalJSON

func (o *SynonymType) UnmarshalJSON(bytes []byte) error

type Synonyms

type Synonyms struct {
	// contains filtered or unexported fields
}

Synonyms plugin saves default settings for search, aggregations, result, language.

func Instance

func Instance() *Synonyms

Instance returns the singleton instace of Synonyms plugin. Note: Only this function must be used (both within and outside the package) to obtain the instance synonyms in order to avoid stateless instances of the plugin.

func (*Synonyms) AlternateRoutes

func (s *Synonyms) AlternateRoutes() []plugins.Route

Expose plugin specific routes

func (*Synonyms) ESMiddleware

func (s *Synonyms) ESMiddleware() []middleware.Middleware

ESMiddleware ES middlewares

func (*Synonyms) InitFunc

func (s *Synonyms) InitFunc() error

InitFunc is a part of Plugin interface that gets executed only once, and initializes the dao, i.e. elasticsearch before the plugin is operational.

func (*Synonyms) Name

func (s *Synonyms) Name() string

Name is a part of Plugin interface that returns the name of the plugin: 'synonyms'.

func (*Synonyms) RSMiddleware

func (s *Synonyms) RSMiddleware() []middleware.Middleware

RSMiddleware RS middlewares

func (*Synonyms) Routes

func (s *Synonyms) Routes() []plugins.Route

Routes returns the synonyms routes that the plugin serves.

type SynonymsStruct

type SynonymsStruct struct {
	Id string `json:"_id"`
	BaseSynonymStruct
}

SynonymsStruct struct for settings request

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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