Documentation
¶
Index ¶
- Constants
- type Analysis
- type Analyzer
- type AnalyzerType
- type BulkIndexJob
- type DateHistogram
- type DateHistogramFacet
- type DateHistogramFacetEntry
- type Doc
- type DynamicTemplate
- type DynamicTemplateMapping
- type DynamicTemplates
- type Entries
- type Entry
- type Facet
- type FacetResponseTerm
- type FacetResponseTerms
- type FacetTerm
- type FacetTerms
- type Facets
- type Filter
- type Filtered
- type Hit
- type Hits
- type HttpResponse
- type Index
- func (index *Index) BaseUrl() string
- func (index *Index) CreateIndex(config IndexConfig) (rsp *HttpResponse, e error)
- func (index *Index) DeleteByQuery(query string) (b []byte, e error)
- func (index *Index) DeleteIndex() error
- func (index *Index) EnqueueBulkIndex(key string, record interface{}) (bool, error)
- func (index *Index) EnqueueDoc(doc *Doc) (indexed bool, e error)
- func (index *Index) GlobalMapping() (m *Mapping, e error)
- func (index *Index) IndexDocs(docs []*Doc) error
- func (index *Index) IndexExists() (exists bool, e error)
- func (index *Index) IndexUrl() string
- func (index *Index) LogDebug(format string, i ...interface{})
- func (index *Index) LogInfo(format string, i ...interface{})
- func (index *Index) Mapping() (i interface{}, e error)
- func (index *Index) Post(u string, i interface{}) (*HttpResponse, error)
- func (index *Index) PostObject(i interface{}) (*HttpResponse, error)
- func (index *Index) Put(u string, i interface{}) (*HttpResponse, error)
- func (index *Index) PutMapping(mapping interface{}) (rsp *HttpResponse, e error)
- func (index *Index) PutObject(id string, i interface{}) (*HttpResponse, error)
- func (index *Index) Refresh() error
- func (index *Index) ResetBatch()
- func (index *Index) RunBatchIndex() error
- func (index *Index) Search(req *Request) (rsp *Response, e error)
- func (index *Index) Status() (status *Status, e error)
- func (index *Index) TypeUrl() string
- type IndexConfig
- type IndexIndexConfig
- type IndexMapping
- type IndexMappingProperties
- type IndexMappingProperty
- type IndexMappings
- type Indexer
- type IndexerStats
- type Logger
- type Mapping
- type Query
- type QueryString
- type Range
- type Request
- type RequestFacet
- type Response
- type ResponseFacet
- type ResponseFacets
- type Shards
- type Sort
- type SortCriteria
- type Source
- type StatisticalFacet
- type Status
- type Term
- type Terms
- type TermsFacet
Constants ¶
View Source
const ( OK = '2' AND = "AND" OR = "OR" )
View Source
const ( Asc = "asc" Desc = "desc" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Analyzer ¶
type Analyzer struct {
Default AnalyzerType `json:"default"`
}
type AnalyzerType ¶
type BulkIndexJob ¶
type DateHistogram ¶
type DateHistogramFacet ¶
type DateHistogramFacet struct { Type string `json:"term,omitempty"` Entries []*DateHistogramFacetEntry `json:"entries,omitempty"` }
func (*DateHistogramFacet) Load ¶
func (dhf *DateHistogramFacet) Load(m map[string]interface{}) error
type DateHistogramFacetEntry ¶
type Doc ¶
func (*Doc) IndexAttributes ¶
type DynamicTemplate ¶
type DynamicTemplate struct { Match string `json:"match,omitempty"` MatchMappingType string `json:"match_mapping_type,omitempty"` Mapping *DynamicTemplateMapping `json:"mapping,omitempty"` }
type DynamicTemplateMapping ¶
type DynamicTemplates ¶
type DynamicTemplates []map[string]DynamicTemplate
type Entry ¶
type Facet ¶
type Facet struct { Type string `json:"_type,omitempty"` Missing int `json:"missing,omitempty"` Total int `json:"total,omitempty"` Other int `json:"other,omitempty"` Terms *FacetTerms `json:"terms,omitempty"` *Entries `json:"entries,omitempty"` *DateHistogram `json:"date_histogram,omitempty"` Statistical *StatisticalFacet `json:"statistical,omitempty"` }
type FacetResponseTerm ¶
type FacetResponseTerm struct { Term interface{} Count int64 }
type FacetResponseTerms ¶
type FacetResponseTerms []*FacetResponseTerm
type FacetTerms ¶
type HttpResponse ¶
type Index ¶
type Index struct { Host string Port int Index string Type string BatchSize int Debug bool Logger Logger // contains filtered or unexported fields }
func (*Index) CreateIndex ¶
func (index *Index) CreateIndex(config IndexConfig) (rsp *HttpResponse, e error)
func (*Index) DeleteIndex ¶
func (*Index) EnqueueBulkIndex ¶
func (*Index) GlobalMapping ¶
func (*Index) IndexExists ¶
func (*Index) PostObject ¶
func (index *Index) PostObject(i interface{}) (*HttpResponse, error)
func (*Index) PutMapping ¶
func (index *Index) PutMapping(mapping interface{}) (rsp *HttpResponse, e error)
func (*Index) PutObject ¶
func (index *Index) PutObject(id string, i interface{}) (*HttpResponse, error)
func (*Index) ResetBatch ¶
func (index *Index) ResetBatch()
func (*Index) RunBatchIndex ¶
type IndexConfig ¶
type IndexConfig struct {
Index IndexIndexConfig `json:"index"`
}
func KeywordIndex ¶
func KeywordIndex() IndexConfig
type IndexIndexConfig ¶
type IndexIndexConfig struct {
Analysis Analysis `json:"analysis"`
}
type IndexMapping ¶
type IndexMapping struct {
Properties *IndexMappingProperties
}
type IndexMappingProperties ¶
type IndexMappingProperties map[string]IndexMappingProperty
type IndexMappingProperty ¶
type IndexMappings ¶
type IndexMappings map[string]*IndexMapping
type Indexer ¶
type Indexer struct { Index *Index IndexEvery time.Duration // triggers a new index run after that duration, will be reset when BatchSize reached BatchSize int // triggers a new index run when the batch reaches that size Stats IndexerStats // contains filtered or unexported fields }
type IndexerStats ¶
type Query ¶
type Query struct { Filtered *Filtered `json:"filtered,omitempty"` QueryString *QueryString `json:"query_string,omitempty"` }
type QueryString ¶
type Request ¶
type RequestFacet ¶
type RequestFacet struct { *Terms `json:"terms,omitempty"` *DateHistogram `json:"date_histogram,omitempty"` }
type Response ¶
type Response struct { Took int `json:"took"` TimedOut bool `json:"timed_out"` Facets ResponseFacets `json:"facets"` Hits Hits `json:"hits"` }
type ResponseFacet ¶
type ResponseFacets ¶
type ResponseFacets map[string]*ResponseFacet
type Sort ¶
type Sort map[string]*SortCriteria
type SortCriteria ¶
type SortCriteria struct {
Order string `json:"order,omitempty"`
}
type StatisticalFacet ¶
type StatisticalFacet struct { Type string `json:"_type,omitempty"` Count int64 `json:"count,omitempty"` Total int64 `json:"total,omitempty"` Min float64 `json:"min,omitempty"` Max float64 `json:"max,omitempty"` Mean float64 `json:"mean,omitempty"` SumOfSquares float64 `json:"sum_of_squares,omitempty"` Variance float64 `json:"variance,omitempty"` StdDeviation float64 `json:"std_deviation,omitempty"` }
func (*StatisticalFacet) Load ¶
func (sf *StatisticalFacet) Load(m map[string]interface{}) error
type TermsFacet ¶
type TermsFacet struct { Type string `json:"_type,omitempty"` Missing int64 `json:"missing,omitempty"` Total int64 `json:"total,omitempty"` Other int64 `json:"other,omitempty"` Terms FacetResponseTerms `json:"terms,omitempty"` }
func (*TermsFacet) Load ¶
func (tf *TermsFacet) Load(m map[string]interface{}) error
Click to show internal directories.
Click to hide internal directories.