Documentation ¶
Index ¶
- type HitItem
- type HitsResultT
- type HitsResultTotalT
- type QueryResultT
- type ZincClient
- func (c *ZincClient) ApiQuery(indexName string, q any) (*QueryResultT, error)
- func (c *ZincClient) BulkPushDoc(docs []map[string]any) (bool, error)
- func (c *ZincClient) CreateIndex(name string, p *ZincIndexProperty) bool
- func (c *ZincClient) DelDoc(indexName, id string) error
- func (c *ZincClient) EsQuery(indexName string, q any) (*QueryResultT, error)
- func (c *ZincClient) ExistIndex(name string) bool
- func (c *ZincClient) PutDoc(name string, id int64, doc any) (bool, error)
- type ZincClientConfig
- type ZincIndex
- type ZincIndexMappings
- type ZincIndexProperty
- type ZincIndexPropertyT
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type HitsResultT ¶
type HitsResultT struct { Total *HitsResultTotalT `json:"total"` MaxScore float64 `json:"max_score"` Hits []*HitItem `json:"hits"` }
type HitsResultTotalT ¶
type HitsResultTotalT struct {
Value int64 `json:"value"`
}
type QueryResultT ¶
type QueryResultT struct { Took int `json:"took"` TimedOut bool `json:"timed_out"` Hits *HitsResultT `json:"hits"` }
type ZincClient ¶
type ZincClient struct {
*ZincClientConfig
}
func (*ZincClient) ApiQuery ¶
func (c *ZincClient) ApiQuery(indexName string, q any) (*QueryResultT, error)
func (*ZincClient) BulkPushDoc ¶
func (c *ZincClient) BulkPushDoc(docs []map[string]any) (bool, error)
批量新增文档
func (*ZincClient) CreateIndex ¶
func (c *ZincClient) CreateIndex(name string, p *ZincIndexProperty) bool
创建索引
func (*ZincClient) DelDoc ¶
func (c *ZincClient) DelDoc(indexName, id string) error
func (*ZincClient) EsQuery ¶
func (c *ZincClient) EsQuery(indexName string, q any) (*QueryResultT, error)
type ZincClientConfig ¶
type ZincIndex ¶
type ZincIndex struct { Name string `json:"name"` StorageType string `json:"storage_type"` Mappings *ZincIndexMappings `json:"mappings"` }
type ZincIndexMappings ¶
type ZincIndexMappings struct {
Properties *ZincIndexProperty `json:"properties"`
}
type ZincIndexProperty ¶
type ZincIndexProperty map[string]*ZincIndexPropertyT
type ZincIndexPropertyT ¶
type ZincIndexPropertyT struct { Type string `json:"type"` Index bool `json:"index"` Store bool `json:"store"` Sortable bool `json:"sortable"` Aggregatable bool `json:"aggregatable"` Highlightable bool `json:"highlightable"` Analyzer string `json:"analyzer"` SearchAnalyzer string `json:"search_analyzer"` Format string `json:"format"` }
Click to show internal directories.
Click to hide internal directories.