assoc

package
v1.4.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 20, 2026 License: Apache-2.0 Imports: 20 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package assoc implements the Elasticsearch "associated terms" features (more_like_this, suggesters, significant_terms) as pure functions over riot readers.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MoreLikeThis

func MoreLikeThis(ctx context.Context, readers []*riot.Reader, body map[string]interface{}, mappings *meta.Mappings, analyzers map[string]*analysis.Analyzer) (map[string]interface{}, error)

MoreLikeThis rewrites the body of a {"more_like_this": body} query into a plain bool query of the most interesting terms of the liked texts and documents, scored by tf*idf as Lucene MoreLikeThis does. It returns {"match_none": {}} when no term qualifies.

func SignificantTerms

func SignificantTerms(ctx context.Context, readers []*riot.Reader, aggs map[string]meta.AggregationResponse, req map[string]meta.Aggregations, fgCount uint64, mappings *meta.Mappings, analyzers map[string]*analysis.Analyzer) error

SignificantTerms rewrites the responses of the significant_terms and significant_text aggregations of req, collected by aggregation.Request as terms aggregations, into significance buckets: the foreground counts are scored against the background frequencies of the terms in the readers (or in the documents matching background_filter). fgCount is the number of documents matched by the search; nested aggregations use the doc_count of their parent bucket as foreground size. The readers are those of the search, so a time range query narrows the background to the shards in it.

func Suggest

func Suggest(ctx context.Context, readers []*riot.Reader, suggest map[string]interface{}, mappings *meta.Mappings, analyzers map[string]*analysis.Analyzer) (map[string]interface{}, error)

Suggest runs the "suggest" section of a search body and returns the Elasticsearch "suggest" response: {"name": [{text, offset, length, options}]}. It supports the term, phrase (simplified, see phraseSuggest) and completion suggesters.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL