Documentation ¶
Index ¶
- type API
- func (api *API) CallElastic(ctx context.Context, path, method string, payload interface{}) ([]byte, int, error)
- func (api *API) DeleteSearchIndex(ctx context.Context, instanceID, dimension string) (int, error)
- func (api *API) QuerySearchIndex(ctx context.Context, instanceID, dimension, term string, limit, offset int) (*models.SearchResponse, int, error)
- type Body
- type Bool
- type Highlight
- type Match
- type Object
- type Query
- type Score
- type Scores
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type API ¶
type API struct {
// contains filtered or unexported fields
}
API aggregates a client and URL and other common data for accessing the API
func NewElasticSearchAPI ¶
func NewElasticSearchAPI(client dphttp.Clienter, elasticSearchAPIURL string, signRequests bool, awsSDKSigner *esauth.Signer, awsService, awsRegion string) *API
NewElasticSearchAPI creates an API object
func (*API) CallElastic ¶
func (api *API) CallElastic(ctx context.Context, path, method string, payload interface{}) ([]byte, int, error)
CallElastic builds a request to elastic search based on the method, path and payload
func (*API) DeleteSearchIndex ¶
DeleteSearchIndex removes an index from elasticsearch
type Body ¶
type Body struct { From int `json:"from"` Size int `json:"size"` Highlight *Highlight `json:"highlight,omitempty"` Query Query `json:"query"` Sort []Scores `json:"sort"` }
Body represents the request body to elasticsearch
type Highlight ¶
type Highlight struct { PreTags []string `json:"pre_tags,omitempty"` PostTags []string `json:"post_tags,omitempty"` Fields map[string]Object `json:"fields,omitempty"` Order string `json:"score,omitempty"` }
Highlight represents parts of the fields that matched
type Query ¶
type Query struct {
Bool Bool `json:"bool"`
}
Query represents the request query details
Click to show internal directories.
Click to hide internal directories.