pagereqcli

package
v1.0.2-dev-10 Latest Latest
Warning

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

Go to latest
Published: Dec 8, 2024 License: MulanPSL-2.0 Imports: 22 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func InjectHttpCliQuery

func InjectHttpCliQuery(s *HttpCliQuery)

func InjectPageEsRequestAggStats

func InjectPageEsRequestAggStats(s *PageEsRequestAggStats)

func InjectPageEsWebClient

func InjectPageEsWebClient(s *PageEsWebClient)

func InjectPageEsWebClients

func InjectPageEsWebClients(s *PageEsWebClients)

func LoadHttpCliQuery

func LoadHttpCliQuery() baseiface.ISingleton

func LoadPageEsRequestAggStats

func LoadPageEsRequestAggStats() baseiface.ISingleton

func LoadPageEsWebClient

func LoadPageEsWebClient() baseiface.ISingleton

func LoadPageEsWebClients

func LoadPageEsWebClients() baseiface.ISingleton

Types

type AggResult

type AggResult any

type HttpCliQuery

type HttpCliQuery struct {
	*pagereq.QueryRequest

	// same as go elasticsearch query expr
	EsQuery elastic.Query
	EsHight *elastic.Highlight
}

func Default

func Default() *HttpCliQuery

func FindBeanHttpCliQuery

func FindBeanHttpCliQuery() *HttpCliQuery

FindBeanHttpCliQuery

func (*HttpCliQuery) EsStats

func (self *HttpCliQuery) EsStats(statField string, size ...int) *HttpCliQuery

func (*HttpCliQuery) Execute

func (this *HttpCliQuery) Execute() (*pagees.PageEsResult, error)

func (*HttpCliQuery) Hightlight

func (self *HttpCliQuery) Hightlight(value *elastic.Highlight) *HttpCliQuery

func (*HttpCliQuery) HttpQuery

func (self *HttpCliQuery) HttpQuery(query ...elastic.Query) *pagees.PageEsResult

func (*HttpCliQuery) HttpQuery2EsResult

func (self *HttpCliQuery) HttpQuery2EsResult() *pagees.PageEsResult

func (*HttpCliQuery) HttpQuery2EsResultBase

func (self *HttpCliQuery) HttpQuery2EsResultBase(body string) *pagees.PageEsResult

func (*HttpCliQuery) HttpQuery2EsResultSource

func (self *HttpCliQuery) HttpQuery2EsResultSource() *pagees.PageEsResult

func (*HttpCliQuery) IfHighlight

func (self *HttpCliQuery) IfHighlight() bool

func (*HttpCliQuery) Query

func (self *HttpCliQuery) Query(value elastic.Query) *HttpCliQuery

func (*HttpCliQuery) QuerySource

func (self *HttpCliQuery) QuerySource() *pagees.PageEsResult

func (*HttpCliQuery) SetHttpcliBody

func (self *HttpCliQuery) SetHttpcliBody(clibody string) *HttpCliQuery

func (*HttpCliQuery) SetIndexName

func (self *HttpCliQuery) SetIndexName(index string) *HttpCliQuery

func (*HttpCliQuery) SetPageCurrent

func (self *HttpCliQuery) SetPageCurrent(c int) *HttpCliQuery

func (*HttpCliQuery) SetPageSize

func (self *HttpCliQuery) SetPageSize(size int) *HttpCliQuery

func (*HttpCliQuery) SetSource

func (self *HttpCliQuery) SetSource(src string) *HttpCliQuery

func (*HttpCliQuery) Sort

func (self *HttpCliQuery) Sort(value elastic.Sorter) *HttpCliQuery

func (*HttpCliQuery) SortBy

func (self *HttpCliQuery) SortBy(values ...elastic.Sorter) *HttpCliQuery

func (*HttpCliQuery) ToHttpQueryBody

func (self *HttpCliQuery) ToHttpQueryBody() *clidto.HttpQueryBody

func (*HttpCliQuery) ToHttpQueryParams

func (self *HttpCliQuery) ToHttpQueryParams() *clidto.HttpQueryParams

type KeyCount

type KeyCount struct {
	Key       any         `json:"key"`
	KeyNumber json.Number `json:"key_number"`
	DocCount  int64       `json:"doc_count"`
	KeyCounts []*KeyCount `json:"key_counts,omitempty"`
}

func NewKeyCount

func NewKeyCount() *KeyCount

type PageEsRequestAggStats

type PageEsRequestAggStats struct {
	basedto.BaseEntity
	*pagereq.QueryRequest
}

使用连接池

func DefaultAggStats

func DefaultAggStats() *PageEsRequestAggStats

func FindBeanPageEsRequestAggStats

func FindBeanPageEsRequestAggStats() *PageEsRequestAggStats

FindBeanPageEsRequestAggStats

func (*PageEsRequestAggStats) Agg2Map

func (self *PageEsRequestAggStats) Agg2Map(aggs elastic.Aggregations, field string, usekey bool) (map[string]int64, error)

func (*PageEsRequestAggStats) Agg2MapResult

func (self *PageEsRequestAggStats) Agg2MapResult(aggs elastic.Aggregations, field string, usekey bool) (map[string]*esdto.EsAggResult, error)

func (*PageEsRequestAggStats) Agg2MapResult2Map

func (self *PageEsRequestAggStats) Agg2MapResult2Map(aggs elastic.Aggregations, field string, usekey bool) (map[string]any, error)

func (*PageEsRequestAggStats) Agg2Result

func (this *PageEsRequestAggStats) Agg2Result(aggs elastic.Aggregations) (*esdto.EsAggResult, error)

"search_result": { "hits": { "total": { "value": 53, "relation": "eq" } }, "aggregations": { "stats": { "count" : 53, "min" : 10.0, "max" : 40.0, "avg" : 29.245283018867923, "sum" : 1550.0 }

func (*PageEsRequestAggStats) AggAvg

func (this *PageEsRequestAggStats) AggAvg(searchService *elastic.SearchService) (*elastic.SearchResult, error)

func (*PageEsRequestAggStats) AggCount

func (this *PageEsRequestAggStats) AggCount(searchService *elastic.SearchService) (*elastic.SearchResult, error)

func (*PageEsRequestAggStats) AggCountSub

func (this *PageEsRequestAggStats) AggCountSub(searchService *elastic.SearchService) (*elastic.SearchResult, error)

func (*PageEsRequestAggStats) AggMax

func (this *PageEsRequestAggStats) AggMax(searchService *elastic.SearchService) (*elastic.SearchResult, error)

func (*PageEsRequestAggStats) AggMin

func (this *PageEsRequestAggStats) AggMin(searchService *elastic.SearchService) (*elastic.SearchResult, error)

func (*PageEsRequestAggStats) AggStats

func (this *PageEsRequestAggStats) AggStats(searchService *elastic.SearchService) (*elastic.SearchResult, error)

func (*PageEsRequestAggStats) AggSum

func (this *PageEsRequestAggStats) AggSum(searchService *elastic.SearchService) (*elastic.SearchResult, error)

func (*PageEsRequestAggStats) EsStats

func (this *PageEsRequestAggStats) EsStats(searchService *elastic.SearchService) (*elastic.SearchResult, error)

func (*PageEsRequestAggStats) FindAggDto

func (this *PageEsRequestAggStats) FindAggDto() *esdto.EsAggDto

func (*PageEsRequestAggStats) Parse

func (this *PageEsRequestAggStats) Parse(searchResult *elastic.SearchResult) (AggResult, error)

func (*PageEsRequestAggStats) ParseAggCount

func (this *PageEsRequestAggStats) ParseAggCount(searchResult *elastic.SearchResult) (map[string]int64, error)

func (*PageEsRequestAggStats) ParseAggCountSub

func (this *PageEsRequestAggStats) ParseAggCountSub(searchResult *elastic.SearchResult) ([]*KeyCount, error)

func (*PageEsRequestAggStats) ParseAggStats

func (this *PageEsRequestAggStats) ParseAggStats(searchResult *elastic.SearchResult) (map[string]*esdto.EsAggResult, error)

func (*PageEsRequestAggStats) ParseAggStats2Map

func (this *PageEsRequestAggStats) ParseAggStats2Map(searchResult *elastic.SearchResult) (map[string]any, error)

func (*PageEsRequestAggStats) ParseStats

func (this *PageEsRequestAggStats) ParseStats(searchResult *elastic.SearchResult) (*esdto.EsAggResult, error)
func (this *PageEsRequestAggStats) Agg2Result(aggs elastic.Aggregations) (*esdto.EsAggResult, error) {
	var aggdto = this.FindAggDto()

	var result = esdto.NewEsAggResult()
	var esstats = esdto.NewEsStats()
	esstats.Value2Stats(aggs)
	result.Avg = esstats.Stats.Avg
	result.Sum = esstats.Stats.Sum
	result.Max = esstats.Stats.Max
	result.Min = esstats.Stats.Min
	result.Count = esstats.Stats.Count
	result.StatField = aggdto.StatField
	result.AggType = esdto.AggType_Stats
	return result, nil
}

func (*PageEsRequestAggStats) QueryAggCount

func (self *PageEsRequestAggStats) QueryAggCount(field string, size int, usekey bool) (map[string]int64, error)

func (*PageEsRequestAggStats) Stats

func (this *PageEsRequestAggStats) Stats(searchService *elastic.SearchService) (*elastic.SearchResult, error)

func (*PageEsRequestAggStats) StatsFields

func (this *PageEsRequestAggStats) StatsFields(searchService *elastic.SearchService) (*elastic.SearchResult, error)

func (*PageEsRequestAggStats) StatsOne

func (this *PageEsRequestAggStats) StatsOne(searchService *elastic.SearchService) (*elastic.SearchResult, error)

GET dev_biz_grouping_buy_line/_search/

{
  "query": {
    "match_all": {}
  },
  "size":1,
  "sort": [
    {
      "shop_id":   "desc"
    },
        {
      "updated_by":   "desc"
    }

  ],
   "aggs": {
    "stats": {
        "stats": {
            "field": "state"
        }
    }, "stats": {
        "stats": {
            "field": "price"
        }
    }

   }
}

func (*PageEsRequestAggStats) TermsAgg

func (self *PageEsRequestAggStats) TermsAgg(field string, size int, usekey bool) *elastic.TermsAggregation

type PageEsWebClient

type PageEsWebClient struct {
	basedto.BaseEntity
	*webclient.WebClient
	EsRandSeq int    `json:"-"`
	Attach    bool   `json:"-"`
	Host      string `json:"-"`
}

func FindBeanPageEsWebClient

func FindBeanPageEsWebClient() *PageEsWebClient

FindBeanPageEsWebClient

func NewPageEsWebClient

func NewPageEsWebClient() *PageEsWebClient

func (*PageEsWebClient) BuildEsHttpHost

func (self *PageEsWebClient) BuildEsHttpHost() string

dest esserver

func (*PageEsWebClient) BuildQueryUrl

func (self *PageEsWebClient) BuildQueryUrl(q *HttpCliQuery) string

func (*PageEsWebClient) Check

func (self *PageEsWebClient) Check(q *HttpCliQuery) error

type PageEsWebClients

type PageEsWebClients struct {
	basedto.BaseEntitySingle
	WebClients []*PageEsWebClient
}

func FindBeanPageEsWebClients

func FindBeanPageEsWebClients() *PageEsWebClients

FindBeanPageEsWebClients

func NewPageEsWebClients

func NewPageEsWebClients() *PageEsWebClients

func (*PageEsWebClients) FindWebClient

func (self *PageEsWebClients) FindWebClient() *PageEsWebClient

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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