dsl

package
v4.19.0 Latest Latest
Warning

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

Go to latest
Published: Dec 17, 2024 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	AggSum         = "sum"
	AggAvg         = "avg"
	AggMin         = "min"
	AggMax         = "max"
	AggCount       = "count"
	AggCountCached = "count_cached"
	AggFacet       = "facet"
	AggDistinct    = "distinct"
)

Variables

This section is empty.

Functions

func DisableStrictMode added in v4.13.0

func DisableStrictMode()

func EnabeStrictMode added in v4.13.0

func EnabeStrictMode()

Types

type Aggregation

type Aggregation struct {
	AggType string   `json:"type"`
	Sort    []Sort   `json:"sort,omitempty"`
	Limit   int      `json:"limit,omitempty"`
	Offset  int      `json:"offset,omitempty"`
	Fields  []string `json:"fields"`
}

type DSL

type DSL struct {
	Namespace    string        `json:"namespace"`
	Offset       int           `json:"offset,omitempty"`
	Limit        int           `json:"limit,omitempty"`
	Distinct     string        `json:"distinct,omitempty"` // deprecated, use aggregation with type AggDistinct instead
	Sort         Sort          `json:"sort,omitempty"`
	Filters      []Filter      `json:"filters,omitempty"`
	Explain      bool          `json:"explain,omitempty"`
	ReqTotal     bool          `json:"req_total,omitempty"`
	WithRank     bool          `json:"select_with_rank,omitempty"`
	Aggregations []Aggregation `json:"aggregations,omitempty"`
}

func DecodeJSON added in v4.13.0

func DecodeJSON(data []byte) (*DSL, error)

type EqualPosition added in v4.18.0

type EqualPosition struct {
	Positions []string `json:"positions"`
}

type Filter

type Filter struct {
	Op             string          `json:"Op,omitempty"`
	Field          string          `json:"Field,omitempty"`
	Joined         *JoinQuery      `json:"Join_Query,omitempty"`
	SubQ           *SubQuery       `json:"Subquery,omitempty"`
	Cond           string          `json:"Cond,omitempty"`
	Value          interface{}     `json:"Value,omitempty"`
	EqualPositions []EqualPosition `json:"equal_positions,omitempty"`
	Filters        []Filter        `json:"Filters,omitempty"`
}

func (*Filter) UnmarshalJSON

func (f *Filter) UnmarshalJSON(data []byte) error

type JoinOnCondition added in v4.12.0

type JoinOnCondition struct {
	LeftField  string `json:"left_field"`
	RightField string `json:"right_field"`
	Op         string `json:"op,omitempty"`
	Cond       string `json:"cond"`
}

type JoinQuery added in v4.12.0

type JoinQuery struct {
	Filters []Filter `json:"filters,omitempty"`
	// contains filtered or unexported fields
}

type Sort

type Sort struct {
	Field  string        `json:"field"`
	Desc   bool          `json:"desc"`
	Values []interface{} `json:"values,omitempty"`
}

func (*Sort) CheckValuesType

func (s *Sort) CheckValuesType() error

func (*Sort) UnmarshalJSON

func (s *Sort) UnmarshalJSON(data []byte) error

type SubQuery added in v4.13.0

type SubQuery struct {
	SubQueryBase
	Filters []Filter `json:"filters,omitempty"`
}

type SubQueryBase added in v4.13.0

type SubQueryBase struct {
	Namespace    string        `json:"namespace"`
	Offset       int           `json:"offset,omitempty"`
	Limit        int           `json:"limit,omitempty"`
	Sort         Sort          `json:"sort,omitempty"`
	ReqTotal     bool          `json:"req_total,omitempty"`
	Aggregations []Aggregation `json:"aggregations,omitempty"`
	SelectFilter []string      `json:"select_filter,omitempty"`
}

Jump to

Keyboard shortcuts

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