Documentation ¶
Index ¶
- Constants
- Variables
- type CompoundQueries
- type Configuration
- type FacetDef
- type Handler
- func (h *Handler) CompoundSearch(ctx context.Context, index string, q *CompoundQueries) ([]gocb.SearchResultHit, error)
- func (h *Handler) CompoundSearchWithFacets(ctx context.Context, index string, q *CompoundQueries, facets []FacetDef) ([]gocb.SearchResultHit, map[string]gocb.SearchResultFacet, error)
- func (h *Handler) CreateFullTextSearchIndex(ctx context.Context, def *IndexDefinition) error
- func (h *Handler) DeleteFullTextSearchIndex(ctx context.Context, indexName string) error
- func (h *Handler) Get(ctx context.Context, typ, id string, ptr interface{}) error
- func (h *Handler) GetAndTouch(ctx context.Context, typ, id string, ptr interface{}, ttl int) error
- func (h *Handler) GetManager(ctx context.Context) *gocb.BucketManager
- func (h *Handler) Index(ctx context.Context, v interface{}) error
- func (h *Handler) Insert(ctx context.Context, typ, id string, q interface{}) (string, error)
- func (h *Handler) InspectFullTextSearchIndex(ctx context.Context, indexName string) (bool, *IndexDefinition, error)
- func (h *Handler) Ping(ctx context.Context, services []gocb.ServiceType) (*gocb.PingReport, error)
- func (h *Handler) RangeSearch(ctx context.Context, index string, q *RangeQuery) ([]gocb.SearchResultHit, error)
- func (h *Handler) RangeSearchWithFacets(ctx context.Context, index string, q *RangeQuery, facets []FacetDef) ([]gocb.SearchResultHit, map[string]gocb.SearchResultFacet, error)
- func (h *Handler) Remove(ctx context.Context, typ, id string, ptr interface{}) error
- func (h *Handler) SetDocumentType(ctx context.Context, name, prefix string) error
- func (h *Handler) SimpleSearch(ctx context.Context, index string, q *SearchQuery) ([]gocb.SearchResultHit, error)
- func (h *Handler) SimpleSearchWithFacets(ctx context.Context, index string, q *SearchQuery, facets []FacetDef) ([]gocb.SearchResultHit, map[string]gocb.SearchResultFacet, error)
- func (h *Handler) Touch(ctx context.Context, typ, id string, ptr interface{}, ttl int) error
- func (h *Handler) Upsert(ctx context.Context, typ, id string, q interface{}, ttl uint32) (string, error)
- func (h *Handler) ValidateState() (bool, error)
- type IndexDefaultMapping
- type IndexDefinition
- type IndexDefs
- type IndexDocConfig
- type IndexMapping
- type IndexMeta
- type IndexParams
- type IndexPlanParams
- type IndexStore
- type RangeQuery
- type SearchQuery
Constants ¶
View Source
const ( FacetDate = iota FacetNumeric FacetTerm )
Variables ¶
View Source
var ( ErrDocumentTypeAlredyExists = errors.New("document type alredy exists") ErrDocumentTypeDoesntExists = errors.New("document type doesn't exist") ErrEmptyField = errors.New("field must be filled") ErrEmptyIndex = errors.New("index must be filled") ErrEmptyType = errors.New("source type must set") ErrEmptySource = errors.New("source name must set") ErrConjunctionAndDisjunktionIsNil = errors.New("conjunction and disjunction are nil") ErrEndAsTimeZero = errors.New("endAsTime is zero instant") ErrFirstParameterNotStruct = errors.New("first parameter is not a struct") ErrInputStructPointer = errors.New("input struct must be pointer") )
Functions ¶
This section is empty.
Types ¶
type CompoundQueries ¶
type CompoundQueries struct { Conjunction []SearchQuery `json:"conjuncts,omitempty"` Disjunction []SearchQuery `json:"disjuncts,omitempty"` Limit int `json:"-"` Offset int `json:"-"` }
func (*CompoundQueries) Setup ¶
func (c *CompoundQueries) Setup() error
type Configuration ¶
type Handler ¶
type Handler struct {
// contains filtered or unexported fields
}
func New ¶
func New(c *Configuration) (*Handler, error)
func (*Handler) CompoundSearch ¶
func (h *Handler) CompoundSearch(ctx context.Context, index string, q *CompoundQueries) ([]gocb.SearchResultHit, error)
func (*Handler) CompoundSearchWithFacets ¶
func (h *Handler) CompoundSearchWithFacets(ctx context.Context, index string, q *CompoundQueries, facets []FacetDef) ([]gocb.SearchResultHit, map[string]gocb.SearchResultFacet, error)
func (*Handler) CreateFullTextSearchIndex ¶
func (h *Handler) CreateFullTextSearchIndex(ctx context.Context, def *IndexDefinition) error
func (*Handler) DeleteFullTextSearchIndex ¶
func (*Handler) GetAndTouch ¶
func (*Handler) GetManager ¶
func (h *Handler) GetManager(ctx context.Context) *gocb.BucketManager
func (*Handler) InspectFullTextSearchIndex ¶
func (*Handler) Ping ¶
func (h *Handler) Ping(ctx context.Context, services []gocb.ServiceType) (*gocb.PingReport, error)
func (*Handler) RangeSearch ¶
func (h *Handler) RangeSearch(ctx context.Context, index string, q *RangeQuery) ([]gocb.SearchResultHit, error)
func (*Handler) RangeSearchWithFacets ¶
func (h *Handler) RangeSearchWithFacets(ctx context.Context, index string, q *RangeQuery, facets []FacetDef) ([]gocb.SearchResultHit, map[string]gocb.SearchResultFacet, error)
func (*Handler) SetDocumentType ¶
func (*Handler) SimpleSearch ¶
func (h *Handler) SimpleSearch(ctx context.Context, index string, q *SearchQuery) ([]gocb.SearchResultHit, error)
func (*Handler) SimpleSearchWithFacets ¶
func (h *Handler) SimpleSearchWithFacets(ctx context.Context, index string, q *SearchQuery, facets []FacetDef) ([]gocb.SearchResultHit, map[string]gocb.SearchResultFacet, error)
func (*Handler) ValidateState ¶
type IndexDefaultMapping ¶
type IndexDefinition ¶
type IndexDefinition struct { Type string `json:"type"` Name string `json:"name"` SourceType string `json:"sourceType"` SourceName string `json:"sourceName"` PlanParams IndexPlanParams `json:"planParams"` Params IndexParams `json:"params"` }
func DefaultFullTextSearchIndexDefinition ¶
func DefaultFullTextSearchIndexDefinition(meta IndexMeta) (*IndexDefinition, error)
type IndexDefs ¶
type IndexDefs struct { UUID string `json:"uuid"` IndexDefs map[string]IndexDefinition `json:"indexDefs"` }
type IndexDocConfig ¶
type IndexMapping ¶
type IndexMapping struct { DefaultAnalyzer string `json:"default_analyzer"` DefaultDatetimeParser string `json:"default_datetime_parser"` DefaultField string `json:"default_field"` DefaultMapping IndexDefaultMapping `json:"default_mapping"` DefaultType string `json:"default_type"` DocvaluesDynamic bool `json:"docvalues_dynamic"` IndexDynamic bool `json:"index_dynamic"` StoreDynamic bool `json:"store_dynamic"` TypeField string `json:"type_field"` }
type IndexParams ¶
type IndexParams struct { DocConfig IndexDocConfig `json:"doc_config"` Mapping IndexMapping `json:"mapping"` Store IndexStore `json:"store"` }
type IndexPlanParams ¶
type IndexPlanParams struct {
MaxPartitionsPerPIndex int64 `json:"maxPartitionsPerPIndex"`
}
type IndexStore ¶
type RangeQuery ¶
type RangeQuery struct { StartAsTime time.Time `json:"-"` EndAsTime time.Time `json:"-"` Start string `json:"start,omitempty"` End string `json:"end,omitempty"` Min int64 `json:"min,omitempty"` Max int64 `json:"max,omitempty"` InclusiveStart bool `json:"inclusive_start,omitempty"` InclusiveEnd bool `json:"inclusive_end,omitempty"` InclusiveMin bool `json:"inclusive_min,omitempty"` InclusiveMax bool `json:"inclusive_max,omitempty"` Field string `json:"field,omitempty"` Limit int `json:"-"` Offset int `json:"-"` }
func (*RangeQuery) Setup ¶
func (d *RangeQuery) Setup() error
type SearchQuery ¶
type SearchQuery struct { Query string `json:"query,omitempty"` Match string `json:"match,omitempty"` MatchPhrase string `json:"match_phrase,omitempty"` Term string `json:"term,omitempty"` Prefix string `json:"prefix,omitempty"` Regexp string `json:"regexp,omitempty"` Wildcard string `json:"wildcard,omitempty"` Field string `json:"field,omitempty"` Analyzer string `json:"analyzer,omitempty"` Fuzziness int64 `json:"fuzziness,omitempty"` PrefixLength int64 `json:"prefix_length,omitempty"` Limit int `json:"-"` Offset int `json:"-"` }
func (*SearchQuery) Setup ¶
func (s *SearchQuery) Setup() error
Click to show internal directories.
Click to hide internal directories.