Documentation
¶
Index ¶
- Constants
- func BuildBulkBody(obs ...interface{}) (bulk []byte)
- func BulkIndex(itemsTotal int, items []*item.Item) error
- func Call(method, url string, body []byte) (respBody []byte, statusCode int, err error)
- func CreateIndex()
- func Index(a IndexArgs)
- func KagomeV2Tokenizer() *tokenizer.Tokenizer
- func Refresh(index string)
- func ToJSON(o interface{}) []byte
- func ToPrettyJSON(o interface{}) []byte
- type Aggs
- type AttributeFacet
- type CategoryFacet
- type Conditions
- type ESIndexStats
- type IndexArgs
- type Map
- type QueryArgs
- type QueryResult
- type SearchResult
Constants ¶
View Source
const ( Host = "http://127.0.0.1:9200" ItemsNoDescIndexName = "items_no_desc" DebugPrint = true )
Variables ¶
This section is empty.
Functions ¶
func BuildBulkBody ¶
func BuildBulkBody(obs ...interface{}) (bulk []byte)
func CreateIndex ¶
func CreateIndex()
func KagomeV2Tokenizer ¶
func ToPrettyJSON ¶
func ToPrettyJSON(o interface{}) []byte
Types ¶
type AttributeFacet ¶
type CategoryFacet ¶
type Conditions ¶
type ESIndexStats ¶
type ESIndexStats struct { All struct { Primaries struct { Docs struct { Count int64 `json:"count"` } `json:"docs"` Store struct { SizeInBytes int64 `json:"size_in_bytes"` TotalDataSetSizeInBytes int64 `json:"total_data_set_size_in_bytes"` } `json:"store"` QueryCache struct { CacheCount int64 `json:"cache_count"` CacheSize int64 `json:"cache_size"` Evictions int64 `json:"evictions"` HitCount int64 `json:"hit_count"` MemSizeInBytes int64 `json:"memory_size_in_bytes"` MissCount int64 `json:"miss_count"` TotalCount int64 `json:"total_count"` } `json:"query_cache"` RequestCache struct { Evictions int64 `json:"evictions"` HitCount int64 `json:"hit_count"` MemSizeInBytes int64 `json:"memory_size_in_bytes"` MissCount int64 `json:"miss_count"` } `json:"request_cache"` } `json:"primaries"` } `json:"_all"` }
func IndexStats ¶
func IndexStats(index string) *ESIndexStats
type QueryResult ¶
type QueryResult struct { TotalHits int Size int From int Items []*item.Item ItemIDs []string Scores []float64 CategoryFacets []*CategoryFacet AttributeFacets []*AttributeFacet }
func Query ¶
func Query(a QueryArgs) (*QueryResult, error)
type SearchResult ¶
type SearchResult struct { Took int64 `json:"took"` // 2 Hits struct { Total struct { Value int64 `json:"value"` Relation string `json:"relation"` } `json:"total"` Hits []struct { Index string `json:"_index"` // "test" ID string `json:"_id"` // "102" Score float64 `json:"_score"` // 10.781843 Source *item.Item `json:"_source"` } `json:"hits"` } `json:"hits"` Aggs map[string]*Aggs `json:"aggregations"` }
Click to show internal directories.
Click to hide internal directories.