elastic

package module
v0.0.0-...-98a8d27 Latest Latest
Warning

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

Go to latest
Published: Aug 15, 2017 License: MIT Imports: 9 Imported by: 2

README

elastic-appengine

Elasticsearch querying with Appengine

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Elastic

type Elastic struct {
	BaseURL string
	Index   string
	Type    string
}

func (*Elastic) GetDataFromId

func (e *Elastic) GetDataFromId(c context.Context, id string) (ElasticHitsMGet, error)

func (*Elastic) GetMapping

func (e *Elastic) GetMapping(c context.Context) (interface{}, error)

func (*Elastic) Query

func (e *Elastic) Query(c context.Context, offset int, limit int, searchQuery string) (ElasticHits, error)

func (*Elastic) QueryStruct

func (e *Elastic) QueryStruct(c context.Context, searchQuery interface{}) (ElasticHits, error)

func (*Elastic) QueryStructMGet

func (e *Elastic) QueryStructMGet(c context.Context, searchQuery interface{}) ([]ElasticHitsMGet, error)

func (*Elastic) QueryStructWithSearchQueryUrl

func (e *Elastic) QueryStructWithSearchQueryUrl(c context.Context, searchQuery interface{}, searchQueryUrl string) (ElasticHits, error)

type ElasticFilterWithSort

type ElasticFilterWithSort struct {
	Query struct {
		Bool struct {
			Should             []interface{} `json:"should"`
			MinimumShouldMatch string        `json:"minimum_should_match"`
		} `json:"bool"`
	} `json:"query"`

	Size     int     `json:"size"`
	From     int     `json:"from"`
	MinScore float32 `json:"min_score"`

	Sort []interface{} `json:"sort"`
}

type ElasticHits

type ElasticHits struct {
	Total    int     `json:"total"`
	MaxScore float64 `json:"max_score"`
	Hits     []struct {
		Index  string  `json:"_index"`
		Type   string  `json:"_type"`
		ID     string  `json:"_id"`
		Score  float64 `json:"_score"`
		Source struct {
			Data interface{} `json:"data"`
		} `json:"_source"`
	} `json:"hits"`
}

type ElasticHitsMGet

type ElasticHitsMGet struct {
	Index   string `json:"_index"`
	Type    string `json:"_type"`
	ID      string `json:"_id"`
	Version int    `json:"_version"`
	Found   bool   `json:"found"`
	Source  struct {
		Data interface{} `json:"data"`
	} `json:"_source"`
}

type ElasticMatchQuery

type ElasticMatchQuery struct {
	Match struct {
		All string `json:"_all"`
	} `json:"match"`
}

type ElasticQuery

type ElasticQuery struct {
	Query struct {
		Bool struct {
			Must []interface{} `json:"must"`
		} `json:"bool"`
	} `json:"query"`
	Size int `json:"size"`
	From int `json:"from"`
}

type ElasticQueryMust

type ElasticQueryMust struct {
	Query struct {
		Bool struct {
			Must []interface{} `json:"must"`
		} `json:"bool"`
	} `json:"query"`
	Size     int     `json:"size"`
	From     int     `json:"from"`
	MinScore float32 `json:"min_score"`
}

type ElasticQueryMustShould

type ElasticQueryMustShould struct {
	Query struct {
		Bool struct {
			Must   []interface{} `json:"must"`
			Should []interface{} `json:"should"`
		} `json:"bool"`
	} `json:"query"`
	Size     int     `json:"size"`
	From     int     `json:"from"`
	MinScore float32 `json:"min_score"`
}

type ElasticQueryMustWithSort

type ElasticQueryMustWithSort struct {
	Query struct {
		Bool struct {
			Must []interface{} `json:"must"`
		} `json:"bool"`
	} `json:"query"`
	Size     int           `json:"size"`
	From     int           `json:"from"`
	MinScore float32       `json:"min_score"`
	Sort     []interface{} `json:"sort"`
}

type ElasticQueryWithMust

type ElasticQueryWithMust struct {
	Query struct {
		Bool struct {
			Must []interface{} `json:"must"`
		} `json:"bool"`
	} `json:"query"`
	Size int           `json:"size"`
	From int           `json:"from"`
	Sort []interface{} `json:"sort"`
}

type ElasticQueryWithShould

type ElasticQueryWithShould struct {
	Query struct {
		Bool struct {
			Must   []interface{} `json:"must"`
			Should []interface{} `json:"should"`
		} `json:"bool"`
	} `json:"query"`
	Size int           `json:"size"`
	From int           `json:"from"`
	Sort []interface{} `json:"sort"`
}

type ElasticQueryWithSort

type ElasticQueryWithSort struct {
	ElasticQuery

	Sort []interface{} `json:"sort"`
}

type ElasticQueryWithSortShould

type ElasticQueryWithSortShould struct {
	ElasticQueryMustShould

	Sort []interface{} `json:"sort"`
}

type ElasticResponse

type ElasticResponse struct {
	Took     int  `json:"took"`
	TimedOut bool `json:"timed_out"`
	Shards   struct {
		Total      int `json:"total"`
		Successful int `json:"successful"`
		Failed     int `json:"failed"`
	} `json:"_shards"`
	Hits ElasticHits `json:"hits"`
}

type ElasticResponseMGet

type ElasticResponseMGet struct {
	Docs []ElasticHitsMGet `json:"docs"`
}

Jump to

Keyboard shortcuts

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