clidto

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: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	AGGS_STATE_FIELDS = `  "aggs": {
  		{{.AggsFields}}    
   }`
	AGGS_STATE_FIELD = `  "{{.Field}}": {
        "stats": {
            "field": "{{.Field}}"
        }
    }`

	ORDER_TEMPLATE = `
		"sort": [
		  {
			  {{.SortFields}}   
		  }  
		]
		`

	HTTP_SOURCE_TEMPLATE = `
		"_source": [{{.SourceFields}}]
		`
	HTTP_HIGHLIGHT_TEMPLATE = `"highlight":{{.EsHight}}`
)
View Source
const BodyQueryTemplate = `{
	  "query":{{.QueryBody}}, 	
       {{.HttpQueryParams}}	
	  "size":{{.Size}},
	  "from":{{.From}}	
	}`

Variables

This section is empty.

Functions

func InjectHttpQueryBody

func InjectHttpQueryBody(s *HttpQueryBody)

func InjectHttpQueryParams

func InjectHttpQueryParams(s *HttpQueryParams)

func LoadHttpQueryBody

func LoadHttpQueryBody() baseiface.ISingleton

func LoadHttpQueryParams

func LoadHttpQueryParams() baseiface.ISingleton

Types

type HttpQueryBody

type HttpQueryBody struct {
	basedto.BaseEntity
	HttpcliBody     string           `json:"Httpcli_body,omitempty"`
	HttpurlParams   map[string]any   `json:"httpurl_params,omitempty"`
	HttpQueryParams *HttpQueryParams `json:"httpquery_params,omitempty"`
}

func DefaultHttpQueryBody

func DefaultHttpQueryBody() *HttpQueryBody

func FindBeanHttpQueryBody

func FindBeanHttpQueryBody() *HttpQueryBody

FindBeanHttpQueryBody

func NewHttpQueryBody

func NewHttpQueryBody() *HttpQueryBody

func (*HttpQueryBody) Aggregations

func (self *HttpQueryBody) Aggregations(agg string, aggcase elastic.Aggregation)

func (*HttpQueryBody) Correct

func (self *HttpQueryBody) Correct()

func (*HttpQueryBody) MakeBody

func (self *HttpQueryBody) MakeBody(limit, start int) string

type HttpQueryParams

type HttpQueryParams struct {
	basedto.BaseEntity
	EsAggDtos          []*esdto.EsAggDto
	HttpQuerySorts     []*HttpQuerySort
	HttpSourceFields   string `json:"http_source_fields"`
	OrderTemplate      string
	SearchType         string
	RestTotalHitsAsInt string

	AggScripts         string `json:"agg_scripts"`
	HighlightScripts   string `json:"highlight_scripts"`
	*elastic.Highlight `json:"-"`
	// contains filtered or unexported fields
}

func DefaultHHttpQueryParams

func DefaultHHttpQueryParams() *HttpQueryParams

func FindBeanHttpQueryParams

func FindBeanHttpQueryParams() *HttpQueryParams

FindBeanHttpQueryParams

func (*HttpQueryParams) Aggregations

func (self *HttpQueryParams) Aggregations(agg string, aggcase elastic.Aggregation)

func (*HttpQueryParams) Append

func (self *HttpQueryParams) Append(field string, asc bool)

func (*HttpQueryParams) BuildJson

func (self *HttpQueryParams) BuildJson() string

func (*HttpQueryParams) IfAggs

func (self *HttpQueryParams) IfAggs() bool

func (*HttpQueryParams) IfEsAggs

func (self *HttpQueryParams) IfEsAggs() bool

func (*HttpQueryParams) IfHighlight

func (self *HttpQueryParams) IfHighlight() bool

func (*HttpQueryParams) IfHighlightFrom

func (self *HttpQueryParams) IfHighlightFrom(hl *elastic.Highlight) bool

func (*HttpQueryParams) QuatedStr

func (self *HttpQueryParams) QuatedStr(ins []string) string

func (*HttpQueryParams) ToEsAggs

func (self *HttpQueryParams) ToEsAggs() string

func (*HttpQueryParams) ToHighlight

func (self *HttpQueryParams) ToHighlight() string

func (*HttpQueryParams) ToOrderBy

func (self *HttpQueryParams) ToOrderBy() string

func (*HttpQueryParams) ToSourceFields

func (self *HttpQueryParams) ToSourceFields() string

type HttpQuerySort

type HttpQuerySort struct {
	Field   string
	Ascdesc string
}

func NewHttpQuerySort

func NewHttpQuerySort() *HttpQuerySort

func (*HttpQuerySort) ToOrderJson

func (self *HttpQuerySort) ToOrderJson() string

Jump to

Keyboard shortcuts

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