Documentation
¶
Overview ¶
Package search deals with all search queries going to elasticsearch, and returning their result
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Dict ¶
type Dict map[string]interface{}
Dict represents a key-value map which may be unmarshalled from a yaml document. It is unique in that it enforces all the keys to be strings (where the default behavior in the yaml package is to have keys be interface{}), and for any embedded objects it find it will decode them into Dicts instead of map[interface{}]interface{}
func (*Dict) UnmarshalYAML ¶
UnmarshalYAML is used to unmarshal a yaml string into the Dict. See the dict's doc string for more details on what it is used for
type Hit ¶
type Hit struct { Index string `json:"_index"` // The index the hit came from Type string `json:"_type"` // The type the document is ID string `json:"_id"` // The unique id of the document Score float64 `json:"_score"` // The document's score relative to the search Source map[string]interface{} `json:"_source"` // The actual document }
Hit describes one of the documents matched by a search
type HitInfo ¶
type HitInfo struct { HitCount uint64 `json:"total"` // The total number of documents matched HitMaxScore float64 `json:"max_score"` // The maximum score of all the documents matched Hits []Hit `json:"hits"` // The actual documents matched }
HitInfo describes information in the Result related to the actual hits
type Result ¶
type Result struct { TookMS uint64 `json:"took"` // Time search took to complete, in milliseconds TimedOut bool `json:"timed_out"` // Whether or not the search timed out HitInfo `json:"hits" luautil:",inline"` // Information related to the actual hits Aggregations map[string]interface{} `json:"aggregations"` // Information related to aggregations in the query }
Result describes the returned data from a search search
func Search ¶
Search performs a search against the given elasticsearch index for documents of the given type. The search must json marshal into a valid elasticsearch request body query (see https://www.elastic.co/guide/en/elasticsearch/reference/current/search-request-body.html)