Documentation ¶
Index ¶
- func GetResults[T any](es *elasticsearch.Client, o ...func(*esapi.SearchRequest)) ([]T, error)
- func StoreDocument(ctx context.Context, es *elasticsearch.Client, index string, documentID string, ...) error
- type ESError
- type ESResult
- type ErrorData
- type Hit
- type HitsData
- type ShardsData
- type TotalData
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetResults ¶
func GetResults[T any]( es *elasticsearch.Client, o ...func(*esapi.SearchRequest), ) ([]T, error)
GetResults returns the search results from an ES search
func StoreDocument ¶
func StoreDocument( ctx context.Context, es *elasticsearch.Client, index string, documentID string, document interface{}, refresh bool, ) error
StoreDocument stores a single document on an ES index
Types ¶
type ESResult ¶
type ESResult[T any] struct { Took int64 `json:"took"` TimeOut bool `json:"timed_out"` Shards ShardsData `json:"_shards"` Hits HitsData[T] `json:"hits"` }
type ShardsData ¶
Click to show internal directories.
Click to hide internal directories.