|
@@ -32,6 +32,8 @@ const (
|
|
|
HL_IK = `"highlight": {"pre_tags": ["` + IK_pre_tags + `"],"post_tags": ["` + IK_post_tags + `"],"fields": {%s}}`
|
|
|
)
|
|
|
|
|
|
+type Aggregations map[string]*json.RawMessage
|
|
|
+
|
|
|
type Es interface {
|
|
|
Init()
|
|
|
Save(index, itype string, obj interface{}) bool
|
|
@@ -64,6 +66,7 @@ type Es interface {
|
|
|
GetAllByIk(index, itype, qstr, findfields, order, fields string, start, limit, count int, highlight bool) *[]map[string]interface{}
|
|
|
GetResForJYView(index, itype string, keys []KeyConfig, allquery, findfields, SortQuery, fields string, start, limit int) *[]map[string]interface{}
|
|
|
GetWithCount(index, itype, query string) (int64, *[]map[string]interface{})
|
|
|
+ GetAggs(index, itype, query string) (aggs Aggregations, count int64)
|
|
|
}
|
|
|
|
|
|
var (
|
|
@@ -241,3 +244,6 @@ func GetResForJYView(index, itype string, keys []KeyConfig, allquery, findfields
|
|
|
func GetWithCount(index, itype, query string) (int64, *[]map[string]interface{}) {
|
|
|
return VarEs.GetWithCount(index, itype, query)
|
|
|
}
|
|
|
+func GetAggs(index, itype, query string) (aggs Aggregations, count int64) {
|
|
|
+ return VarEs.GetAggs(index, itype, query)
|
|
|
+}
|