Versions in this module Expand all Collapse all v0 v0.8.1 Sep 20, 2019 Changes in this version + const SearchQueryEndCallbackKey + const SearchQueryStartCallbackKey + var Config *configuration + func LoadAndHighlightFields(hit *search.DocumentMatch, req *SearchRequest, indexName string, ...) error + func MemoryNeededForSearchResult(req *SearchRequest) uint64 + func NewBoolFieldQuery(val bool) *query.BoolFieldQuery + func NewBooleanFieldMapping() *mapping.FieldMapping + func NewBooleanQuery() *query.BooleanQuery + func NewConjunctionQuery(conjuncts ...query.Query) *query.ConjunctionQuery + func NewDateRangeInclusiveQuery(start, end time.Time, startInclusive, endInclusive *bool) *query.DateRangeQuery + func NewDateRangeQuery(start, end time.Time) *query.DateRangeQuery + func NewDateTimeFieldMapping() *mapping.FieldMapping + func NewDisjunctionQuery(disjuncts ...query.Query) *query.DisjunctionQuery + func NewDocIDQuery(ids []string) *query.DocIDQuery + func NewDocumentDisabledMapping() *mapping.DocumentMapping + func NewDocumentMapping() *mapping.DocumentMapping + func NewDocumentStaticMapping() *mapping.DocumentMapping + func NewFuzzyQuery(term string) *query.FuzzyQuery + func NewGeoBoundingBoxQuery(topLeftLon, topLeftLat, bottomRightLon, bottomRightLat float64) *query.GeoBoundingBoxQuery + func NewGeoDistanceQuery(lon, lat float64, distance string) *query.GeoDistanceQuery + func NewGeoPointFieldMapping() *mapping.FieldMapping + func NewIndexAlias(indexes ...Index) *indexAliasImpl + func NewIndexMapping() *mapping.IndexMappingImpl + func NewMatchAllQuery() *query.MatchAllQuery + func NewMatchNoneQuery() *query.MatchNoneQuery + func NewMatchPhraseQuery(matchPhrase string) *query.MatchPhraseQuery + func NewMatchQuery(match string) *query.MatchQuery + func NewNumericFieldMapping() *mapping.FieldMapping + func NewNumericRangeInclusiveQuery(min, max *float64, minInclusive, maxInclusive *bool) *query.NumericRangeQuery + func NewNumericRangeQuery(min, max *float64) *query.NumericRangeQuery + func NewPhraseQuery(terms []string, field string) *query.PhraseQuery + func NewPrefixQuery(prefix string) *query.PrefixQuery + func NewQueryStringQuery(q string) *query.QueryStringQuery + func NewRegexpQuery(regexp string) *query.RegexpQuery + func NewTermQuery(term string) *query.TermQuery + func NewTermRangeInclusiveQuery(min, max string, minInclusive, maxInclusive *bool) *query.TermRangeQuery + func NewTermRangeQuery(min, max string) *query.TermRangeQuery + func NewTextFieldMapping() *mapping.FieldMapping + func NewWildcardQuery(wildcard string) *query.WildcardQuery + func SetLog(l *log.Logger) + type Batch struct + func (b *Batch) Delete(id string) + func (b *Batch) DeleteInternal(key []byte) + func (b *Batch) Index(id string, data interface{}) error + func (b *Batch) IndexAdvanced(doc *document.Document) (err error) + func (b *Batch) LastDocSize() uint64 + func (b *Batch) Merge(o *Batch) + func (b *Batch) PersistedCallback() index.BatchCallback + func (b *Batch) Reset() + func (b *Batch) SetInternal(key, val []byte) + func (b *Batch) SetPersistedCallback(f index.BatchCallback) + func (b *Batch) Size() int + func (b *Batch) String() string + func (b *Batch) TotalDocsSize() uint64 + type Error int + const ErrorAliasEmpty + const ErrorAliasMulti + const ErrorEmptyID + const ErrorIndexClosed + const ErrorIndexMetaCorrupt + const ErrorIndexMetaMissing + const ErrorIndexPathDoesNotExist + const ErrorIndexPathExists + const ErrorIndexReadInconsistency + const ErrorUnknownIndexType + const ErrorUnknownStorageType + func (e Error) Error() string + type FacetRequest struct + DateTimeRanges []*dateTimeRange + Field string + NumericRanges []*numericRange + Size int + func NewFacetRequest(field string, size int) *FacetRequest + func (fr *FacetRequest) AddDateTimeRange(name string, start, end time.Time) + func (fr *FacetRequest) AddDateTimeRangeString(name string, start, end *string) + func (fr *FacetRequest) AddNumericRange(name string, min, max *float64) + func (fr *FacetRequest) Validate() error + type FacetsRequest map[string]*FacetRequest + func (fr FacetsRequest) Validate() error + type HighlightRequest struct + Fields []string + Style *string + func NewHighlight() *HighlightRequest + func NewHighlightWithStyle(style string) *HighlightRequest + func (h *HighlightRequest) AddField(field string) + type Index interface + Advanced func() (index.Index, store.KVStore, error) + Batch func(b *Batch) error + Close func() error + Delete func(id string) error + DeleteInternal func(key []byte) error + DocCount func() (uint64, error) + Document func(id string) (*document.Document, error) + FieldDict func(field string) (index.FieldDict, error) + FieldDictPrefix func(field string, termPrefix []byte) (index.FieldDict, error) + FieldDictRange func(field string, startTerm []byte, endTerm []byte) (index.FieldDict, error) + Fields func() ([]string, error) + GetInternal func(key []byte) ([]byte, error) + Index func(id string, data interface{}) error + Mapping func() mapping.IndexMapping + Name func() string + NewBatch func() *Batch + Search func(req *SearchRequest) (*SearchResult, error) + SearchInContext func(ctx context.Context, req *SearchRequest) (*SearchResult, error) + SetInternal func(key, val []byte) error + SetName func(string) + Stats func() *IndexStat + StatsMap func() map[string]interface{} + func New(path string, mapping mapping.IndexMapping) (Index, error) + func NewMemOnly(mapping mapping.IndexMapping) (Index, error) + func NewUsing(path string, mapping mapping.IndexMapping, indexType string, kvstore string, ...) (Index, error) + func Open(path string) (Index, error) + func OpenUsing(path string, runtimeConfig map[string]interface{}) (Index, error) + type IndexAlias interface + Add func(i ...Index) + Remove func(i ...Index) + Swap func(in, out []Index) + type IndexErrMap map[string]error + func (iem IndexErrMap) MarshalJSON() ([]byte, error) + func (iem IndexErrMap) UnmarshalJSON(data []byte) error + type IndexStat struct + func (is *IndexStat) MarshalJSON() ([]byte, error) + type IndexStats struct + func NewIndexStats() *IndexStats + func (i *IndexStats) Register(index Index) + func (i *IndexStats) String() string + func (i *IndexStats) UnRegister(index Index) + type SearchQueryEndCallbackFn func(size uint64) error + type SearchQueryStartCallbackFn func(size uint64) error + type SearchRequest struct + Explain bool + Facets FacetsRequest + Fields []string + From int + Highlight *HighlightRequest + IncludeLocations bool + Query query.Query + Score string + SearchAfter []string + SearchBefore []string + Size int + Sort search.SortOrder + func NewSearchRequest(q query.Query) *SearchRequest + func NewSearchRequestOptions(q query.Query, size, from int, explain bool) *SearchRequest + func (r *SearchRequest) AddFacet(facetName string, f *FacetRequest) + func (r *SearchRequest) SetSearchAfter(after []string) + func (r *SearchRequest) SetSearchBefore(before []string) + func (r *SearchRequest) SortBy(order []string) + func (r *SearchRequest) SortByCustom(order search.SortOrder) + func (r *SearchRequest) UnmarshalJSON(input []byte) error + func (r *SearchRequest) Validate() error + type SearchResult struct + Facets search.FacetResults + Hits search.DocumentMatchCollection + MaxScore float64 + Request *SearchRequest + Status *SearchStatus + Took time.Duration + Total uint64 + func MultiSearch(ctx context.Context, req *SearchRequest, indexes ...Index) (*SearchResult, error) + func (sr *SearchResult) Merge(other *SearchResult) + func (sr *SearchResult) Size() int + func (sr *SearchResult) String() string + type SearchStatus struct + Errors IndexErrMap + Failed int + Successful int + Total int + func (ss *SearchStatus) Merge(other *SearchStatus)