searcher

package
v0.0.0-...-fbbc0e4 Latest Latest
Warning

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

Go to latest
Published: Feb 22, 2022 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DateHistogramIntervalYear   = "year"
	DateHistogramIntervalMonth  = "month"
	DateHistogramIntervalDay    = "day"
	DateHistogramIntervalHour   = "hour"
	DateHistogramIntervalMinute = "minute"
	DateHistogramIntervalSecond = "second"
	DateHistogramIntervalAuto   = "auto"
)

Variables

This section is empty.

Functions

func ApiClient

func ApiClient(apiBaseUri, authBaseUri, key, secret string) (c *apiClient, err error)

func CardinalityAggregate

func CardinalityAggregate(index, doctype string, query map[string]interface{}, field string) (int64, error)

CardinalityAggregate returns the unique count of a specific field in a specific index

func EsClient

func EsClient(aa []string) (*elasticsearch.Client, error)

func Handlers

func Handlers(r chi.Router, log *zap.Logger, esc *elasticsearch.Client, api *apiClient) *handlers

func RangeAggregate

func RangeAggregate(index, doctype string, query map[string]interface{}, field string) (float64, float64, error)

RangeAggregate returns the min- and max-value for a specific field in a specific index

Types

type Aggregations

type Aggregations struct{}

type Bucket

type Bucket struct {
	Key   interface{} `json:"key"`
	Count int         `json:"doc_count"`
}

Bucket contains how often a specific key was found in a term aggregation.

func DateHistogramAggregate

func DateHistogramAggregate(query map[string]interface{}, field string, interval DateHistogramInterval, buckets int) ([]*Bucket, error)

DateHistogramAggregate fixme to utility

type DateHistogramInterval

type DateHistogramInterval string

type EsSearchAggrResult

type EsSearchAggrResult struct {
	Buckets []Bucket `json:"buckets"`
}

EsSearchAggrResult contains the result of the TermAggregation.

type EsSearchAggrResults

type EsSearchAggrResults map[string]EsSearchAggrResult

EsSearchAggrResults is a list of EsSearchAggrResult.

type EsSearchAggrTerms

type EsSearchAggrTerms map[string]esSearchAggr

EsSearchAggrTerms is aggregations parameter for es search api.

type ModuleMeta

type ModuleMeta struct {
	Public struct {
		Result []Result `json:"result"`
	} `json:"public"`
	Private struct {
		Result []Result `json:"result"`
	} `json:"private"`
	Protected struct {
		Result []Result `json:"result"`
	} `json:"protected"`
}

type Result

type Result struct {
	Lang   string   `json:"lang"`
	Fields []string `json:"fields"`
}

Jump to

Keyboard shortcuts

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