Documentation
¶
Index ¶
- func NewElasticsearch7Client(config ClientConfig, roundTripper http.RoundTripper) (*es7client, error)
- type AggregationResponse
- type BoolQuery
- type BoolQueryType
- type BulkIndexResponse
- type BulkResponse
- type BulkResponseItem
- type ClientConfig
- type ElasticsearchClient
- type Hit
- type Hits
- type MatchQuery
- type NestedQuery
- type Order
- type Query
- type RangeQuery
- type SearchBody
- type SearchResponse
- type SearchResponseError
- type TermQuery
- type Terms
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewElasticsearch7Client ¶
func NewElasticsearch7Client(config ClientConfig, roundTripper http.RoundTripper) (*es7client, error)
Types ¶
type AggregationResponse ¶
type AggregationResponse struct {
Buckets []struct {
Key string `json:"key"`
} `json:"buckets"`
}
type BoolQuery ¶
type BoolQuery struct {
Term map[string]string `json:"term,omitempty"`
Regexp map[string]TermQuery `json:"regexp,omitempty"`
Nested *NestedQuery `json:"nested,omitempty"`
BoolQuery map[BoolQueryType][]BoolQuery `json:"bool,omitempty"`
RangeQueries map[string]RangeQuery `json:"range,omitempty"`
MatchQueries map[string]MatchQuery `json:"match,omitempty"`
}
type BoolQueryType ¶
type BoolQueryType string
const Must BoolQueryType = "must"
Must defines must bool query type.
const Should BoolQueryType = "should"
Should defines should bool query type.
type BulkIndexResponse ¶
type BulkResponse ¶
type BulkResponse struct {
Errors bool `json:"errors"`
Items []BulkResponseItem `json:"items"`
}
type BulkResponseItem ¶
type BulkResponseItem struct {
Index BulkIndexResponse `json:"index"`
}
type ClientConfig ¶
type ElasticsearchClient ¶
type ElasticsearchClient interface {
Search(ctx context.Context, query SearchBody, size int, indices ...string) (*SearchResponse, error)
}
type Hit ¶
type Hit struct {
Source *json.RawMessage `json:"_source"`
}
type MatchQuery ¶
type MatchQuery struct {
Query string `json:"query"`
}
type NestedQuery ¶
type Query ¶
type Query struct {
Term *Terms `json:"term,omitempty"`
RangeQueries map[string]RangeQuery `json:"range,omitempty"`
BoolQuery map[BoolQueryType][]BoolQuery `json:"bool,omitempty"`
}
type RangeQuery ¶
type RangeQuery struct {
GTE interface{} `json:gte`
LTE interface{} `json:lte`
}
type SearchBody ¶
type SearchBody struct {
Indices []string `json:"-"`
Aggregations json.RawMessage `json:"aggs,omitempty"`
Query *Query `json:"query,omitempty"`
Sort []map[string]Order `json:"sort,omitempty"`
Size int `json:"size"`
TerminateAfter int `json:"terminate,omitempty"`
SearchAfter []interface{} `json:"search_after,omitempty"`
}
type SearchResponse ¶
type SearchResponse struct {
Hits Hits `json:"hits"`
Aggs map[string]AggregationResponse `json:"aggregations,omitempty"`
Error *SearchResponseError `json:"error,omitempty"`
}
type SearchResponseError ¶
type SearchResponseError struct {
json.RawMessage
}
Click to show internal directories.
Click to hide internal directories.