Documentation ¶
Index ¶
- func IsValidKey(str string, list []string) bool
- func ParseDocument(source map[string]interface{}) (map[string]interface{}, error)
- func ParseDocuments(res map[string]interface{}) (map[string]interface{}, error)
- func ParserAggregation(res map[string]interface{}) (map[string]interface{}, error)
- func RemoveKey(s []string, index int) []string
- type BoolQuery
- type BoolQueryParams
- type Elastic
- type Query
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func IsValidKey ¶
IsValidKey checks if a string is in an array
func ParseDocument ¶
ParseDocument
func ParseDocuments ¶
ParseDocuments
func ParserAggregation ¶
ParserAggregation
Types ¶
type BoolQuery ¶
type BoolQuery struct { Bool *BoolQueryParams `json:"bool,omitempty"` FunctionScore interface{} `json:"function_score,omitempty"` }
BoolQuery Struct
type BoolQueryParams ¶
type BoolQueryParams struct { MustNot []map[string]interface{} `json:"must_not,omitempty"` Must []map[string]interface{} `json:"must,omitempty"` Should []map[string]interface{} `json:"should,omitempty"` Filter []map[string]interface{} `json:"filter,omitempty"` MinimunShouldMatch interface{} `json:"minimum_should_match,omitempty"` }
BoolQueryParams Struct
type Elastic ¶
type Elastic struct {
Client *elasticsearch.Client
}
func NewElastic ¶
func (*Elastic) CheckIfIndexExists ¶
func (*Elastic) CreateIndex ¶
type Query ¶
type Query struct { Query BoolQuery `json:"query,omitempty"` Aggregations interface{} `json:"aggs,omitempty"` Fields []string `json:"fields,omitempty"` Source []string `json:"_source,omitempty"` Sort []map[string]interface{} `json:"sort,omitempty"` Size int `json:"size" default:"0"` From int `json:"from,omitempty"` SearchAfter []int `json:"search_after,omitempty"` }
Query Struct
Click to show internal directories.
Click to hide internal directories.