Versions in this module Expand all Collapse all v1 v1.4.2 Jun 8, 2026 v1.4.1 Jun 8, 2026 v1.4.0 Jun 8, 2026 v1.3.3 Jun 8, 2026 v1.3.2 Jun 8, 2026 v1.3.1 Jun 8, 2026 v1.3.0 Jun 8, 2026 v1.2.0 Jun 6, 2026 v1.1.0 Jun 3, 2026 Changes in this version + var ErrClosed = errors.New("search engine closed") + func BuildIndexMapping(defaultAnalyzer string) *mapping.IndexMappingImpl + type ClauseFuzzy struct + Boost *float64 + Field string + Fuzziness int + Prefix int + Term string + type ClauseMatch struct + Boost *float64 + Field string + Operator string + Query string + type ClausePhrase struct + Boost *float64 + Field string + Phrase string + Slop int + type ClausePrefix struct + Boost *float64 + Field string + Prefix string + type ClauseQueryString struct + Boost *float64 + Fields []string + Query string + type ClauseRegex struct + Boost *float64 + Field string + Pattern string + type ClauseWildcard struct + Boost *float64 + Field string + Pattern string + type Config struct + BatchSize int + DefaultAnalyzer string + DefaultSearchFields []string + IndexPath string + OpenTimeout time.Duration + QueryTimeout time.Duration + type Doc struct + Fields map[string]interface{} + ID string + Type string + type Engine interface + Close func() error + Delete func(ctx context.Context, id string) error + GetAutoCompleteSuggestions func(ctx context.Context, keyword string) ([]string, error) + GetSearchSuggestions func(ctx context.Context, keyword string) ([]string, error) + Index func(ctx context.Context, doc Doc) error + IndexBatch func(ctx context.Context, docs []Doc) error + Search func(ctx context.Context, req SearchRequest) (SearchResult, error) + func New(cfg Config, m mapping.IndexMapping) (Engine, error) + type FacetRequest struct + Field string + Name string + Size int + type FacetResult struct + Terms []FacetTerm + Total int + type FacetTerm struct + Count int + Term string + type Hit struct + Fields map[string]any + Fragments map[string][]string + ID string + Score float64 + type NumericRangeFilter struct + Field string + GT *float64 + GTE *float64 + LT *float64 + LTE *float64 + type SearchRequest struct + Facets []FacetRequest + FragmentSize int + From int + Fuzzies []ClauseFuzzy + Highlight bool + HighlightFields []string + IncludeFields []string + Keyword string + Matches []ClauseMatch + MaxFragments int + MinShould int + MustNotTerms map[string][]string + MustTerms map[string][]string + NumericRanges []NumericRangeFilter + Phrases []ClausePhrase + Prefixes []ClausePrefix + QueryString *ClauseQueryString + Regexps []ClauseRegex + SearchFields []string + ShouldTerms map[string][]string + Size int + SortBy []string + TimeRanges []TimeRangeFilter + Wildcards []ClauseWildcard + type SearchResult struct + Facets map[string]FacetResult + Hits []Hit + Took time.Duration + Total uint64 + type TimeRangeFilter struct + Field string + From *time.Time + IncFrom bool + IncTo bool + To *time.Time