elastic.v1: gopkg.in/olivere/elastic.v1 Index | Examples | Files | Directories

package elastic

import "gopkg.in/olivere/elastic.v1"

Package elastic provides an interface to the Elasticsearch server (http://www.elasticsearch.org/).

Notice: This is version 1 of Elastic. There are newer versions of Elastic available on GitHub at https://github.com/olivere/elastic. Version 1 is maintained, but new development happens in newer versions.

The first thing you do is to create a Client. The client takes a http.Client and (optionally) a list of URLs to the Elasticsearch servers as arguments. If the list of URLs is empty, http://localhost:9200 is used by default. You typically create one client for your app.

client, err := elastic.NewClient(http.DefaultClient)
if err != nil {
	// Handle error
}

Notice that you can pass your own http.Client implementation here. You can also pass more than one URL to a client. Elastic pings the URLs periodically and takes the first to succeed. By doing this periodically, Elastic provides automatic failover, e.g. when an Elasticsearch server goes down during updates.

If no Elasticsearch server is available, services will fail when creating a new request and will return ErrNoClient. While this method is not very sophisticated and might result in timeouts, it is robust enough for our use cases. Pull requests are welcome.

client, err := elastic.NewClient(http.DefaultClient, "http://1.2.3.4:9200", "http://1.2.3.5:9200")
if err != nil {
	// Handle error
}

A Client provides services. The services usually come with a variety of methods to prepare the query and a Do function to execute it against the Elasticsearch REST interface and return a response. Here is an example of the IndexExists service that checks if a given index already exists.

exists, err := client.IndexExists("twitter").Do()
if err != nil {
	// Handle error
}
if !exists {
	// Index does not exist yet.
}

Look up the documentation for Client to get an idea of the services provided and what kinds of responses you get when executing the Do function of a service.

Code:

// Obtain a client. You can provide your own HTTP client here.
client, err := elastic.NewClient(http.DefaultClient)
if err != nil {
    // Handle error
    panic(err)
}

// Ping the Elasticsearch server to get e.g. the version number
info, code, err := client.Ping().Do()
if err != nil {
    // Handle error
    panic(err)
}
fmt.Printf("Elasticsearch returned with code %d and version %s", code, info.Version.Number)

// Getting the ES version number is quite common, so there's a shortcut
esversion, err := client.ElasticsearchVersion("http://127.0.0.1:9200")
if err != nil {
    // Handle error
    panic(err)
}
fmt.Printf("Elasticsearch version %s", esversion)

// Use the IndexExists service to check if a specified index exists.
exists, err := client.IndexExists("twitter").Do()
if err != nil {
    // Handle error
    panic(err)
}
if !exists {
    // Create a new index.
    createIndex, err := client.CreateIndex("twitter").Do()
    if err != nil {
        // Handle error
        panic(err)
    }
    if !createIndex.Acknowledged {
        // Not acknowledged
    }
}

// Index a tweet (using JSON serialization)
tweet1 := Tweet{User: "olivere", Message: "Take Five", Retweets: 0}
put1, err := client.Index().
    Index("twitter").
    Type("tweet").
    Id("1").
    BodyJson(tweet1).
    Do()
if err != nil {
    // Handle error
    panic(err)
}
fmt.Printf("Indexed tweet %s to index %s, type %s\n", put1.Id, put1.Index, put1.Type)

// Index a second tweet (by string)
tweet2 := `{"user" : "olivere", "message" : "It's a Raggy Waltz"}`
put2, err := client.Index().
    Index("twitter").
    Type("tweet").
    Id("2").
    BodyString(tweet2).
    Do()
if err != nil {
    // Handle error
    panic(err)
}
fmt.Printf("Indexed tweet %s to index %s, type %s\n", put2.Id, put2.Index, put2.Type)

// Get tweet with specified ID
get1, err := client.Get().
    Index("twitter").
    Type("tweet").
    Id("1").
    Do()
if err != nil {
    // Handle error
    panic(err)
}
if get1.Found {
    fmt.Printf("Got document %s in version %d from index %s, type %s\n", get1.Id, get1.Version, get1.Index, get1.Type)
}

// Flush to make sure the documents got written.
_, err = client.Flush().Index("twitter").Do()
if err != nil {
    panic(err)
}

// Search with a term query
termQuery := elastic.NewTermQuery("user", "olivere")
searchResult, err := client.Search().
    Index("twitter").   // search in index "twitter"
    Query(&termQuery).  // specify the query
    Sort("user", true). // sort by "user" field, ascending
    From(0).Size(10).   // take documents 0-9
    Debug(true).        // print request and response to stdout
    Pretty(true).       // pretty print request and response JSON
    Do()                // execute
if err != nil {
    // Handle error
    panic(err)
}

// searchResult is of type SearchResult and returns hits, suggestions,
// and all kinds of other information from Elasticsearch.
fmt.Printf("Query took %d milliseconds\n", searchResult.TookInMillis)

// Number of hits
if searchResult.Hits != nil {
    fmt.Printf("Found a total of %d tweets\n", searchResult.Hits.TotalHits)

    // Iterate through results
    for _, hit := range searchResult.Hits.Hits {
        // hit.Index contains the name of the index

        // Deserialize hit.Source into a Tweet (could also be just a map[string]interface{}).
        var t Tweet
        err := json.Unmarshal(*hit.Source, &t)
        if err != nil {
            // Deserialization failed
        }

        // Work with tweet
        fmt.Printf("Tweet by %s: %s\n", t.User, t.Message)
    }
} else {
    // No hits
    fmt.Print("Found no tweets\n")
}

// Update a tweet by the update API of Elasticsearch.
// We just increment the number of retweets.
update, err := client.Update().Index("twitter").Type("tweet").Id("1").
    Script("ctx._source.retweets += num").
    ScriptParams(map[string]interface{}{"num": 1}).
    Upsert(map[string]interface{}{"retweets": 0}).
    Do()
if err != nil {
    // Handle error
    panic(err)
}
fmt.Printf("New version of tweet %q is now %d", update.Id, update.Version)

// ...

// Delete an index.
deleteIndex, err := client.DeleteIndex("twitter").Do()
if err != nil {
    // Handle error
    panic(err)
}
if !deleteIndex.Acknowledged {
    // Not acknowledged
}

Index

Examples

Package Files

alias.go aliases.go bulk.go bulk_delete_request.go bulk_index_request.go bulk_request.go bulk_update_request.go client.go cluster_health.go cluster_state.go count.go create_index.go delete.go delete_by_query.go delete_index.go delete_template.go doc.go errors.go exists.go fetch_source_context.go filter.go flush.go geo_point.go get.go get_template.go highlight.go index.go index_close.go index_exists.go index_open.go multi_get.go multi_search.go optimize.go ping.go put_template.go query.go refresh.go request.go rescore.go rescorer.go scan.go scroll.go search.go search_aggs.go search_aggs_avg.go search_aggs_cardinality.go search_aggs_children.go search_aggs_date_histogram.go search_aggs_date_range.go search_aggs_extended_stats.go search_aggs_filter.go search_aggs_filters.go search_aggs_geo_bounds.go search_aggs_geo_distance.go search_aggs_global.go search_aggs_histogram.go search_aggs_max.go search_aggs_min.go search_aggs_missing.go search_aggs_nested.go search_aggs_percentile_ranks.go search_aggs_percentiles.go search_aggs_range.go search_aggs_significant_terms.go search_aggs_stats.go search_aggs_sum.go search_aggs_terms.go search_aggs_tophits.go search_aggs_value_count.go search_facets.go search_facets_date_histogram.go search_facets_filter.go search_facets_geo_distance.go search_facets_histogram.go search_facets_histogram_script.go search_facets_query.go search_facets_range.go search_facets_statistical.go search_facets_statistical_script.go search_facets_terms.go search_facets_terms_stats.go search_filters_and.go search_filters_bool.go search_filters_exists.go search_filters_geo_polygon.go search_filters_has_child.go search_filters_has_parent.go search_filters_ids.go search_filters_limit.go search_filters_match_all.go search_filters_missing.go search_filters_nested.go search_filters_not.go search_filters_or.go search_filters_prefix.go search_filters_query.go search_filters_range.go search_filters_regexp.go search_filters_term.go search_filters_terms.go search_filters_type.go search_queries_bool.go search_queries_boosting.go search_queries_common.go search_queries_custom_filters_score.go search_queries_custom_score.go search_queries_dis_max.go search_queries_filtered.go search_queries_fsq.go search_queries_fsq_score_funcs.go search_queries_fuzzy.go search_queries_fuzzy_like_this.go search_queries_fuzzy_like_this_field_query.go search_queries_has_child.go search_queries_has_parent.go search_queries_ids.go search_queries_match.go search_queries_match_all.go search_queries_more_like_this.go search_queries_more_like_this_field.go search_queries_multi_match.go search_queries_nested.go search_queries_prefix.go search_queries_query_string.go search_queries_range.go search_queries_regexp.go search_queries_simple_query_string.go search_queries_template_query.go search_queries_term.go search_queries_terms.go search_queries_wildcard.go search_request.go search_source.go sort.go suggest.go suggest_field.go suggester.go suggester_completion.go suggester_completion_fuzzy.go suggester_context.go suggester_context_category.go suggester_context_geo.go suggester_phrase.go suggester_term.go update.go

Constants

const (
    // Version is the current version of Elastic.
    Version = "1.3.1"
)

Variables

var (
    // End of stream (or scan)
    EOS = errors.New("EOS")

    // No ScrollId
    ErrNoScrollId = errors.New("elastic: No scrollId")
)
var (
    // ErrNoClient is raised when no active Elasticsearch client is available.
    ErrNoClient = errors.New("no active client")
)

type Aggregation Uses

type Aggregation interface {
    Source() interface{}
}

Aggregations can be seen as a unit-of-work that build analytic information over a set of documents. It is (in many senses) the follow-up of facets in Elasticsearch. For more details about aggregations, visit: http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/search-aggregations.html

type AggregationBucketFilters Uses

type AggregationBucketFilters struct {
    Aggregations

    Buckets      []*AggregationBucketKeyItem          //`json:"buckets"`
    NamedBuckets map[string]*AggregationBucketKeyItem //`json:"buckets"`
}

AggregationBucketFilters is a multi-bucket aggregation that is returned with a filters aggregation.

func (*AggregationBucketFilters) UnmarshalJSON Uses

func (a *AggregationBucketFilters) UnmarshalJSON(data []byte) error

UnmarshalJSON decodes JSON data and initializes an AggregationBucketFilters structure.

type AggregationBucketHistogramItem Uses

type AggregationBucketHistogramItem struct {
    Aggregations

    Key         int64   //`json:"key"`
    KeyAsString *string //`json:"key_as_string"`
    DocCount    int64   //`json:"doc_count"`
}

AggregationBucketHistogramItem is a single bucket of an AggregationBucketHistogramItems structure.

func (*AggregationBucketHistogramItem) UnmarshalJSON Uses

func (a *AggregationBucketHistogramItem) UnmarshalJSON(data []byte) error

UnmarshalJSON decodes JSON data and initializes an AggregationBucketHistogramItem structure.

type AggregationBucketHistogramItems Uses

type AggregationBucketHistogramItems struct {
    Aggregations

    Buckets []*AggregationBucketHistogramItem //`json:"buckets"`
}

AggregationBucketHistogramItems is a bucket aggregation that is returned with a date histogram aggregation.

func (*AggregationBucketHistogramItems) UnmarshalJSON Uses

func (a *AggregationBucketHistogramItems) UnmarshalJSON(data []byte) error

UnmarshalJSON decodes JSON data and initializes an AggregationBucketHistogramItems structure.

type AggregationBucketKeyItem Uses

type AggregationBucketKeyItem struct {
    Aggregations

    Key       interface{} //`json:"key"`
    KeyNumber json.Number
    DocCount  int64 //`json:"doc_count"`
}

AggregationBucketKeyItem is a single bucket of an AggregationBucketKeyItems structure.

func (*AggregationBucketKeyItem) UnmarshalJSON Uses

func (a *AggregationBucketKeyItem) UnmarshalJSON(data []byte) error

UnmarshalJSON decodes JSON data and initializes an AggregationBucketKeyItem structure.

type AggregationBucketKeyItems Uses

type AggregationBucketKeyItems struct {
    Aggregations

    DocCountErrorUpperBound int64                       //`json:"doc_count_error_upper_bound"`
    SumOfOtherDocCount      int64                       //`json:"sum_other_doc_count"`
    Buckets                 []*AggregationBucketKeyItem //`json:"buckets"`
}

AggregationBucketKeyItems is a bucket aggregation that is e.g. returned with a terms aggregation.

func (*AggregationBucketKeyItems) UnmarshalJSON Uses

func (a *AggregationBucketKeyItems) UnmarshalJSON(data []byte) error

UnmarshalJSON decodes JSON data and initializes an AggregationBucketKeyItems structure.

type AggregationBucketRangeItem Uses

type AggregationBucketRangeItem struct {
    Aggregations

    Key          string   //`json:"key"`
    DocCount     int64    //`json:"doc_count"`
    From         *float64 //`json:"from"`
    FromAsString string   //`json:"from_as_string"`
    To           *float64 //`json:"to"`
    ToAsString   string   //`json:"to_as_string"`
}

AggregationBucketRangeItem is a single bucket of an AggregationBucketRangeItems structure.

func (*AggregationBucketRangeItem) UnmarshalJSON Uses

func (a *AggregationBucketRangeItem) UnmarshalJSON(data []byte) error

UnmarshalJSON decodes JSON data and initializes an AggregationBucketRangeItem structure.

type AggregationBucketRangeItems Uses

type AggregationBucketRangeItems struct {
    Aggregations

    DocCountErrorUpperBound int64                         //`json:"doc_count_error_upper_bound"`
    SumOfOtherDocCount      int64                         //`json:"sum_other_doc_count"`
    Buckets                 []*AggregationBucketRangeItem //`json:"buckets"`
}

AggregationBucketRangeItems is a bucket aggregation that is e.g. returned with a range aggregation.

func (*AggregationBucketRangeItems) UnmarshalJSON Uses

func (a *AggregationBucketRangeItems) UnmarshalJSON(data []byte) error

UnmarshalJSON decodes JSON data and initializes an AggregationBucketRangeItems structure.

type AggregationBucketSignificantTerm Uses

type AggregationBucketSignificantTerm struct {
    Aggregations

    Key      string  //`json:"key"`
    DocCount int64   //`json:"doc_count"`
    BgCount  int64   //`json:"bg_count"`
    Score    float64 //`json:"score"`
}

AggregationBucketSignificantTerm is a single bucket of an AggregationBucketSignificantTerms structure.

func (*AggregationBucketSignificantTerm) UnmarshalJSON Uses

func (a *AggregationBucketSignificantTerm) UnmarshalJSON(data []byte) error

UnmarshalJSON decodes JSON data and initializes an AggregationBucketSignificantTerm structure.

type AggregationBucketSignificantTerms Uses

type AggregationBucketSignificantTerms struct {
    Aggregations

    DocCount int64                               //`json:"doc_count"`
    Buckets  []*AggregationBucketSignificantTerm //`json:"buckets"`
}

AggregationBucketSignificantTerms is a bucket aggregation returned with a significant terms aggregation.

func (*AggregationBucketSignificantTerms) UnmarshalJSON Uses

func (a *AggregationBucketSignificantTerms) UnmarshalJSON(data []byte) error

UnmarshalJSON decodes JSON data and initializes an AggregationBucketSignificantTerms structure.

type AggregationExtendedStatsMetric Uses

type AggregationExtendedStatsMetric struct {
    Aggregations

    Count        int64    // `json:"count"`
    Min          *float64 //`json:"min,omitempty"`
    Max          *float64 //`json:"max,omitempty"`
    Avg          *float64 //`json:"avg,omitempty"`
    Sum          *float64 //`json:"sum,omitempty"`
    SumOfSquares *float64 //`json:"sum_of_squares,omitempty"`
    Variance     *float64 //`json:"variance,omitempty"`
    StdDeviation *float64 //`json:"std_deviation,omitempty"`
}

AggregationExtendedStatsMetric is a multi-value metric, returned by an ExtendedStats aggregation.

func (*AggregationExtendedStatsMetric) UnmarshalJSON Uses

func (a *AggregationExtendedStatsMetric) UnmarshalJSON(data []byte) error

UnmarshalJSON decodes JSON data and initializes an AggregationExtendedStatsMetric structure.

type AggregationGeoBoundsMetric Uses

type AggregationGeoBoundsMetric struct {
    Aggregations

    Bounds struct {
        TopLeft struct {
            Latitude  float64 `json:"lat"`
            Longitude float64 `json:"lon"`
        }   `json:"top_left"`
        BottomRight struct {
            Latitude  float64 `json:"lat"`
            Longitude float64 `json:"lon"`
        }   `json:"bottom_right"`
    }   `json:"bounds"`
}

AggregationGeoBoundsMetric is a metric as returned by a GeoBounds aggregation.

func (*AggregationGeoBoundsMetric) UnmarshalJSON Uses

func (a *AggregationGeoBoundsMetric) UnmarshalJSON(data []byte) error

UnmarshalJSON decodes JSON data and initializes an AggregationGeoBoundsMetric structure.

type AggregationPercentilesMetric Uses

type AggregationPercentilesMetric struct {
    Aggregations

    Values map[string]float64 // `json:"values"`
}

AggregationPercentilesMetric is a multi-value metric, returned by a Percentiles aggregation.

func (*AggregationPercentilesMetric) UnmarshalJSON Uses

func (a *AggregationPercentilesMetric) UnmarshalJSON(data []byte) error

UnmarshalJSON decodes JSON data and initializes an AggregationPercentilesMetric structure.

type AggregationSingleBucket Uses

type AggregationSingleBucket struct {
    Aggregations

    DocCount int64 // `json:"doc_count"`
}

AggregationSingleBucket is a single bucket, returned e.g. via an aggregation of type Global.

func (*AggregationSingleBucket) UnmarshalJSON Uses

func (a *AggregationSingleBucket) UnmarshalJSON(data []byte) error

UnmarshalJSON decodes JSON data and initializes an AggregationSingleBucket structure.

type AggregationStatsMetric Uses

type AggregationStatsMetric struct {
    Aggregations

    Count int64    // `json:"count"`
    Min   *float64 //`json:"min,omitempty"`
    Max   *float64 //`json:"max,omitempty"`
    Avg   *float64 //`json:"avg,omitempty"`
    Sum   *float64 //`json:"sum,omitempty"`
}

AggregationStatsMetric is a multi-value metric, returned by a Stats aggregation.

func (*AggregationStatsMetric) UnmarshalJSON Uses

func (a *AggregationStatsMetric) UnmarshalJSON(data []byte) error

UnmarshalJSON decodes JSON data and initializes an AggregationStatsMetric structure.

type AggregationTopHitsMetric Uses

type AggregationTopHitsMetric struct {
    Aggregations

    Hits *SearchHits //`json:"hits"`
}

AggregationTopHitsMetric is a metric returned by a TopHits aggregation.

func (*AggregationTopHitsMetric) UnmarshalJSON Uses

func (a *AggregationTopHitsMetric) UnmarshalJSON(data []byte) error

UnmarshalJSON decodes JSON data and initializes an AggregationTopHitsMetric structure.

type AggregationValueMetric Uses

type AggregationValueMetric struct {
    Aggregations

    Value *float64 //`json:"value"`
}

AggregationValueMetric is a single-value metric, returned e.g. by a Min or Max aggregation.

func (*AggregationValueMetric) UnmarshalJSON Uses

func (a *AggregationValueMetric) UnmarshalJSON(data []byte) error

UnmarshalJSON decodes JSON data and initializes an AggregationValueMetric structure.

type Aggregations Uses

type Aggregations map[string]json.RawMessage

Aggregations is a list of aggregations that are part of a search result.

Code:

// Get a client to the local Elasticsearch instance.
client, err := elastic.NewClient(http.DefaultClient)
if err != nil {
    // Handle error
    panic(err)
}

// Create an aggregation for users and a sub-aggregation for a date histogram of tweets (per year).
timeline := elastic.NewTermsAggregation().Field("user").Size(10).OrderByCountDesc()
histogram := elastic.NewDateHistogramAggregation().Field("created").Interval("year")
timeline = timeline.SubAggregation("history", histogram)

// Search with a term query
searchResult, err := client.Search().
    Index("twitter").                  // search in index "twitter"
    Query(elastic.NewMatchAllQuery()). // return all results, but ...
    SearchType("count").               // ... do not return hits, just the count
    Aggregation("timeline", timeline). // add our aggregation to the query
    Debug(true).                       // print request and response to stdout
    Pretty(true).                      // pretty print request and response JSON
    Do()                               // execute
if err != nil {
    // Handle error
    panic(err)
}

// Access "timeline" aggregate in search result.
agg, found := searchResult.Aggregations.Terms("timeline")
if !found {
    log.Fatalf("we sould have a terms aggregation called %q", "timeline")
}
for _, userBucket := range agg.Buckets {
    // Every bucket should have the user field as key.
    user := userBucket.Key

    // The sub-aggregation history should have the number of tweets per year.
    histogram, found := userBucket.DateHistogram("history")
    if found {
        for _, year := range histogram.Buckets {
            fmt.Printf("user %q has %d tweets in %q\n", user, year.DocCount, year.KeyAsString)
        }
    }
}

func (Aggregations) Avg Uses

func (a Aggregations) Avg(name string) (*AggregationValueMetric, bool)

Avg returns average aggregation results. See: http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/search-aggregations-metrics-avg-aggregation.html

func (Aggregations) Cardinality Uses

func (a Aggregations) Cardinality(name string) (*AggregationValueMetric, bool)

Cardinality returns cardinality aggregation results. See: http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/search-aggregations-metrics-cardinality-aggregation.html

func (Aggregations) Children Uses

func (a Aggregations) Children(name string) (*AggregationSingleBucket, bool)

Children returns children results. See: http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/search-aggregations-bucket-children-aggregation.html

func (Aggregations) DateHistogram Uses

func (a Aggregations) DateHistogram(name string) (*AggregationBucketHistogramItems, bool)

DateHistogram returns date histogram aggregation results. See: http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/search-aggregations-bucket-datehistogram-aggregation.html

func (Aggregations) DateRange Uses

func (a Aggregations) DateRange(name string) (*AggregationBucketRangeItems, bool)

DateRange returns date range aggregation results. See: http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/search-aggregations-bucket-daterange-aggregation.html

func (Aggregations) ExtendedStats Uses

func (a Aggregations) ExtendedStats(name string) (*AggregationExtendedStatsMetric, bool)

ExtendedStats returns extended stats aggregation results. See: http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/search-aggregations-metrics-extendedstats-aggregation.html

func (Aggregations) Filter Uses

func (a Aggregations) Filter(name string) (*AggregationSingleBucket, bool)

Filter returns filter results. See: http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/search-aggregations-bucket-filter-aggregation.html

func (Aggregations) Filters Uses

func (a Aggregations) Filters(name string) (*AggregationBucketFilters, bool)

Filters returns filters results. See: http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/search-aggregations-bucket-filters-aggregation.html

func (Aggregations) GeoBounds Uses

func (a Aggregations) GeoBounds(name string) (*AggregationGeoBoundsMetric, bool)

GeoBounds returns geo-bounds aggregation results. See: http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/search-aggregations-metrics-geobounds-aggregation.html

func (Aggregations) GeoDistance Uses

func (a Aggregations) GeoDistance(name string) (*AggregationBucketRangeItems, bool)

GeoDistance returns geo distance aggregation results. See: http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/search-aggregations-bucket-geodistance-aggregation.html

func (Aggregations) GeoHash Uses

func (a Aggregations) GeoHash(name string) (*AggregationBucketKeyItems, bool)

GeoHash returns geo-hash aggregation results. http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/search-aggregations-bucket-geohashgrid-aggregation.html

func (Aggregations) Global Uses

func (a Aggregations) Global(name string) (*AggregationSingleBucket, bool)

Global returns global results. See: http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/search-aggregations-bucket-global-aggregation.html

func (Aggregations) Histogram Uses

func (a Aggregations) Histogram(name string) (*AggregationBucketHistogramItems, bool)

Histogram returns histogram aggregation results. See: http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/search-aggregations-bucket-histogram-aggregation.html

func (Aggregations) IPv4Range Uses

func (a Aggregations) IPv4Range(name string) (*AggregationBucketRangeItems, bool)

IPv4Range returns IPv4 range aggregation results. See: http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/search-aggregations-bucket-iprange-aggregation.html

func (Aggregations) Max Uses

func (a Aggregations) Max(name string) (*AggregationValueMetric, bool)

Max returns max aggregation results. See: http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/search-aggregations-metrics-max-aggregation.html

func (Aggregations) Min Uses

func (a Aggregations) Min(name string) (*AggregationValueMetric, bool)

Min returns min aggregation results. See: http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/search-aggregations-metrics-min-aggregation.html

func (Aggregations) Missing Uses

func (a Aggregations) Missing(name string) (*AggregationSingleBucket, bool)

Missing returns missing results. See: http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/search-aggregations-bucket-missing-aggregation.html

func (Aggregations) Nested Uses

func (a Aggregations) Nested(name string) (*AggregationSingleBucket, bool)

Nested returns nested results. See: http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/search-aggregations-bucket-nested-aggregation.html

func (Aggregations) PercentileRanks Uses

func (a Aggregations) PercentileRanks(name string) (*AggregationPercentilesMetric, bool)

PercentileRanks returns percentile ranks results. See: http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/search-aggregations-metrics-percentile-rank-aggregation.html

func (Aggregations) Percentiles Uses

func (a Aggregations) Percentiles(name string) (*AggregationPercentilesMetric, bool)

Percentiles returns percentiles results. See: http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/search-aggregations-metrics-percentile-aggregation.html

func (Aggregations) Range Uses

func (a Aggregations) Range(name string) (*AggregationBucketRangeItems, bool)

Range returns range aggregation results. See: http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/search-aggregations-bucket-range-aggregation.html

func (Aggregations) ReverseNested Uses

func (a Aggregations) ReverseNested(name string) (*AggregationSingleBucket, bool)

ReverseNested returns reverse-nested results. See: http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/search-aggregations-bucket-reverse-nested-aggregation.html

func (Aggregations) SignificantTerms Uses

func (a Aggregations) SignificantTerms(name string) (*AggregationBucketSignificantTerms, bool)

SignificantTerms returns significant terms aggregation results. See: http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/search-aggregations-bucket-significantterms-aggregation.html

func (Aggregations) Stats Uses

func (a Aggregations) Stats(name string) (*AggregationStatsMetric, bool)

Stats returns stats aggregation results. http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/search-aggregations-metrics-stats-aggregation.html

func (Aggregations) Sum Uses

func (a Aggregations) Sum(name string) (*AggregationValueMetric, bool)

Sum returns sum aggregation results. See: http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/search-aggregations-metrics-sum-aggregation.html

func (Aggregations) Terms Uses

func (a Aggregations) Terms(name string) (*AggregationBucketKeyItems, bool)

Terms returns terms aggregation results. See: http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/search-aggregations-bucket-terms-aggregation.html

func (Aggregations) TopHits Uses

func (a Aggregations) TopHits(name string) (*AggregationTopHitsMetric, bool)

TopHits returns top-hits aggregation results. See: http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/search-aggregations-metrics-top-hits-aggregation.html

func (Aggregations) ValueCount Uses

func (a Aggregations) ValueCount(name string) (*AggregationValueMetric, bool)

ValueCount returns value-count aggregation results. See: http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/search-aggregations-metrics-valuecount-aggregation.html

type AliasResult Uses

type AliasResult struct {
    Acknowledged bool `json:"acknowledged"`
}

type AliasService Uses

type AliasService struct {
    // contains filtered or unexported fields
}

func NewAliasService Uses

func NewAliasService(client *Client) *AliasService

func (*AliasService) Add Uses

func (s *AliasService) Add(indexName string, aliasName string) *AliasService

func (*AliasService) AddWithFilter Uses

func (s *AliasService) AddWithFilter(indexName string, aliasName string, filter *Filter) *AliasService

func (*AliasService) Debug Uses

func (s *AliasService) Debug(debug bool) *AliasService

func (*AliasService) Do Uses

func (s *AliasService) Do() (*AliasResult, error)

func (*AliasService) Pretty Uses

func (s *AliasService) Pretty(pretty bool) *AliasService

func (*AliasService) Remove Uses

func (s *AliasService) Remove(indexName string, aliasName string) *AliasService

type AliasesResult Uses

type AliasesResult struct {
    Indices map[string]indexResult
}

func (AliasesResult) IndicesByAlias Uses

func (ar AliasesResult) IndicesByAlias(aliasName string) []string

type AliasesService Uses

type AliasesService struct {
    // contains filtered or unexported fields
}

func NewAliasesService Uses

func NewAliasesService(client *Client) *AliasesService

func (*AliasesService) Debug Uses

func (s *AliasesService) Debug(debug bool) *AliasesService

func (*AliasesService) Do Uses

func (s *AliasesService) Do() (*AliasesResult, error)

func (*AliasesService) Index Uses

func (s *AliasesService) Index(indexName string) *AliasesService

func (*AliasesService) Indices Uses

func (s *AliasesService) Indices(indexNames ...string) *AliasesService

func (*AliasesService) Pretty Uses

func (s *AliasesService) Pretty(pretty bool) *AliasesService

type AndFilter Uses

type AndFilter struct {
    // contains filtered or unexported fields
}

A filter that matches documents using AND boolean operator on other filters. Can be placed within queries that accept a filter. For details, see: http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/query-dsl-and-filter.html

func NewAndFilter Uses

func NewAndFilter(filters ...Filter) AndFilter

func (AndFilter) Add Uses

func (f AndFilter) Add(filter Filter) AndFilter

func (AndFilter) Cache Uses

func (f AndFilter) Cache(cache bool) AndFilter

func (AndFilter) CacheKey Uses

func (f AndFilter) CacheKey(cacheKey string) AndFilter

func (AndFilter) FilterName Uses

func (f AndFilter) FilterName(filterName string) AndFilter

func (AndFilter) Source Uses

func (f AndFilter) Source() interface{}

type AvgAggregation Uses

type AvgAggregation struct {
    // contains filtered or unexported fields
}

AvgAggregation is a single-value metrics aggregation that computes the average of numeric values that are extracted from the aggregated documents. These values can be extracted either from specific numeric fields in the documents, or be generated by a provided script. See: http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/search-aggregations-metrics-avg-aggregation.html

func NewAvgAggregation Uses

func NewAvgAggregation() AvgAggregation

func (AvgAggregation) Field Uses

func (a AvgAggregation) Field(field string) AvgAggregation

func (AvgAggregation) Format Uses

func (a AvgAggregation) Format(format string) AvgAggregation

func (AvgAggregation) Lang Uses

func (a AvgAggregation) Lang(lang string) AvgAggregation

func (AvgAggregation) Param Uses

func (a AvgAggregation) Param(name string, value interface{}) AvgAggregation

func (AvgAggregation) Script Uses

func (a AvgAggregation) Script(script string) AvgAggregation

func (AvgAggregation) Source Uses

func (a AvgAggregation) Source() interface{}

func (AvgAggregation) SubAggregation Uses

func (a AvgAggregation) SubAggregation(name string, subAggregation Aggregation) AvgAggregation

type BoolFilter Uses

type BoolFilter struct {
    // contains filtered or unexported fields
}

A filter that matches documents matching boolean combinations of other queries. Similar in concept to Boolean query, except that the clauses are other filters. Can be placed within queries that accept a filter. For more details, see: http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/query-dsl-bool-filter.html

func NewBoolFilter Uses

func NewBoolFilter() BoolFilter

NewBoolFilter creates a new bool filter.

func (BoolFilter) Cache Uses

func (f BoolFilter) Cache(cache bool) BoolFilter

func (BoolFilter) CacheKey Uses

func (f BoolFilter) CacheKey(cacheKey string) BoolFilter

func (BoolFilter) FilterName Uses

func (f BoolFilter) FilterName(filterName string) BoolFilter

func (BoolFilter) Must Uses

func (f BoolFilter) Must(filters ...Filter) BoolFilter

func (BoolFilter) MustNot Uses

func (f BoolFilter) MustNot(filters ...Filter) BoolFilter

func (BoolFilter) Should Uses

func (f BoolFilter) Should(filters ...Filter) BoolFilter

func (BoolFilter) Source Uses

func (f BoolFilter) Source() interface{}

Creates the query source for the bool query.

type BoolQuery Uses

type BoolQuery struct {
    Query
    // contains filtered or unexported fields
}

A bool query matches documents matching boolean combinations of other queries. For more details, see: http://www.elasticsearch.org/guide/reference/query-dsl/bool-query.html

func NewBoolQuery Uses

func NewBoolQuery() BoolQuery

Creates a new bool query.

func (BoolQuery) AdjustPureNegative Uses

func (q BoolQuery) AdjustPureNegative(adjustPureNegative bool) BoolQuery

func (BoolQuery) Boost Uses

func (q BoolQuery) Boost(boost float32) BoolQuery

func (BoolQuery) DisableCoord Uses

func (q BoolQuery) DisableCoord(disableCoord bool) BoolQuery

func (BoolQuery) MinimumShouldMatch Uses

func (q BoolQuery) MinimumShouldMatch(minimumShouldMatch string) BoolQuery

func (BoolQuery) Must Uses

func (q BoolQuery) Must(queries ...Query) BoolQuery

func (BoolQuery) MustNot Uses

func (q BoolQuery) MustNot(queries ...Query) BoolQuery

func (BoolQuery) QueryName Uses

func (q BoolQuery) QueryName(queryName string) BoolQuery

func (BoolQuery) Should Uses

func (q BoolQuery) Should(queries ...Query) BoolQuery

func (BoolQuery) Source Uses

func (q BoolQuery) Source() interface{}

Creates the query source for the bool query.

type BoostingQuery Uses

type BoostingQuery struct {
    Query
    // contains filtered or unexported fields
}

A boosting query can be used to effectively demote results that match a given query. For more details, see: http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/query-dsl-boosting-query.html

func NewBoostingQuery Uses

func NewBoostingQuery() BoostingQuery

Creates a new boosting query.

func (BoostingQuery) Boost Uses

func (q BoostingQuery) Boost(boost float64) BoostingQuery

func (BoostingQuery) Negative Uses

func (q BoostingQuery) Negative(negative Query) BoostingQuery

func (BoostingQuery) NegativeBoost Uses

func (q BoostingQuery) NegativeBoost(negativeBoost float64) BoostingQuery

func (BoostingQuery) Positive Uses

func (q BoostingQuery) Positive(positive Query) BoostingQuery

func (BoostingQuery) Source Uses

func (q BoostingQuery) Source() interface{}

Creates the query source for the boosting query.

type BulkDeleteRequest Uses

type BulkDeleteRequest struct {
    BulkableRequest
    // contains filtered or unexported fields
}

Bulk request to remove document from Elasticsearch.

func NewBulkDeleteRequest Uses

func NewBulkDeleteRequest() *BulkDeleteRequest

func (*BulkDeleteRequest) Id Uses

func (r *BulkDeleteRequest) Id(id string) *BulkDeleteRequest

func (*BulkDeleteRequest) Index Uses

func (r *BulkDeleteRequest) Index(index string) *BulkDeleteRequest

func (*BulkDeleteRequest) Refresh Uses

func (r *BulkDeleteRequest) Refresh(refresh bool) *BulkDeleteRequest

func (*BulkDeleteRequest) Routing Uses

func (r *BulkDeleteRequest) Routing(routing string) *BulkDeleteRequest

func (*BulkDeleteRequest) Source Uses

func (r *BulkDeleteRequest) Source() ([]string, error)

func (*BulkDeleteRequest) String Uses

func (r *BulkDeleteRequest) String() string

func (*BulkDeleteRequest) Type Uses

func (r *BulkDeleteRequest) Type(typ string) *BulkDeleteRequest

func (*BulkDeleteRequest) Version Uses

func (r *BulkDeleteRequest) Version(version int64) *BulkDeleteRequest

func (*BulkDeleteRequest) VersionType Uses

func (r *BulkDeleteRequest) VersionType(versionType string) *BulkDeleteRequest

VersionType can be "internal" (default), "external", "external_gte", "external_gt", or "force".

type BulkIndexRequest Uses

type BulkIndexRequest struct {
    BulkableRequest
    // contains filtered or unexported fields
}

Bulk request to add document to Elasticsearch.

func NewBulkIndexRequest Uses

func NewBulkIndexRequest() *BulkIndexRequest

func (*BulkIndexRequest) Doc Uses

func (r *BulkIndexRequest) Doc(doc interface{}) *BulkIndexRequest

func (*BulkIndexRequest) Id Uses

func (r *BulkIndexRequest) Id(id string) *BulkIndexRequest

func (*BulkIndexRequest) Index Uses

func (r *BulkIndexRequest) Index(index string) *BulkIndexRequest

func (*BulkIndexRequest) OpType Uses

func (r *BulkIndexRequest) OpType(opType string) *BulkIndexRequest

func (*BulkIndexRequest) Parent Uses

func (r *BulkIndexRequest) Parent(parent string) *BulkIndexRequest

func (*BulkIndexRequest) Refresh Uses

func (r *BulkIndexRequest) Refresh(refresh bool) *BulkIndexRequest

func (*BulkIndexRequest) Routing Uses

func (r *BulkIndexRequest) Routing(routing string) *BulkIndexRequest

func (*BulkIndexRequest) Source Uses

func (r *BulkIndexRequest) Source() ([]string, error)

func (*BulkIndexRequest) String Uses

func (r *BulkIndexRequest) String() string

func (*BulkIndexRequest) Timestamp Uses

func (r *BulkIndexRequest) Timestamp(timestamp string) *BulkIndexRequest

func (*BulkIndexRequest) Ttl Uses

func (r *BulkIndexRequest) Ttl(ttl int64) *BulkIndexRequest

func (*BulkIndexRequest) Type Uses

func (r *BulkIndexRequest) Type(typ string) *BulkIndexRequest

func (*BulkIndexRequest) Version Uses

func (r *BulkIndexRequest) Version(version int64) *BulkIndexRequest

func (*BulkIndexRequest) VersionType Uses

func (r *BulkIndexRequest) VersionType(versionType string) *BulkIndexRequest

type BulkResponse Uses

type BulkResponse struct {
    Took   int                            `json:"took,omitempty"`
    Errors bool                           `json:"errors,omitempty"`
    Items  []map[string]*BulkResponseItem `json:"items,omitempty"`
}

BulkResponse is a response to a bulk execution.

Example: {

"took":3,
"errors":false,
"items":[{
  "index":{
    "_index":"index1",
    "_type":"tweet",
    "_id":"1",
    "_version":3,
    "status":201
  }
},{
  "index":{
    "_index":"index2",
    "_type":"tweet",
    "_id":"2",
    "_version":3,
    "status":200
  }
},{
  "delete":{
    "_index":"index1",
    "_type":"tweet",
    "_id":"1",
    "_version":4,
    "status":200,
    "found":true
  }
},{
  "update":{
    "_index":"index2",
    "_type":"tweet",
    "_id":"2",
    "_version":4,
    "status":200
  }
}]

}

func (*BulkResponse) ByAction Uses

func (r *BulkResponse) ByAction(action string) []*BulkResponseItem

ByAction returns all bulk request results of a certain action, e.g. "index" or "delete".

func (*BulkResponse) ById Uses

func (r *BulkResponse) ById(id string) []*BulkResponseItem

ById returns all bulk request results of a given document id, regardless of the action ("index", "delete" etc.).

func (*BulkResponse) Created Uses

func (r *BulkResponse) Created() []*BulkResponseItem

Created returns all bulk request results of "create" actions.

func (*BulkResponse) Deleted Uses

func (r *BulkResponse) Deleted() []*BulkResponseItem

Deleted returns all bulk request results of "delete" actions.

func (*BulkResponse) Failed Uses

func (r *BulkResponse) Failed() []*BulkResponseItem

Failed returns those items of a bulk response that have errors, i.e. those that don't have a status code between 200 and 299.

func (*BulkResponse) Indexed Uses

func (r *BulkResponse) Indexed() []*BulkResponseItem

Indexed returns all bulk request results of "index" actions.

func (*BulkResponse) Updated Uses

func (r *BulkResponse) Updated() []*BulkResponseItem

Updated returns all bulk request results of "update" actions.

type BulkResponseItem Uses

type BulkResponseItem struct {
    Index   string `json:"_index,omitempty"`
    Type    string `json:"_type,omitempty"`
    Id      string `json:"_id,omitempty"`
    Version int    `json:"_version,omitempty"`
    Status  int    `json:"status,omitempty"`
    Found   bool   `json:"found,omitempty"`
    Error   string `json:"error,omitempty"`
}

BulkResponseItem is the result of a single bulk request.

type BulkService Uses

type BulkService struct {
    // contains filtered or unexported fields
}

func NewBulkService Uses

func NewBulkService(client *Client) *BulkService

func (*BulkService) Add Uses

func (s *BulkService) Add(r BulkableRequest) *BulkService

func (*BulkService) Debug Uses

func (s *BulkService) Debug(debug bool) *BulkService

func (*BulkService) DebugOnError Uses

func (s *BulkService) DebugOnError(debug bool) *BulkService

func (*BulkService) Do Uses

func (s *BulkService) Do() (*BulkResponse, error)

func (*BulkService) Index Uses

func (s *BulkService) Index(index string) *BulkService

func (*BulkService) NumberOfActions Uses

func (s *BulkService) NumberOfActions() int

func (*BulkService) Pretty Uses

func (s *BulkService) Pretty(pretty bool) *BulkService

func (*BulkService) Refresh Uses

func (s *BulkService) Refresh(refresh bool) *BulkService

func (*BulkService) Timeout Uses

func (s *BulkService) Timeout(timeout string) *BulkService

func (*BulkService) Type Uses

func (s *BulkService) Type(_type string) *BulkService

type BulkUpdateRequest Uses

type BulkUpdateRequest struct {
    BulkableRequest
    // contains filtered or unexported fields
}

Bulk request to update document in Elasticsearch.

func NewBulkUpdateRequest Uses

func NewBulkUpdateRequest() *BulkUpdateRequest

func (*BulkUpdateRequest) Doc Uses

func (r *BulkUpdateRequest) Doc(doc interface{}) *BulkUpdateRequest

func (*BulkUpdateRequest) DocAsUpsert Uses

func (r *BulkUpdateRequest) DocAsUpsert(docAsUpsert bool) *BulkUpdateRequest

func (*BulkUpdateRequest) Id Uses

func (r *BulkUpdateRequest) Id(id string) *BulkUpdateRequest

func (*BulkUpdateRequest) Index Uses

func (r *BulkUpdateRequest) Index(index string) *BulkUpdateRequest

func (*BulkUpdateRequest) Parent Uses

func (r *BulkUpdateRequest) Parent(parent string) *BulkUpdateRequest

func (*BulkUpdateRequest) Refresh Uses

func (r *BulkUpdateRequest) Refresh(refresh bool) *BulkUpdateRequest

func (*BulkUpdateRequest) RetryOnConflict Uses

func (r *BulkUpdateRequest) RetryOnConflict(retryOnConflict int) *BulkUpdateRequest

func (*BulkUpdateRequest) Routing Uses

func (r *BulkUpdateRequest) Routing(routing string) *BulkUpdateRequest

func (*BulkUpdateRequest) Script Uses

func (r *BulkUpdateRequest) Script(script string) *BulkUpdateRequest

func (*BulkUpdateRequest) ScriptLang Uses

func (r *BulkUpdateRequest) ScriptLang(scriptLang string) *BulkUpdateRequest

func (*BulkUpdateRequest) ScriptParams Uses

func (r *BulkUpdateRequest) ScriptParams(params map[string]interface{}) *BulkUpdateRequest

func (*BulkUpdateRequest) ScriptType Uses

func (r *BulkUpdateRequest) ScriptType(scriptType string) *BulkUpdateRequest

func (BulkUpdateRequest) Source Uses

func (r BulkUpdateRequest) Source() ([]string, error)

func (*BulkUpdateRequest) String Uses

func (r *BulkUpdateRequest) String() string

func (*BulkUpdateRequest) Timestamp Uses

func (r *BulkUpdateRequest) Timestamp(timestamp string) *BulkUpdateRequest

func (*BulkUpdateRequest) Ttl Uses

func (r *BulkUpdateRequest) Ttl(ttl int64) *BulkUpdateRequest

func (*BulkUpdateRequest) Type Uses

func (r *BulkUpdateRequest) Type(typ string) *BulkUpdateRequest

func (*BulkUpdateRequest) Upsert Uses

func (r *BulkUpdateRequest) Upsert(doc interface{}) *BulkUpdateRequest

func (*BulkUpdateRequest) Version Uses

func (r *BulkUpdateRequest) Version(version int64) *BulkUpdateRequest

func (*BulkUpdateRequest) VersionType Uses

func (r *BulkUpdateRequest) VersionType(versionType string) *BulkUpdateRequest

VersionType can be "internal" (default), "external", "external_gte", "external_gt", or "force".

type BulkableRequest Uses

type BulkableRequest interface {
    fmt.Stringer
    Source() ([]string, error)
}

Generic interface to bulkable requests.

type CandidateGenerator Uses

type CandidateGenerator interface {
    Type() string
    Source() interface{}
}

type CardinalityAggregation Uses

type CardinalityAggregation struct {
    // contains filtered or unexported fields
}

CardinalityAggregation is a single-value metrics aggregation that calculates an approximate count of distinct values. Values can be extracted either from specific fields in the document or generated by a script. See: http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/search-aggregations-metrics-cardinality-aggregation.html

func NewCardinalityAggregation Uses

func NewCardinalityAggregation() CardinalityAggregation

func (CardinalityAggregation) Field Uses

func (a CardinalityAggregation) Field(field string) CardinalityAggregation

func (CardinalityAggregation) Format Uses

func (a CardinalityAggregation) Format(format string) CardinalityAggregation

func (CardinalityAggregation) Lang Uses

func (a CardinalityAggregation) Lang(lang string) CardinalityAggregation

func (CardinalityAggregation) Param Uses

func (a CardinalityAggregation) Param(name string, value interface{}) CardinalityAggregation

func (CardinalityAggregation) PrecisionThreshold Uses

func (a CardinalityAggregation) PrecisionThreshold(threshold int64) CardinalityAggregation

func (CardinalityAggregation) Rehash Uses

func (a CardinalityAggregation) Rehash(rehash bool) CardinalityAggregation

func (CardinalityAggregation) Script Uses

func (a CardinalityAggregation) Script(script string) CardinalityAggregation

func (CardinalityAggregation) Source Uses

func (a CardinalityAggregation) Source() interface{}

func (CardinalityAggregation) SubAggregation Uses

func (a CardinalityAggregation) SubAggregation(name string, subAggregation Aggregation) CardinalityAggregation

type ChildrenAggregation Uses

type ChildrenAggregation struct {
    // contains filtered or unexported fields
}

ChildrenAggregation is a special single bucket aggregation that enables aggregating from buckets on parent document types to buckets on child documents. It is available from 1.4.0.Beta1 upwards. See: http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/search-aggregations-bucket-children-aggregation.html

func NewChildrenAggregation Uses

func NewChildrenAggregation() ChildrenAggregation

func (ChildrenAggregation) Source Uses

func (a ChildrenAggregation) Source() interface{}

func (ChildrenAggregation) SubAggregation Uses

func (a ChildrenAggregation) SubAggregation(name string, subAggregation Aggregation) ChildrenAggregation

func (ChildrenAggregation) Type Uses

func (a ChildrenAggregation) Type(typ string) ChildrenAggregation

type Client Uses

type Client struct {
    // contains filtered or unexported fields
}

Client is an Elasticsearch client. Create one by calling NewClient.

func NewClient Uses

func NewClient(client *http.Client, urls ...string) (*Client, error)

NewClient creates a new client to work with Elasticsearch.

func (*Client) Alias Uses

func (c *Client) Alias() *AliasService

Alias enables the caller to add and/or remove aliases.

func (*Client) Aliases Uses

func (c *Client) Aliases() *AliasesService

Aliases returns aliases by index name(s).

func (*Client) Bulk Uses

func (c *Client) Bulk() *BulkService

Bulk is the entry point to mass insert/update/delete documents.

func (*Client) CloseIndex Uses

func (c *Client) CloseIndex(name string) *CloseIndexService

CloseIndex closes an index.

func (*Client) ClusterHealth Uses

func (c *Client) ClusterHealth() *ClusterHealthService

ClusterHealth retrieves the health of the cluster.

func (*Client) ClusterState Uses

func (c *Client) ClusterState() *ClusterStateService

ClusterState retrieves the state of the cluster.

func (*Client) Count Uses

func (c *Client) Count(indices ...string) *CountService

Count documents.

func (*Client) CreateIndex Uses

func (c *Client) CreateIndex(name string) *CreateIndexService

CreateIndex returns a service to create a new index.

func (*Client) Delete Uses

func (c *Client) Delete() *DeleteService

Delete a document.

func (*Client) DeleteByQuery Uses

func (c *Client) DeleteByQuery() *DeleteByQueryService

DeleteByQuery deletes documents as found by a query.

func (*Client) DeleteIndex Uses

func (c *Client) DeleteIndex(name string) *DeleteIndexService

DeleteIndex returns a service to delete an index.

func (*Client) DeleteTemplate Uses

func (c *Client) DeleteTemplate() *DeleteTemplateService

DeleteTemplate deletes a search template.

func (*Client) ElasticsearchVersion Uses

func (c *Client) ElasticsearchVersion(url string) (string, error)

ElasticsearchVersion returns the version number of Elasticsearch running on the given URL.

func (*Client) Exists Uses

func (c *Client) Exists() *ExistsService

Exists checks if a document exists.

func (*Client) Flush Uses

func (c *Client) Flush() *FlushService

Flush asks Elasticsearch to free memory from the index and flush data to disk.

func (*Client) Get Uses

func (c *Client) Get() *GetService

Get a document.

func (*Client) GetTemplate Uses

func (c *Client) GetTemplate() *GetTemplateService

GetTemplate gets a search template.

func (*Client) Index Uses

func (c *Client) Index() *IndexService

Index a document.

func (*Client) IndexExists Uses

func (c *Client) IndexExists(name string) *IndexExistsService

IndexExists allows to check if an index exists.

func (*Client) MultiGet Uses

func (c *Client) MultiGet() *MultiGetService

MultiGet retrieves multiple documents in one roundtrip.

func (*Client) MultiSearch Uses

func (c *Client) MultiSearch() *MultiSearchService

MultiSearch is the entry point for multi searches.

func (*Client) NewRequest Uses

func (c *Client) NewRequest(method, path string) (*Request, error)

NewRequest creates a new request with the given method and prepends the base URL to the path. If no active connection to Elasticsearch is available, ErrNoClient is returned.

func (*Client) OpenIndex Uses

func (c *Client) OpenIndex(name string) *OpenIndexService

OpenIndex opens an index.

func (*Client) Optimize Uses

func (c *Client) Optimize(indices ...string) *OptimizeService

Optimize asks Elasticsearch to optimize one or more indices.

func (*Client) Ping Uses

func (c *Client) Ping() *PingService

Ping checks if a given node in a cluster exists and (optionally) returns some basic information about the Elasticsearch server, e.g. the Elasticsearch version number.

func (*Client) PutTemplate Uses

func (c *Client) PutTemplate() *PutTemplateService

PutTemplate creates or updates a search template.

func (*Client) Refresh Uses

func (c *Client) Refresh(indices ...string) *RefreshService

Refresh asks Elasticsearch to refresh one or more indices.

func (*Client) Scan Uses

func (c *Client) Scan(indices ...string) *ScanService

Scan through documents. Use this to iterate inside a server process where the results will be processed without returning them to a client.

func (*Client) Scroll Uses

func (c *Client) Scroll(indices ...string) *ScrollService

Scroll through documents. Use this to efficiently scroll through results while returning the results to a client. Use Scan when you don't need to return requests to a client (i.e. not paginating via request/response).

func (*Client) Search Uses

func (c *Client) Search(indices ...string) *SearchService

Search is the entry point for searches.

func (*Client) SetLogger Uses

func (c *Client) SetLogger(log *log.Logger)

SetLogger sets the logger for output from Elastic. If you don't set the logger, it will print to os.Stdout.

func (*Client) Suggest Uses

func (c *Client) Suggest(indices ...string) *SuggestService

Suggest returns a service to return suggestions.

func (*Client) Update Uses

func (c *Client) Update() *UpdateService

Update a document.

type CloseIndexResponse Uses

type CloseIndexResponse struct {
    Acknowledged bool `json:"acknowledged"`
}

CloseIndexResponse is the response of CloseIndexService.Do.

type CloseIndexService Uses

type CloseIndexService struct {
    // contains filtered or unexported fields
}

CloseIndexService closes an index. See documentation at http://www.elasticsearch.org/guide/en/elasticsearch/reference/1.4/indices-open-close.html.

func NewCloseIndexService Uses

func NewCloseIndexService(client *Client) *CloseIndexService

NewCloseIndexService creates a new CloseIndexService.

func (*CloseIndexService) AllowNoIndices Uses

func (s *CloseIndexService) AllowNoIndices(allowNoIndices bool) *CloseIndexService

AllowNoIndices indicates whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified).

func (*CloseIndexService) Do Uses

func (s *CloseIndexService) Do() (*CloseIndexResponse, error)

Do executes the operation.

func (*CloseIndexService) ExpandWildcards Uses

func (s *CloseIndexService) ExpandWildcards(expandWildcards string) *CloseIndexService

ExpandWildcards indicates whether to expand wildcard expression to concrete indices that are open, closed or both.

func (*CloseIndexService) IgnoreUnavailable Uses

func (s *CloseIndexService) IgnoreUnavailable(ignoreUnavailable bool) *CloseIndexService

IgnoreUnavailable indicates whether specified concrete indices should be ignored when unavailable (missing or closed).

func (*CloseIndexService) Index Uses

func (s *CloseIndexService) Index(index string) *CloseIndexService

Index is the name of the index.

func (*CloseIndexService) MasterTimeout Uses

func (s *CloseIndexService) MasterTimeout(masterTimeout string) *CloseIndexService

MasterTimeout specifies the timeout for connection to master.

func (*CloseIndexService) Timeout Uses

func (s *CloseIndexService) Timeout(timeout string) *CloseIndexService

Timeout is an explicit operation timeout.

func (*CloseIndexService) Validate Uses

func (s *CloseIndexService) Validate() error

Validate checks if the operation is valid.

type ClusterHealthResponse Uses

type ClusterHealthResponse struct {
    ClusterName         string `json:"cluster_name"`
    Status              string `json:"status"`
    TimedOut            bool   `json:"timed_out"`
    NumberOfNodes       int    `json:"number_of_nodes"`
    NumberOfDataNodes   int    `json:"number_of_data_nodes"`
    ActivePrimaryShards int    `json:"active_primary_shards"`
    ActiveShards        int    `json:"active_shards"`
    RelocatingShards    int    `json:"relocating_shards"`
    InitializedShards   int    `json:"initialized_shards"`
    UnassignedShards    int    `json:"unassigned_shards"`
}

ClusterHealthResponse is the response of ClusterHealthService.Do.

type ClusterHealthService Uses

type ClusterHealthService struct {
    // contains filtered or unexported fields
}

ClusterHealthService allows to get the status of the cluster. It is documented at http://www.elasticsearch.org/guide/en/elasticsearch/reference/1.4/cluster-health.html.

Code:

client, err := elastic.NewClient(http.DefaultClient)
if err != nil {
    panic(err)
}

// Get cluster health
res, err := client.ClusterHealth().Index("twitter").Do()
if err != nil {
    panic(err)
}
if res == nil {
    panic(err)
}
fmt.Printf("Cluster status is %q\n", res.Status)

func NewClusterHealthService Uses

func NewClusterHealthService(client *Client) *ClusterHealthService

NewClusterHealthService creates a new ClusterHealthService.

func (*ClusterHealthService) Do Uses

func (s *ClusterHealthService) Do() (*ClusterHealthResponse, error)

Do executes the operation.

func (*ClusterHealthService) Index Uses

func (s *ClusterHealthService) Index(index string) *ClusterHealthService

Index limits the information returned to a specific index.

func (*ClusterHealthService) Indices Uses

func (s *ClusterHealthService) Indices(indices ...string) *ClusterHealthService

Indices limits the information returned to specific indices.

func (*ClusterHealthService) Level Uses

func (s *ClusterHealthService) Level(level string) *ClusterHealthService

Level specifies the level of detail for returned information.

func (*ClusterHealthService) Local Uses

func (s *ClusterHealthService) Local(local bool) *ClusterHealthService

Local indicates whether to return local information. If it is true, we do not retrieve the state from master node (default: false).

func (*ClusterHealthService) MasterTimeout Uses

func (s *ClusterHealthService) MasterTimeout(masterTimeout string) *ClusterHealthService

MasterTimeout specifies an explicit operation timeout for connection to master node.

func (*ClusterHealthService) Timeout Uses

func (s *ClusterHealthService) Timeout(timeout string) *ClusterHealthService

Timeout specifies an explicit operation timeout.

func (*ClusterHealthService) Validate Uses

func (s *ClusterHealthService) Validate() error

Validate checks if the operation is valid.

func (*ClusterHealthService) WaitForActiveShards Uses

func (s *ClusterHealthService) WaitForActiveShards(waitForActiveShards int) *ClusterHealthService

WaitForActiveShards can be used to wait until the specified number of shards are active.

func (*ClusterHealthService) WaitForNodes Uses

func (s *ClusterHealthService) WaitForNodes(waitForNodes string) *ClusterHealthService

WaitForNodes can be used to wait until the specified number of nodes are available.

func (*ClusterHealthService) WaitForRelocatingShards Uses

func (s *ClusterHealthService) WaitForRelocatingShards(waitForRelocatingShards int) *ClusterHealthService

WaitForRelocatingShards can be used to wait until the specified number of relocating shards is finished.

func (*ClusterHealthService) WaitForStatus Uses

func (s *ClusterHealthService) WaitForStatus(waitForStatus string) *ClusterHealthService

WaitForStatus can be used to wait until the cluster is in a specific state. Valid values are: green, yellow, or red.

type ClusterStateMetadata Uses

type ClusterStateMetadata struct {
    Templates    map[string]interface{} `json:"templates"`
    Indices      map[string]interface{} `json:"indices"`
    Repositories map[string]interface{} `json:"repositories"`
}

type ClusterStateNode Uses

type ClusterStateNode struct {
    State          string  `json:"state"`
    Primary        bool    `json:"primary"`
    Node           string  `json:"node"`
    RelocatingNode *string `json:"relocating_node"`
    Shard          int     `json:"shard"`
    Index          string  `json:"index"`
}

type ClusterStateResponse Uses

type ClusterStateResponse struct {
    ClusterName  string                               `json:"cluster_name"`
    Version      int                                  `json:"version"`
    MasterNode   string                               `json:"master_node"`
    Blocks       map[string]interface{}               `json:"blocks"`
    Nodes        map[string]*ClusterStateNode         `json:"nodes"`
    Metadata     *ClusterStateMetadata                `json:"metadata"`
    RoutingTable map[string]*ClusterStateRoutingTable `json:"routing_table"`
    RoutingNodes *ClusterStateRoutingNode             `json:"routing_nodes"`
    Allocations  []interface{}                        `json:"allocations"`
    Customs      map[string]interface{}               `json:"customs"`
}

ClusterStateResponse is the response of ClusterStateService.Do.

type ClusterStateRoutingNode Uses

type ClusterStateRoutingNode struct {
    Unassigned []interface{}          `json:"unassigned"`
    Nodes      map[string]interface{} `json:"nodes"`
}

type ClusterStateRoutingTable Uses

type ClusterStateRoutingTable struct {
    Indices map[string]interface{} `json:"indices"`
}

type ClusterStateService Uses

type ClusterStateService struct {
    // contains filtered or unexported fields
}

ClusterStateService returns the state of the cluster. It is documented at http://www.elasticsearch.org/guide/en/elasticsearch/reference/1.4/cluster-state.html.

Code:

client, err := elastic.NewClient(http.DefaultClient)
if err != nil {
    panic(err)
}

// Get cluster state
res, err := client.ClusterState().Metric("version").Do()
if err != nil {
    panic(err)
}
fmt.Printf("Cluster %q has version %d", res.ClusterName, res.Version)

func NewClusterStateService Uses

func NewClusterStateService(client *Client) *ClusterStateService

NewClusterStateService creates a new ClusterStateService.

func (*ClusterStateService) Do Uses

func (s *ClusterStateService) Do() (*ClusterStateResponse, error)

Do executes the operation.

func (*ClusterStateService) FlatSettings Uses

func (s *ClusterStateService) FlatSettings(flatSettings bool) *ClusterStateService

FlatSettings indicates whether to return settings in flat format (default: false).

func (*ClusterStateService) Index Uses

func (s *ClusterStateService) Index(index string) *ClusterStateService

Index the name of the index. Use _all or an empty string to perform the operation on all indices.

func (*ClusterStateService) Indices Uses

func (s *ClusterStateService) Indices(indices ...string) *ClusterStateService

Indices is a list of index names. Use _all or an empty string to perform the operation on all indices.

func (*ClusterStateService) Local Uses

func (s *ClusterStateService) Local(local bool) *ClusterStateService

Local indicates whether to return local information. If it is true, we do not retrieve the state from master node (default: false).

func (*ClusterStateService) MasterTimeout Uses

func (s *ClusterStateService) MasterTimeout(masterTimeout string) *ClusterStateService

MasterTimeout specifies the timeout for connection to master.

func (*ClusterStateService) Metric Uses

func (s *ClusterStateService) Metric(metric string) *ClusterStateService

Metric limits the information returned to the specified metric. It can be one of: version, master_node, nodes, routing_table, metadata, blocks, or customs.

func (*ClusterStateService) Metrics Uses

func (s *ClusterStateService) Metrics(metrics ...string) *ClusterStateService

Metrics limits the information returned to the specified metrics. It can be any of: version, master_node, nodes, routing_table, metadata, blocks, or customs.

func (*ClusterStateService) Validate Uses

func (s *ClusterStateService) Validate() error

Validate checks if the operation is valid.

type CommonQuery Uses

type CommonQuery struct {
    Query
    // contains filtered or unexported fields
}

The common terms query is a modern alternative to stopwords which improves the precision and recall of search results (by taking stopwords into account), without sacrificing performance. For more details, see: http://www.elasticsearch.org/guide/reference/query-dsl/common-terms-query/

func NewCommonQuery Uses

func NewCommonQuery(name string, query string) CommonQuery

Creates a new common query.

func (*CommonQuery) Analyzer Uses

func (q *CommonQuery) Analyzer(analyzer string) *CommonQuery

func (*CommonQuery) Boost Uses

func (q *CommonQuery) Boost(boost float64) *CommonQuery

func (*CommonQuery) CutoffFrequency Uses

func (q *CommonQuery) CutoffFrequency(f float64) *CommonQuery

func (*CommonQuery) DisableCoords Uses

func (q *CommonQuery) DisableCoords(disable bool) *CommonQuery

func (*CommonQuery) HighFreq Uses

func (q *CommonQuery) HighFreq(f float64) *CommonQuery

func (*CommonQuery) HighFreqMinMatch Uses

func (q *CommonQuery) HighFreqMinMatch(min interface{}) *CommonQuery

func (*CommonQuery) HighFreqOperator Uses

func (q *CommonQuery) HighFreqOperator(op string) *CommonQuery

func (*CommonQuery) LowFreq Uses

func (q *CommonQuery) LowFreq(f float64) *CommonQuery

func (*CommonQuery) LowFreqMinMatch Uses

func (q *CommonQuery) LowFreqMinMatch(min interface{}) *CommonQuery

func (*CommonQuery) LowFreqOperator Uses

func (q *CommonQuery) LowFreqOperator(op string) *CommonQuery

func (CommonQuery) Source Uses

func (q CommonQuery) Source() interface{}

Creates the query source for the common query.

type CompletionSuggester Uses

type CompletionSuggester struct {
    Suggester
    // contains filtered or unexported fields
}

CompletionSuggester is a fast suggester for e.g. type-ahead completion. See http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/search-suggesters-completion.html for more details.

func NewCompletionSuggester Uses

func NewCompletionSuggester(name string) CompletionSuggester

Creates a new completion suggester.

func (CompletionSuggester) Analyzer Uses

func (q CompletionSuggester) Analyzer(analyzer string) CompletionSuggester

func (CompletionSuggester) ContextQueries Uses

func (q CompletionSuggester) ContextQueries(queries ...SuggesterContextQuery) CompletionSuggester

func (CompletionSuggester) ContextQuery Uses

func (q CompletionSuggester) ContextQuery(query SuggesterContextQuery) CompletionSuggester

func (CompletionSuggester) Field Uses

func (q CompletionSuggester) Field(field string) CompletionSuggester

func (CompletionSuggester) Name Uses

func (q CompletionSuggester) Name() string

func (CompletionSuggester) ShardSize Uses

func (q CompletionSuggester) ShardSize(shardSize int) CompletionSuggester

func (CompletionSuggester) Size Uses

func (q CompletionSuggester) Size(size int) CompletionSuggester

func (CompletionSuggester) Source Uses

func (q CompletionSuggester) Source(includeName bool) interface{}

Creates the source for the completion suggester.

func (CompletionSuggester) Text Uses

func (q CompletionSuggester) Text(text string) CompletionSuggester

type CountResult Uses

type CountResult struct {
    Count  int64      `json:"count"`
    Shards shardsInfo `json:"_shards,omitempty"`
}

CountResult is the result returned from using the Count API (http://www.elasticsearch.org/guide/reference/api/count/)

type CountService Uses

type CountService struct {
    // contains filtered or unexported fields
}

CountService is a convenient service for determining the number of documents in an index. Use SearchService with a SearchType of count for counting with queries etc.

func NewCountService Uses

func NewCountService(client *Client) *CountService

func (*CountService) Debug Uses

func (s *CountService) Debug(debug bool) *CountService

func (*CountService) Do Uses

func (s *CountService) Do() (int64, error)

func (*CountService) Index Uses

func (s *CountService) Index(index string) *CountService

func (*CountService) Indices Uses

func (s *CountService) Indices(indices ...string) *CountService

func (*CountService) Pretty Uses

func (s *CountService) Pretty(pretty bool) *CountService

func (*CountService) Query Uses

func (s *CountService) Query(query Query) *CountService

func (*CountService) Type Uses

func (s *CountService) Type(typ string) *CountService

func (*CountService) Types Uses

func (s *CountService) Types(types ...string) *CountService

type CreateIndexResult Uses

type CreateIndexResult struct {
    Acknowledged bool `json:"acknowledged"`
}

type CreateIndexService Uses

type CreateIndexService struct {
    // contains filtered or unexported fields
}

Code:

// Get a client to the local Elasticsearch instance.
client, err := elastic.NewClient(http.DefaultClient)
if err != nil {
    // Handle error
    panic(err)
}
// Create a new index.
createIndex, err := client.CreateIndex("twitter").Do()
if err != nil {
    // Handle error
    panic(err)
}
if !createIndex.Acknowledged {
    // Not acknowledged
}

func NewCreateIndexService Uses

func NewCreateIndexService(client *Client) *CreateIndexService

func (*CreateIndexService) Body Uses

func (b *CreateIndexService) Body(body string) *CreateIndexService

func (*CreateIndexService) Debug Uses

func (b *CreateIndexService) Debug(debug bool) *CreateIndexService

func (*CreateIndexService) Do Uses

func (b *CreateIndexService) Do() (*CreateIndexResult, error)

func (*CreateIndexService) Index Uses

func (b *CreateIndexService) Index(index string) *CreateIndexService

func (*CreateIndexService) Pretty Uses

func (b *CreateIndexService) Pretty(pretty bool) *CreateIndexService

type CustomFiltersScoreQuery Uses

type CustomFiltersScoreQuery struct {
    // contains filtered or unexported fields
}

A custom_filters_score query allows to execute a query, and if the hit matches a provided filter (ordered), use either a boost or a script associated with it to compute the score.

For more details, see: http://www.elasticsearch.org/guide/reference/query-dsl/custom-filters-score-query/

func NewCustomFiltersScoreQuery Uses

func NewCustomFiltersScoreQuery() CustomFiltersScoreQuery

Creates a new custom_filters_score query.

func (CustomFiltersScoreQuery) Filter Uses

func (q CustomFiltersScoreQuery) Filter(filter Filter) CustomFiltersScoreQuery

func (CustomFiltersScoreQuery) MaxBoost Uses

func (q CustomFiltersScoreQuery) MaxBoost(maxBoost float32) CustomFiltersScoreQuery

func (CustomFiltersScoreQuery) Query Uses

func (q CustomFiltersScoreQuery) Query(query Query) CustomFiltersScoreQuery

func (CustomFiltersScoreQuery) ScoreMode Uses

func (q CustomFiltersScoreQuery) ScoreMode(scoreMode string) CustomFiltersScoreQuery

func (CustomFiltersScoreQuery) Script Uses

func (q CustomFiltersScoreQuery) Script(script string) CustomFiltersScoreQuery

func (CustomFiltersScoreQuery) Source Uses

func (q CustomFiltersScoreQuery) Source() interface{}

Creates the query source for the custom_filters_score query.

type CustomScoreQuery Uses

type CustomScoreQuery struct {
    // contains filtered or unexported fields
}

custom_score query allows to wrap another query and customize the scoring of it optionally with a computation derived from other field values in the doc (numeric ones) using script expression.

For more details, see: http://www.elasticsearch.org/guide/reference/query-dsl/custom-score-query/

func NewCustomScoreQuery Uses

func NewCustomScoreQuery() CustomScoreQuery

Creates a new custom_score query.

func (CustomScoreQuery) Boost Uses

func (q CustomScoreQuery) Boost(boost float32) CustomScoreQuery

func (CustomScoreQuery) Filter Uses

func (q CustomScoreQuery) Filter(filter Filter) CustomScoreQuery

func (CustomScoreQuery) Lang Uses

func (q CustomScoreQuery) Lang(lang string) CustomScoreQuery

func (CustomScoreQuery) Param Uses

func (q CustomScoreQuery) Param(name string, value interface{}) CustomScoreQuery

func (CustomScoreQuery) Params Uses

func (q CustomScoreQuery) Params(params map[string]interface{}) CustomScoreQuery

func (CustomScoreQuery) Query Uses

func (q CustomScoreQuery) Query(query Query) CustomScoreQuery

func (CustomScoreQuery) Script Uses

func (q CustomScoreQuery) Script(script string) CustomScoreQuery

func (CustomScoreQuery) Source Uses

func (q CustomScoreQuery) Source() interface{}

Creates the query source for the custom_fscore query.

type DateHistogramAggregation Uses

type DateHistogramAggregation struct {
    // contains filtered or unexported fields
}

DateHistogramAggregation is a multi-bucket aggregation similar to the histogram except it can only be applied on date values. See: http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/search-aggregations-bucket-datehistogram-aggregation.html

func NewDateHistogramAggregation Uses

func NewDateHistogramAggregation() DateHistogramAggregation

func (DateHistogramAggregation) ExtendedBoundsMax Uses

func (a DateHistogramAggregation) ExtendedBoundsMax(max interface{}) DateHistogramAggregation

ExtendedBoundsMax accepts int, int64, string, or time.Time values.

func (DateHistogramAggregation) ExtendedBoundsMin Uses

func (a DateHistogramAggregation) ExtendedBoundsMin(min interface{}) DateHistogramAggregation

ExtendedBoundsMin accepts int, int64, string, or time.Time values.

func (DateHistogramAggregation) Factor Uses

func (a DateHistogramAggregation) Factor(factor float32) DateHistogramAggregation

func (DateHistogramAggregation) Field Uses

func (a DateHistogramAggregation) Field(field string) DateHistogramAggregation

func (DateHistogramAggregation) Format Uses

func (a DateHistogramAggregation) Format(format string) DateHistogramAggregation

func (DateHistogramAggregation) Interval Uses

func (a DateHistogramAggregation) Interval(interval string) DateHistogramAggregation

Allowed values are: "year", "quarter", "month", "week", "day", "hour", "minute". It also supports time settings like "1.5h" (up to "w" for weeks).

func (DateHistogramAggregation) Lang Uses

func (a DateHistogramAggregation) Lang(lang string) DateHistogramAggregation

func (DateHistogramAggregation) MinDocCount Uses

func (a DateHistogramAggregation) MinDocCount(minDocCount int64) DateHistogramAggregation

func (DateHistogramAggregation) Order Uses

func (a DateHistogramAggregation) Order(order string, asc bool) DateHistogramAggregation

Order specifies the sort order. Valid values for order are: "_key", "_count", a sub-aggregation name, or a sub-aggregation name with a metric.

func (DateHistogramAggregation) OrderByAggregation Uses

func (a DateHistogramAggregation) OrderByAggregation(aggName string, asc bool) DateHistogramAggregation

OrderByAggregation creates a bucket ordering strategy which sorts buckets based on a single-valued calc get.

func (DateHistogramAggregation) OrderByAggregationAndMetric Uses

func (a DateHistogramAggregation) OrderByAggregationAndMetric(aggName, metric string, asc bool) DateHistogramAggregation

OrderByAggregationAndMetric creates a bucket ordering strategy which sorts buckets based on a multi-valued calc get.

func (DateHistogramAggregation) OrderByCount Uses

func (a DateHistogramAggregation) OrderByCount(asc bool) DateHistogramAggregation

func (DateHistogramAggregation) OrderByCountAsc Uses

func (a DateHistogramAggregation) OrderByCountAsc() DateHistogramAggregation

func (DateHistogramAggregation) OrderByCountDesc Uses

func (a DateHistogramAggregation) OrderByCountDesc() DateHistogramAggregation

func (DateHistogramAggregation) OrderByKey Uses

func (a DateHistogramAggregation) OrderByKey(asc bool) DateHistogramAggregation

func (DateHistogramAggregation) OrderByKeyAsc Uses

func (a DateHistogramAggregation) OrderByKeyAsc() DateHistogramAggregation

func (DateHistogramAggregation) OrderByKeyDesc Uses

func (a DateHistogramAggregation) OrderByKeyDesc() DateHistogramAggregation

func (DateHistogramAggregation) Param Uses

func (a DateHistogramAggregation) Param(name string, value interface{}) DateHistogramAggregation

func (DateHistogramAggregation) PostOffset Uses

func (a DateHistogramAggregation) PostOffset(postOffset int64) DateHistogramAggregation

func (DateHistogramAggregation) PostZone Uses

func (a DateHistogramAggregation) PostZone(postZone string) DateHistogramAggregation

func (DateHistogramAggregation) PreOffset Uses

func (a DateHistogramAggregation) PreOffset(preOffset int64) DateHistogramAggregation

func (DateHistogramAggregation) PreZone Uses

func (a DateHistogramAggregation) PreZone(preZone string) DateHistogramAggregation

func (DateHistogramAggregation) PreZoneAdjustLargeInterval Uses

func (a DateHistogramAggregation) PreZoneAdjustLargeInterval(preZoneAdjustLargeInterval bool) DateHistogramAggregation

func (DateHistogramAggregation) Script Uses

func (a DateHistogramAggregation) Script(script string) DateHistogramAggregation

func (DateHistogramAggregation) Source Uses

func (a DateHistogramAggregation) Source() interface{}

func (DateHistogramAggregation) SubAggregation Uses

func (a DateHistogramAggregation) SubAggregation(name string, subAggregation Aggregation) DateHistogramAggregation

type DateHistogramFacet Uses

type DateHistogramFacet struct {
    // contains filtered or unexported fields
}

A specific histogram facet that can work with date field types enhancing it over the regular histogram facet. See: http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/search-facets-date-histogram-facet.html

func NewDateHistogramFacet Uses

func NewDateHistogramFacet() DateHistogramFacet

func (DateHistogramFacet) Comparator Uses

func (f DateHistogramFacet) Comparator(comparator string) DateHistogramFacet

func (DateHistogramFacet) FacetFilter Uses

func (f DateHistogramFacet) FacetFilter(filter Facet) DateHistogramFacet

func (DateHistogramFacet) Factor Uses

func (f DateHistogramFacet) Factor(factor float32) DateHistogramFacet

func (DateHistogramFacet) Field Uses

func (f DateHistogramFacet) Field(field string) DateHistogramFacet

func (DateHistogramFacet) Global Uses

func (f DateHistogramFacet) Global(global bool) DateHistogramFacet

func (DateHistogramFacet) Interval Uses

func (f DateHistogramFacet) Interval(interval string) DateHistogramFacet

Allowed values are: "year", "quarter", "month", "week", "day", "hour", "minute". It also supports time settings like "1.5h" (up to "w" for weeks).

func (DateHistogramFacet) KeyField Uses

func (f DateHistogramFacet) KeyField(keyField string) DateHistogramFacet

func (DateHistogramFacet) Lang Uses

func (f DateHistogramFacet) Lang(lang string) DateHistogramFacet

func (DateHistogramFacet) Mode Uses

func (f DateHistogramFacet) Mode(mode string) DateHistogramFacet

func (DateHistogramFacet) Nested Uses

func (f DateHistogramFacet) Nested(nested string) DateHistogramFacet

func (DateHistogramFacet) Param Uses

func (f DateHistogramFacet) Param(name string, value interface{}) DateHistogramFacet

func (DateHistogramFacet) PostOffset Uses

func (f DateHistogramFacet) PostOffset(postOffset string) DateHistogramFacet

func (DateHistogramFacet) PostZone Uses

func (f DateHistogramFacet) PostZone(postZone string) DateHistogramFacet

func (DateHistogramFacet) PreOffset Uses

func (f DateHistogramFacet) PreOffset(preOffset string) DateHistogramFacet

func (DateHistogramFacet) PreZone Uses

func (f DateHistogramFacet) PreZone(preZone string) DateHistogramFacet

func (DateHistogramFacet) PreZoneAdjustLargeInterval Uses

func (f DateHistogramFacet) PreZoneAdjustLargeInterval(preZoneAdjustLargeInterval bool) DateHistogramFacet

func (DateHistogramFacet) Source Uses

func (f DateHistogramFacet) Source() interface{}

func (DateHistogramFacet) ValueField Uses

func (f DateHistogramFacet) ValueField(valueField string) DateHistogramFacet

func (DateHistogramFacet) ValueScript Uses

func (f DateHistogramFacet) ValueScript(valueScript string) DateHistogramFacet

type DateRangeAggregation Uses

type DateRangeAggregation struct {
    // contains filtered or unexported fields
}

DateRangeAggregation is a range aggregation that is dedicated for date values. The main difference between this aggregation and the normal range aggregation is that the from and to values can be expressed in Date Math expressions, and it is also possible to specify a date format by which the from and to response fields will be returned. Note that this aggregration includes the from value and excludes the to value for each range. See: http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/search-aggregations-bucket-daterange-aggregation.html

func NewDateRangeAggregation Uses

func NewDateRangeAggregation() DateRangeAggregation

func (DateRangeAggregation) AddRange Uses

func (a DateRangeAggregation) AddRange(from, to interface{}) DateRangeAggregation

func (DateRangeAggregation) AddRangeWithKey Uses

func (a DateRangeAggregation) AddRangeWithKey(key string, from, to interface{}) DateRangeAggregation

func (DateRangeAggregation) AddUnboundedFrom Uses

func (a DateRangeAggregation) AddUnboundedFrom(to interface{}) DateRangeAggregation

func (DateRangeAggregation) AddUnboundedFromWithKey Uses

func (a DateRangeAggregation) AddUnboundedFromWithKey(key string, to interface{}) DateRangeAggregation

func (DateRangeAggregation) AddUnboundedTo Uses

func (a DateRangeAggregation) AddUnboundedTo(from interface{}) DateRangeAggregation

func (DateRangeAggregation) AddUnboundedToWithKey Uses

func (a DateRangeAggregation) AddUnboundedToWithKey(key string, from interface{}) DateRangeAggregation

func (DateRangeAggregation) Between Uses

func (a DateRangeAggregation) Between(from, to interface{}) DateRangeAggregation

func (DateRangeAggregation) BetweenWithKey Uses

func (a DateRangeAggregation) BetweenWithKey(key string, from, to interface{}) DateRangeAggregation

func (DateRangeAggregation) Field Uses

func (a DateRangeAggregation) Field(field string) DateRangeAggregation

func (DateRangeAggregation) Format Uses

func (a DateRangeAggregation) Format(format string) DateRangeAggregation

func (DateRangeAggregation) Gt Uses

func (a DateRangeAggregation) Gt(from interface{}) DateRangeAggregation

func (DateRangeAggregation) GtWithKey Uses

func (a DateRangeAggregation) GtWithKey(key string, from interface{}) DateRangeAggregation

func (DateRangeAggregation) Keyed Uses

func (a DateRangeAggregation) Keyed(keyed bool) DateRangeAggregation

func (DateRangeAggregation) Lang Uses

func (a DateRangeAggregation) Lang(lang string) DateRangeAggregation

func (DateRangeAggregation) Lt Uses

func (a DateRangeAggregation) Lt(to interface{}) DateRangeAggregation

func (DateRangeAggregation) LtWithKey Uses

func (a DateRangeAggregation) LtWithKey(key string, to interface{}) DateRangeAggregation

func (DateRangeAggregation) Param Uses

func (a DateRangeAggregation) Param(name string, value interface{}) DateRangeAggregation

func (DateRangeAggregation) Script Uses

func (a DateRangeAggregation) Script(script string) DateRangeAggregation

func (DateRangeAggregation) Source Uses

func (a DateRangeAggregation) Source() interface{}

func (DateRangeAggregation) SubAggregation Uses

func (a DateRangeAggregation) SubAggregation(name string, subAggregation Aggregation) DateRangeAggregation

func (DateRangeAggregation) Unmapped Uses

func (a DateRangeAggregation) Unmapped(unmapped bool) DateRangeAggregation

type DateRangeAggregationEntry Uses

type DateRangeAggregationEntry struct {
    Key  string
    From interface{}
    To   interface{}
}

type DeleteByQueryResult Uses

type DeleteByQueryResult struct {
    Indices map[string]IndexDeleteByQueryResult `json:"_indices"`
}

DeleteByQueryResult is the outcome of executing Do with DeleteByQueryService.

type DeleteByQueryService Uses

type DeleteByQueryService struct {
    // contains filtered or unexported fields
}

DeleteByQueryService deletes documents that match a query. See http://www.elasticsearch.org/guide/en/elasticsearch/reference/master/docs-delete-by-query.html.

func NewDeleteByQueryService Uses

func NewDeleteByQueryService(client *Client) *DeleteByQueryService

NewDeleteByQueryService creates a new DeleteByQueryService. You typically use the client's DeleteByQuery to get a reference to the service.

func (*DeleteByQueryService) AllowNoIndices Uses

func (s *DeleteByQueryService) AllowNoIndices(allow bool) *DeleteByQueryService

AllowNoIndices indicates whether to ignore if a wildcard indices expression resolves into no concrete indices (including the _all string or when no indices have been specified).

func (*DeleteByQueryService) Analyzer Uses

func (s *DeleteByQueryService) Analyzer(analyzer string) *DeleteByQueryService

Analyzer to use for the query string.

func (*DeleteByQueryService) Consistency Uses

func (s *DeleteByQueryService) Consistency(consistency string) *DeleteByQueryService

Consistency represents the specific write consistency setting for the operation. It can be one, quorum, or all.

func (*DeleteByQueryService) DF Uses

func (s *DeleteByQueryService) DF(defaultField string) *DeleteByQueryService

DF is the field to use as default where no field prefix is given in the query string.

func (*DeleteByQueryService) Debug Uses

func (s *DeleteByQueryService) Debug(debug bool) *DeleteByQueryService

Debug prints HTTP request and response to os.Stdout.

func (*DeleteByQueryService) DefaultField Uses

func (s *DeleteByQueryService) DefaultField(defaultField string) *DeleteByQueryService

DefaultField is the field to use as default where no field prefix is given in the query string. It is an alias to the DF func.

func (*DeleteByQueryService) DefaultOperator Uses

func (s *DeleteByQueryService) DefaultOperator(defaultOperator string) *DeleteByQueryService

DefaultOperator for query string query (AND or OR).

func (*DeleteByQueryService) Do Uses

func (s *DeleteByQueryService) Do() (*DeleteByQueryResult, error)

Do executes the delete-by-query operation.

func (*DeleteByQueryService) ExpandWildcards Uses

func (s *DeleteByQueryService) ExpandWildcards(expand string) *DeleteByQueryService

ExpandWildcards indicates whether to expand wildcard expression to concrete indices that are open, closed or both. It can be "open" or "closed".

func (*DeleteByQueryService) IgnoreUnavailable Uses

func (s *DeleteByQueryService) IgnoreUnavailable(ignore bool) *DeleteByQueryService

IgnoreUnavailable indicates whether specified concrete indices should be ignored when unavailable (missing or closed).

func (*DeleteByQueryService) Index Uses

func (s *DeleteByQueryService) Index(index string) *DeleteByQueryService

Index limits the delete-by-query to a single index. You can use _all to perform the operation on all indices.

func (*DeleteByQueryService) Indices Uses

func (s *DeleteByQueryService) Indices(indices ...string) *DeleteByQueryService

Indices sets the indices on which to perform the delete operation.

func (*DeleteByQueryService) Pretty Uses

func (s *DeleteByQueryService) Pretty(pretty bool) *DeleteByQueryService

Pretty indents the JSON output from Elasticsearch. Use in combination with Debug to see the actual output of Elasticsearch.

func (*DeleteByQueryService) Q Uses

func (s *DeleteByQueryService) Q(query string) *DeleteByQueryService

Q specifies the query in Lucene query string syntax. You can also use Query to programmatically specify the query.

func (*DeleteByQueryService) Query Uses

func (s *DeleteByQueryService) Query(query Query) *DeleteByQueryService

Query sets the query programmatically.

func (*DeleteByQueryService) QueryString Uses

func (s *DeleteByQueryService) QueryString(query string) *DeleteByQueryService

QueryString is an alias to Q. Notice that you can also use Query to programmatically set the query.

func (*DeleteByQueryService) Replication Uses

func (s *DeleteByQueryService) Replication(replication string) *DeleteByQueryService

Replication sets a specific replication type (sync or async).

func (*DeleteByQueryService) Routing Uses

func (s *DeleteByQueryService) Routing(routing string) *DeleteByQueryService

Routing sets a specific routing value.

func (*DeleteByQueryService) Timeout Uses

func (s *DeleteByQueryService) Timeout(timeout string) *DeleteByQueryService

Timeout sets an explicit operation timeout, e.g. "1s" or "10000ms".

func (*DeleteByQueryService) Type Uses

func (s *DeleteByQueryService) Type(typ string) *DeleteByQueryService

Type limits the delete operation to the given type.

func (*DeleteByQueryService) Types Uses

func (s *DeleteByQueryService) Types(types ...string) *DeleteByQueryService

Types limits the delete operation to the given types.

type DeleteIndexResult Uses

type DeleteIndexResult struct {
    Acknowledged bool `json:"acknowledged"`
}

type DeleteIndexService Uses

type DeleteIndexService struct {
    // contains filtered or unexported fields
}

Code:

// Get a client to the local Elasticsearch instance.
client, err := elastic.NewClient(http.DefaultClient)
if err != nil {
    // Handle error
    panic(err)
}
// Delete an index.
deleteIndex, err := client.DeleteIndex("twitter").Do()
if err != nil {
    // Handle error
    panic(err)
}
if !deleteIndex.Acknowledged {
    // Not acknowledged
}

func NewDeleteIndexService Uses

func NewDeleteIndexService(client *Client) *DeleteIndexService

func (*DeleteIndexService) Do Uses

func (b *DeleteIndexService) Do() (*DeleteIndexResult, error)

func (*DeleteIndexService) Index Uses

func (b *DeleteIndexService) Index(index string) *DeleteIndexService

type DeleteResult Uses

type DeleteResult struct {
    Found   bool   `json:"found"`
    Index   string `json:"_index"`
    Type    string `json:"_type"`
    Id      string `json:"_id"`
    Version int64  `json:"_version"`
}

type DeleteService Uses

type DeleteService struct {
    // contains filtered or unexported fields
}

func NewDeleteService Uses

func NewDeleteService(client *Client) *DeleteService

func (*DeleteService) Debug Uses

func (s *DeleteService) Debug(debug bool) *DeleteService

func (*DeleteService) Do Uses

func (s *DeleteService) Do() (*DeleteResult, error)

func (*DeleteService) Id Uses

func (s *DeleteService) Id(id string) *DeleteService

func (*DeleteService) Index Uses

func (s *DeleteService) Index(index string) *DeleteService

func (*DeleteService) Parent Uses

func (s *DeleteService) Parent(parent string) *DeleteService

func (*DeleteService) Pretty Uses

func (s *DeleteService) Pretty(pretty bool) *DeleteService

func (*DeleteService) Refresh Uses

func (s *DeleteService) Refresh(refresh bool) *DeleteService

func (*DeleteService) Type Uses

func (s *DeleteService) Type(_type string) *DeleteService

func (*DeleteService) Version Uses

func (s *DeleteService) Version(version int) *DeleteService

type DeleteTemplateResponse Uses

type DeleteTemplateResponse struct {
    Found   bool   `json:"found"`
    Index   string `json:"_index"`
    Type    string `json:"_type"`
    Id      string `json:"_id"`
    Version int    `json:"_version"`
}

DeleteTemplateResponse is the response of DeleteTemplateService.Do.

type DeleteTemplateService Uses

type DeleteTemplateService struct {
    // contains filtered or unexported fields
}

DeleteTemplateService deletes a search template. More information can be found at http://www.elasticsearch.org/guide/en/elasticsearch/reference/master/search-template.html.

Code:

client, err := elastic.NewClient(http.DefaultClient)
if err != nil {
    panic(err)
}

// Delete template
resp, err := client.DeleteTemplate().Id("my-search-template").Do()
if err != nil {
    panic(err)
}
if resp != nil && resp.Found {
    fmt.Println("template deleted")
}

func NewDeleteTemplateService Uses

func NewDeleteTemplateService(client *Client) *DeleteTemplateService

NewDeleteTemplateService creates a new DeleteTemplateService.

func (*DeleteTemplateService) Do Uses

func (s *DeleteTemplateService) Do() (*DeleteTemplateResponse, error)

Do executes the operation.

func (*DeleteTemplateService) Id Uses

func (s *DeleteTemplateService) Id(id string) *DeleteTemplateService

Id is the template ID.

func (*DeleteTemplateService) Validate Uses

func (s *DeleteTemplateService) Validate() error

Validate checks if the operation is valid.

func (*DeleteTemplateService) Version Uses

func (s *DeleteTemplateService) Version(version int) *DeleteTemplateService

Version an explicit version number for concurrency control.

func (*DeleteTemplateService) VersionType Uses

func (s *DeleteTemplateService) VersionType(versionType string) *DeleteTemplateService

VersionType specifies a version type.

type DirectCandidateGenerator Uses

type DirectCandidateGenerator struct {
    // contains filtered or unexported fields
}

DirectCandidateGenerator implements a direct candidate generator. See http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/search-suggesters-phrase.html#_smoothing_models for details about smoothing models.

func NewDirectCandidateGenerator Uses

func NewDirectCandidateGenerator(field string) *DirectCandidateGenerator

func (*DirectCandidateGenerator) Accuracy Uses

func (g *DirectCandidateGenerator) Accuracy(accuracy float64) *DirectCandidateGenerator

func (*DirectCandidateGenerator) Field Uses

func (g *DirectCandidateGenerator) Field(field string) *DirectCandidateGenerator

func (*DirectCandidateGenerator) MaxEdits Uses

func (g *DirectCandidateGenerator) MaxEdits(maxEdits int) *DirectCandidateGenerator

func (*DirectCandidateGenerator) MaxInspections Uses

func (g *DirectCandidateGenerator) MaxInspections(maxInspections int) *DirectCandidateGenerator

func (*DirectCandidateGenerator) MaxTermFreq Uses

func (g *DirectCandidateGenerator) MaxTermFreq(maxTermFreq float64) *DirectCandidateGenerator

func (*DirectCandidateGenerator) MinDocFreq Uses

func (g *DirectCandidateGenerator) MinDocFreq(minDocFreq float64) *DirectCandidateGenerator

func (*DirectCandidateGenerator) MinWordLength Uses

func (g *DirectCandidateGenerator) MinWordLength(minWordLength int) *DirectCandidateGenerator

func (*DirectCandidateGenerator) PostFilter Uses

func (g *DirectCandidateGenerator) PostFilter(postFilter string) *DirectCandidateGenerator

func (*DirectCandidateGenerator) PreFilter Uses

func (g *DirectCandidateGenerator) PreFilter(preFilter string) *DirectCandidateGenerator

func (*DirectCandidateGenerator) PrefixLength Uses

func (g *DirectCandidateGenerator) PrefixLength(prefixLength int) *DirectCandidateGenerator

func (*DirectCandidateGenerator) Size Uses

func (g *DirectCandidateGenerator) Size(size int) *DirectCandidateGenerator

func (*DirectCandidateGenerator) Sort Uses

func (g *DirectCandidateGenerator) Sort(sort string) *DirectCandidateGenerator

func (*DirectCandidateGenerator) Source Uses

func (g *DirectCandidateGenerator) Source() interface{}

func (*DirectCandidateGenerator) StringDistance Uses

func (g *DirectCandidateGenerator) StringDistance(stringDistance string) *DirectCandidateGenerator

func (*DirectCandidateGenerator) SuggestMode Uses

func (g *DirectCandidateGenerator) SuggestMode(suggestMode string) *DirectCandidateGenerator

func (*DirectCandidateGenerator) Type Uses

func (g *DirectCandidateGenerator) Type() string

type DisMaxQuery Uses

type DisMaxQuery struct {
    // contains filtered or unexported fields
}

A query that generates the union of documents produced by its subqueries, and that scores each document with the maximum score for that document as produced by any subquery, plus a tie breaking increment for any additional matching subqueries.

For more details, see: http://www.elasticsearch.org/guide/reference/query-dsl/dis-max-query/

func NewDisMaxQuery Uses

func NewDisMaxQuery() DisMaxQuery

Creates a new dis_max query.

func (DisMaxQuery) Boost Uses

func (q DisMaxQuery) Boost(boost float32) DisMaxQuery

func (DisMaxQuery) Query Uses

func (q DisMaxQuery) Query(query Query) DisMaxQuery

func (DisMaxQuery) Source Uses

func (q DisMaxQuery) Source() interface{}

Creates the query source for the dis_max query.

func (DisMaxQuery) TieBreaker Uses

func (q DisMaxQuery) TieBreaker(tieBreaker float32) DisMaxQuery

type Error Uses

type Error struct {
    Status  int    `json:"status"`
    Message string `json:"error"`
}

func (*Error) Error Uses

func (e *Error) Error() error

type ExistsFilter Uses

type ExistsFilter struct {
    Filter
    // contains filtered or unexported fields
}

Filters documents where a specific field has a value in them. For details, see: http://www.elasticsearch.org/guide/reference/query-dsl/exists-filter.html

func NewExistsFilter Uses

func NewExistsFilter(name string) ExistsFilter

func (ExistsFilter) FilterName Uses

func (f ExistsFilter) FilterName(filterName string) ExistsFilter

func (ExistsFilter) Source Uses

func (f ExistsFilter) Source() interface{}

type ExistsService Uses

type ExistsService struct {
    // contains filtered or unexported fields
}

func NewExistsService Uses

func NewExistsService(client *Client) *ExistsService

func (*ExistsService) Do Uses

func (s *ExistsService) Do() (bool, error)

func (*ExistsService) Id Uses

func (s *ExistsService) Id(id string) *ExistsService

func (*ExistsService) Index Uses

func (s *ExistsService) Index(index string) *ExistsService

func (*ExistsService) String Uses

func (s *ExistsService) String() string

func (*ExistsService) Type Uses

func (s *ExistsService) Type(_type string) *ExistsService

type ExponentialDecayFunction Uses

type ExponentialDecayFunction struct {
    // contains filtered or unexported fields
}

func NewExponentialDecayFunction Uses

func NewExponentialDecayFunction() ExponentialDecayFunction

func (ExponentialDecayFunction) Decay Uses

func (fn ExponentialDecayFunction) Decay(decay float64) ExponentialDecayFunction

func (ExponentialDecayFunction) FieldName Uses

func (fn ExponentialDecayFunction) FieldName(fieldName string) ExponentialDecayFunction

func (ExponentialDecayFunction) Name Uses

func (fn ExponentialDecayFunction) Name() string

func (ExponentialDecayFunction) Offset Uses

func (fn ExponentialDecayFunction) Offset(offset interface{}) ExponentialDecayFunction

func (ExponentialDecayFunction) Origin Uses

func (fn ExponentialDecayFunction) Origin(origin interface{}) ExponentialDecayFunction

func (ExponentialDecayFunction) Scale Uses

func (fn ExponentialDecayFunction) Scale(scale interface{}) ExponentialDecayFunction

func (ExponentialDecayFunction) Source Uses

func (fn ExponentialDecayFunction) Source() interface{}

type ExtendedStatsAggregation Uses

type ExtendedStatsAggregation struct {
    // contains filtered or unexported fields
}

ExtendedExtendedStatsAggregation is a multi-value metrics aggregation that computes stats over numeric values extracted from the aggregated documents. These values can be extracted either from specific numeric fields in the documents, or be generated by a provided script. See: http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/search-aggregations-metrics-extendedstats-aggregation.html

func NewExtendedStatsAggregation Uses

func NewExtendedStatsAggregation() ExtendedStatsAggregation

func (ExtendedStatsAggregation) Field Uses

func (a ExtendedStatsAggregation) Field(field string) ExtendedStatsAggregation

func (ExtendedStatsAggregation) Format Uses

func (a ExtendedStatsAggregation) Format(format string) ExtendedStatsAggregation

func (ExtendedStatsAggregation) Lang Uses

func (a ExtendedStatsAggregation) Lang(lang string) ExtendedStatsAggregation

func (ExtendedStatsAggregation) Param Uses

func (a ExtendedStatsAggregation) Param(name string, value interface{}) ExtendedStatsAggregation

func (ExtendedStatsAggregation) Script Uses

func (a ExtendedStatsAggregation) Script(script string) ExtendedStatsAggregation

func (ExtendedStatsAggregation) Source Uses

func (a ExtendedStatsAggregation) Source() interface{}

func (ExtendedStatsAggregation) SubAggregation Uses

func (a ExtendedStatsAggregation) SubAggregation(name string, subAggregation Aggregation) ExtendedStatsAggregation

type Facet Uses

type Facet interface {
    Source() interface{}
}

Represents a glimpse into the data. For more details about facets, visit: http://elasticsearch.org/guide/reference/api/search/facets/

type FactorFunction Uses

type FactorFunction struct {
    // contains filtered or unexported fields
}

func NewFactorFunction Uses

func NewFactorFunction() FactorFunction

func (FactorFunction) BoostFactor Uses

func (fn FactorFunction) BoostFactor(boost float32) FactorFunction

func (FactorFunction) Name Uses

func (fn FactorFunction) Name() string

func (FactorFunction) Source Uses

func (fn FactorFunction) Source() interface{}

type FetchSourceContext Uses

type FetchSourceContext struct {
    // contains filtered or unexported fields
}

func NewFetchSourceContext Uses

func NewFetchSourceContext(fetchSource bool) *FetchSourceContext

func (*FetchSourceContext) Exclude Uses

func (fsc *FetchSourceContext) Exclude(excludes ...string) *FetchSourceContext

func (*FetchSourceContext) FetchSource Uses

func (fsc *FetchSourceContext) FetchSource() bool

func (*FetchSourceContext) Include Uses

func (fsc *FetchSourceContext) Include(includes ...string) *FetchSourceContext

func (*FetchSourceContext) Query Uses

func (fsc *FetchSourceContext) Query() url.Values

Query returns the parameters in a form suitable for a URL query string.

func (*FetchSourceContext) SetFetchSource Uses

func (fsc *FetchSourceContext) SetFetchSource(fetchSource bool)

func (*FetchSourceContext) Source Uses

func (fsc *FetchSourceContext) Source() interface{}

func (*FetchSourceContext) TransformSource Uses

func (fsc *FetchSourceContext) TransformSource(transformSource bool) *FetchSourceContext

type FieldSort Uses

type FieldSort struct {
    Sorter
    // contains filtered or unexported fields
}

FieldSort sorts by a given field.

func NewFieldSort Uses

func NewFieldSort(fieldName string) FieldSort

NewFieldSort creates a new FieldSort.

func (FieldSort) Asc Uses

func (s FieldSort) Asc() FieldSort

Asc sets ascending sort order.

func (FieldSort) Desc Uses

func (s FieldSort) Desc() FieldSort

Desc sets descending sort order.

func (FieldSort) FieldName Uses

func (s FieldSort) FieldName(fieldName string) FieldSort

FieldName specifies the name of the field to be used for sorting.

func (FieldSort) IgnoreUnmapped Uses

func (s FieldSort) IgnoreUnmapped(ignoreUnmapped bool) FieldSort

IgnoreUnmapped specifies what happens if the field does not exist in the index. Set it to true to ignore, or set it to false to not ignore (default).

func (FieldSort) Missing Uses

func (s FieldSort) Missing(missing interface{}) FieldSort

Missing sets the value to be used when a field is missing in a document. You can also use "_last" or "_first" to sort missing last or first respectively.

func (FieldSort) NestedFilter Uses

func (s FieldSort) NestedFilter(nestedFilter Filter) FieldSort

NestedFilter sets a filter that nested objects should match with in order to be taken into account for sorting.

func (FieldSort) NestedPath Uses

func (s FieldSort) NestedPath(nestedPath string) FieldSort

NestedPath is used if sorting occurs on a field that is inside a nested object.

func (FieldSort) Order Uses

func (s FieldSort) Order(ascending bool) FieldSort

Order defines whether sorting ascending (default) or descending.

func (FieldSort) SortMode Uses

func (s FieldSort) SortMode(sortMode string) FieldSort

SortMode specifies what values to pick in case a document contains multiple values for the targeted sort field. Possible values are: min, max, sum, and avg.

func (FieldSort) Source Uses

func (s FieldSort) Source() interface{}

Source returns the JSON-serializable data.

func (FieldSort) UnmappedType Uses

func (s FieldSort) UnmappedType(typ string) FieldSort

UnmappedType sets the type to use when the current field is not mapped in an index.

type FieldValueFactorFunction Uses

type FieldValueFactorFunction struct {
    // contains filtered or unexported fields
}

FieldValueFactorFunction is a function score function that allows you to use a field from a document to influence the score. See http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/query-dsl-function-score-query.html#_field_value_factor.

func NewFieldValueFactorFunction Uses

func NewFieldValueFactorFunction() FieldValueFactorFunction

NewFieldValueFactorFunction creates a new FieldValueFactorFunction.

func (FieldValueFactorFunction) Factor Uses

func (fn FieldValueFactorFunction) Factor(factor float64) FieldValueFactorFunction

Factor is the (optional) factor to multiply the field with. If you do not specify a factor, the default is 1.

func (FieldValueFactorFunction) Field Uses

func (fn FieldValueFactorFunction) Field(field string) FieldValueFactorFunction

Field is the field to be extracted from the document.

func (FieldValueFactorFunction) Modifier Uses

func (fn FieldValueFactorFunction) Modifier(modifier string) FieldValueFactorFunction

Modifier to apply to the field value. It can be one of: none, log, log1p, log2p, ln, ln1p, ln2p, square, sqrt, or reciprocal. Defaults to: none.

func (FieldValueFactorFunction) Name Uses

func (fn FieldValueFactorFunction) Name() string

Name of the function score function.

func (FieldValueFactorFunction) Source Uses

func (fn FieldValueFactorFunction) Source() interface{}

Source returns the JSON to be serialized into the query.

type Filter Uses

type Filter interface {
    Source() interface{}
}

type FilterAggregation Uses

type FilterAggregation struct {
    // contains filtered or unexported fields
}

FilterAggregation defines a single bucket of all the documents in the current document set context that match a specified filter. Often this will be used to narrow down the current aggregation context to a specific set of documents. See: http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/search-aggregations-bucket-filter-aggregation.html

func NewFilterAggregation Uses

func NewFilterAggregation() FilterAggregation

func (FilterAggregation) Filter Uses

func (a FilterAggregation) Filter(filter Filter) FilterAggregation

func (FilterAggregation) Source Uses

func (a FilterAggregation) Source() interface{}

func (FilterAggregation) SubAggregation Uses

func (a FilterAggregation) SubAggregation(name string, subAggregation Aggregation) FilterAggregation

type FilterFacet Uses

type FilterFacet struct {
    // contains filtered or unexported fields
}

A filter facet (not to be confused with a facet filter) allows you to return a count of the hits matching the filter. The filter itself can be expressed using the Query DSL. See: http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/search-facets-filter-facet.html

func NewFilterFacet Uses

func NewFilterFacet() FilterFacet

func (FilterFacet) FacetFilter Uses

func (f FilterFacet) FacetFilter(filter Facet) FilterFacet

func (FilterFacet) Filter Uses

func (f FilterFacet) Filter(filter Filter) FilterFacet

func (FilterFacet) Global Uses

func (f FilterFacet) Global(global bool) FilterFacet

func (FilterFacet) Mode Uses

func (f FilterFacet) Mode(mode string) FilterFacet

func (FilterFacet) Nested Uses

func (f FilterFacet) Nested(nested string) FilterFacet

func (FilterFacet) Source Uses

func (f FilterFacet) Source() interface{}

type FilteredQuery Uses

type FilteredQuery struct {
    Query
    // contains filtered or unexported fields
}

A query that applies a filter to the results of another query. For more details, see http://www.elasticsearch.org/guide/reference/query-dsl/filtered-query.html

func NewFilteredQuery Uses

func NewFilteredQuery(query Query) FilteredQuery

Creates a new filtered query.

func (FilteredQuery) Boost Uses

func (q FilteredQuery) Boost(boost float32) FilteredQuery

func (FilteredQuery) Filter Uses

func (q FilteredQuery) Filter(filter Filter) FilteredQuery

func (FilteredQuery) Source Uses

func (q FilteredQuery) Source() interface{}

Creates the query source for the filtered query.

type FiltersAggregation Uses

type FiltersAggregation struct {
    // contains filtered or unexported fields
}

FiltersAggregation defines a multi bucket aggregations where each bucket is associated with a filter. Each bucket will collect all documents that match its associated filter. See: http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/search-aggregations-bucket-filters-aggregation.html

func NewFiltersAggregation Uses

func NewFiltersAggregation() FiltersAggregation

func (FiltersAggregation) Filter Uses

func (a FiltersAggregation) Filter(filter Filter) FiltersAggregation

func (FiltersAggregation) Filters Uses

func (a FiltersAggregation) Filters(filters ...Filter) FiltersAggregation

func (FiltersAggregation) Source Uses

func (a FiltersAggregation) Source() interface{}

func (FiltersAggregation) SubAggregation Uses

func (a FiltersAggregation) SubAggregation(name string, subAggregation Aggregation) FiltersAggregation

type FlushResult Uses

type FlushResult struct {
    Shards shardsInfo `json:"_shards"`
}

type FlushService Uses

type FlushService struct {
    // contains filtered or unexported fields
}

func NewFlushService Uses

func NewFlushService(client *Client) *FlushService

func (*FlushService) Do Uses

func (s *FlushService) Do() (*FlushResult, error)

func (*FlushService) Full Uses

func (s *FlushService) Full(full bool) *FlushService

func (*FlushService) Index Uses

func (s *FlushService) Index(index string) *FlushService

func (*FlushService) Indices Uses

func (s *FlushService) Indices(indices ...string) *FlushService

func (*FlushService) Refresh Uses

func (s *FlushService) Refresh(refresh bool) *FlushService

type FunctionScoreQuery Uses

type FunctionScoreQuery struct {
    // contains filtered or unexported fields
}

The function_score allows you to modify the score of documents that are retrieved by a query. This can be useful if, for example, a score function is computationally expensive and it is sufficient to compute the score on a filtered set of documents. For more details, see http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/query-dsl-function-score-query.html

func NewFunctionScoreQuery Uses

func NewFunctionScoreQuery() FunctionScoreQuery

NewFunctionScoreQuery creates a new function score query.

func (FunctionScoreQuery) Add Uses

func (q FunctionScoreQuery) Add(filter Filter, scoreFunc ScoreFunction) FunctionScoreQuery

func (FunctionScoreQuery) AddScoreFunc Uses

func (q FunctionScoreQuery) AddScoreFunc(scoreFunc ScoreFunction) FunctionScoreQuery

func (FunctionScoreQuery) Boost Uses

func (q FunctionScoreQuery) Boost(boost float32) FunctionScoreQuery

func (FunctionScoreQuery) BoostMode Uses

func (q FunctionScoreQuery) BoostMode(boostMode string) FunctionScoreQuery

func (FunctionScoreQuery) Filter Uses

func (q FunctionScoreQuery) Filter(filter Filter) FunctionScoreQuery

func (FunctionScoreQuery) MaxBoost Uses

func (q FunctionScoreQuery) MaxBoost(maxBoost float32) FunctionScoreQuery

func (FunctionScoreQuery) Query Uses

func (q FunctionScoreQuery) Query(query Query) FunctionScoreQuery

func (FunctionScoreQuery) ScoreMode Uses

func (q FunctionScoreQuery) ScoreMode(scoreMode string) FunctionScoreQuery

func (FunctionScoreQuery) Source Uses

func (q FunctionScoreQuery) Source() interface{}

Source returns JSON for the function score query.

type FuzzyCompletionSuggester Uses

type FuzzyCompletionSuggester struct {
    Suggester
    // contains filtered or unexported fields
}

FuzzyFuzzyCompletionSuggester is a FuzzyCompletionSuggester that allows fuzzy completion. See http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/search-suggesters-completion.html for details, and http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/search-suggesters-completion.html#fuzzy for details about the fuzzy completion suggester.

func NewFuzzyCompletionSuggester Uses

func NewFuzzyCompletionSuggester(name string) FuzzyCompletionSuggester

Creates a new completion suggester.

func (FuzzyCompletionSuggester) Analyzer Uses

func (q FuzzyCompletionSuggester) Analyzer(analyzer string) FuzzyCompletionSuggester

func (FuzzyCompletionSuggester) ContextQueries Uses

func (q FuzzyCompletionSuggester) ContextQueries(queries ...SuggesterContextQuery) FuzzyCompletionSuggester

func (FuzzyCompletionSuggester) ContextQuery Uses

func (q FuzzyCompletionSuggester) ContextQuery(query SuggesterContextQuery) FuzzyCompletionSuggester

func (FuzzyCompletionSuggester) Field Uses

func (q FuzzyCompletionSuggester) Field(field string) FuzzyCompletionSuggester

func (FuzzyCompletionSuggester) Fuzziness Uses

func (q FuzzyCompletionSuggester) Fuzziness(fuzziness interface{}) FuzzyCompletionSuggester

Fuzziness defines the strategy used to describe what "fuzzy" actually means for the suggester, e.g. 1, 2, "0", "1..2", ">4", or "AUTO". See http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/common-options.html#fuzziness for a detailed description.

func (FuzzyCompletionSuggester) FuzzyMinLength Uses

func (q FuzzyCompletionSuggester) FuzzyMinLength(minLength int) FuzzyCompletionSuggester

func (FuzzyCompletionSuggester) FuzzyPrefixLength Uses

func (q FuzzyCompletionSuggester) FuzzyPrefixLength(prefixLength int) FuzzyCompletionSuggester

func (FuzzyCompletionSuggester) FuzzyTranspositions Uses

func (q FuzzyCompletionSuggester) FuzzyTranspositions(fuzzyTranspositions bool) FuzzyCompletionSuggester

func (FuzzyCompletionSuggester) Name Uses

func (q FuzzyCompletionSuggester) Name() string

func (FuzzyCompletionSuggester) ShardSize Uses

func (q FuzzyCompletionSuggester) ShardSize(shardSize int) FuzzyCompletionSuggester

func (FuzzyCompletionSuggester) Size Uses

func (q FuzzyCompletionSuggester) Size(size int) FuzzyCompletionSuggester

func (FuzzyCompletionSuggester) Source Uses

func (q FuzzyCompletionSuggester) Source(includeName bool) interface{}

Creates the source for the completion suggester.

func (FuzzyCompletionSuggester) Text Uses

func (q FuzzyCompletionSuggester) Text(text string) FuzzyCompletionSuggester

func (FuzzyCompletionSuggester) UnicodeAware Uses

func (q FuzzyCompletionSuggester) UnicodeAware(unicodeAware bool) FuzzyCompletionSuggester

type FuzzyLikeThisFieldQuery Uses

type FuzzyLikeThisFieldQuery struct {
    Query
    // contains filtered or unexported fields
}

FuzzyLikeThisFieldQuery is the same as the fuzzy_like_this query, except that it runs against a single field. It provides nicer query DSL over the generic fuzzy_like_this query, and support typed fields query (automatically wraps typed fields with type filter to match only on the specific type). For more details, see http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/query-dsl-flt-field-query.html

func NewFuzzyLikeThisFieldQuery Uses

func NewFuzzyLikeThisFieldQuery(field string) FuzzyLikeThisFieldQuery

NewFuzzyLikeThisFieldQuery creates a new fuzzy like this field query.

func (FuzzyLikeThisFieldQuery) Analyzer Uses

func (q FuzzyLikeThisFieldQuery) Analyzer(analyzer string) FuzzyLikeThisFieldQuery

func (FuzzyLikeThisFieldQuery) Boost Uses

func (q FuzzyLikeThisFieldQuery) Boost(boost float32) FuzzyLikeThisFieldQuery

func (FuzzyLikeThisFieldQuery) FailOnUnsupportedField Uses

func (q FuzzyLikeThisFieldQuery) FailOnUnsupportedField(fail bool) FuzzyLikeThisFieldQuery

func (FuzzyLikeThisFieldQuery) Fuzziness Uses

func (q FuzzyLikeThisFieldQuery) Fuzziness(fuzziness interface{}) FuzzyLikeThisFieldQuery

Fuzziness can be an integer/long like 0, 1 or 2 as well as strings like "auto", "0..1", "1..4" or "0.0..1.0".

func (FuzzyLikeThisFieldQuery) IgnoreTF Uses

func (q FuzzyLikeThisFieldQuery) IgnoreTF(ignoreTF bool) FuzzyLikeThisFieldQuery

func (FuzzyLikeThisFieldQuery) LikeText Uses

func (q FuzzyLikeThisFieldQuery) LikeText(likeText string) FuzzyLikeThisFieldQuery

func (FuzzyLikeThisFieldQuery) MaxQueryTerms Uses

func (q FuzzyLikeThisFieldQuery) MaxQueryTerms(maxQueryTerms int) FuzzyLikeThisFieldQuery

func (FuzzyLikeThisFieldQuery) PrefixLength Uses

func (q FuzzyLikeThisFieldQuery) PrefixLength(prefixLength int) FuzzyLikeThisFieldQuery

func (FuzzyLikeThisFieldQuery) QueryName Uses

func (q FuzzyLikeThisFieldQuery) QueryName(queryName string) FuzzyLikeThisFieldQuery

func (FuzzyLikeThisFieldQuery) Source Uses

func (q FuzzyLikeThisFieldQuery) Source() interface{}

Creates the query source for the ids query.

type FuzzyLikeThisQuery Uses

type FuzzyLikeThisQuery struct {
    Query
    // contains filtered or unexported fields
}

FuzzyLikeThisQuery finds documents that are "like" provided text by running it against one or more fields. For more details, see http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/query-dsl-flt-query.html

func NewFuzzyLikeThisQuery Uses

func NewFuzzyLikeThisQuery() FuzzyLikeThisQuery

NewFuzzyLikeThisQuery creates a new fuzzy query.

func (FuzzyLikeThisQuery) Analyzer Uses

func (q FuzzyLikeThisQuery) Analyzer(analyzer string) FuzzyLikeThisQuery

func (FuzzyLikeThisQuery) Boost Uses

func (q FuzzyLikeThisQuery) Boost(boost float32) FuzzyLikeThisQuery

func (FuzzyLikeThisQuery) FailOnUnsupportedField Uses

func (q FuzzyLikeThisQuery) FailOnUnsupportedField(fail bool) FuzzyLikeThisQuery

func (FuzzyLikeThisQuery) Field Uses

func (q FuzzyLikeThisQuery) Field(field string) FuzzyLikeThisQuery

func (FuzzyLikeThisQuery) Fields Uses

func (q FuzzyLikeThisQuery) Fields(fields ...string) FuzzyLikeThisQuery

func (FuzzyLikeThisQuery) Fuzziness Uses

func (q FuzzyLikeThisQuery) Fuzziness(fuzziness interface{}) FuzzyLikeThisQuery

Fuzziness can be an integer/long like 0, 1 or 2 as well as strings like "auto", "0..1", "1..4" or "0.0..1.0".

func (FuzzyLikeThisQuery) IgnoreTF Uses

func (q FuzzyLikeThisQuery) IgnoreTF(ignoreTF bool) FuzzyLikeThisQuery

func (FuzzyLikeThisQuery) LikeText Uses

func (q FuzzyLikeThisQuery) LikeText(likeText string) FuzzyLikeThisQuery

func (FuzzyLikeThisQuery) MaxQueryTerms Uses

func (q FuzzyLikeThisQuery) MaxQueryTerms(maxQueryTerms int) FuzzyLikeThisQuery

func (FuzzyLikeThisQuery) PrefixLength Uses

func (q FuzzyLikeThisQuery) PrefixLength(prefixLength int) FuzzyLikeThisQuery

func (FuzzyLikeThisQuery) QueryName Uses

func (q FuzzyLikeThisQuery) QueryName(queryName string) FuzzyLikeThisQuery

func (FuzzyLikeThisQuery) Source Uses

func (q FuzzyLikeThisQuery) Source() interface{}

Creates the query source for the ids query.

type FuzzyQuery Uses

type FuzzyQuery struct {
    Query
    // contains filtered or unexported fields
}

FuzzyQuery uses similarity based on Levenshtein edit distance for string fields, and a +/- margin on numeric and date fields. For more details, see http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/query-dsl-fuzzy-query.html

func NewFuzzyQuery Uses

func NewFuzzyQuery() FuzzyQuery

NewFuzzyQuery creates a new fuzzy query.

func (FuzzyQuery) Boost Uses

func (q FuzzyQuery) Boost(boost float32) FuzzyQuery

func (FuzzyQuery) Fuzziness Uses

func (q FuzzyQuery) Fuzziness(fuzziness interface{}) FuzzyQuery

Fuzziness can be an integer/long like 0, 1 or 2 as well as strings like "auto", "0..1", "1..4" or "0.0..1.0".

func (FuzzyQuery) MaxExpansions Uses

func (q FuzzyQuery) MaxExpansions(maxExpansions int) FuzzyQuery

func (FuzzyQuery) Name Uses

func (q FuzzyQuery) Name(name string) FuzzyQuery

func (FuzzyQuery) PrefixLength Uses

func (q FuzzyQuery) PrefixLength(prefixLength int) FuzzyQuery

func (FuzzyQuery) QueryName Uses

func (q FuzzyQuery) QueryName(queryName string) FuzzyQuery

func (FuzzyQuery) Source Uses

func (q FuzzyQuery) Source() interface{}

Creates the query source for the ids query.

func (FuzzyQuery) Transpositions Uses

func (q FuzzyQuery) Transpositions(transpositions bool) FuzzyQuery

func (FuzzyQuery) Value Uses

func (q FuzzyQuery) Value(value interface{}) FuzzyQuery

type GaussDecayFunction Uses

type GaussDecayFunction struct {
    // contains filtered or unexported fields
}

func NewGaussDecayFunction Uses

func NewGaussDecayFunction() GaussDecayFunction

func (GaussDecayFunction) Decay Uses

func (fn GaussDecayFunction) Decay(decay float64) GaussDecayFunction

func (GaussDecayFunction) FieldName Uses

func (fn GaussDecayFunction) FieldName(fieldName string) GaussDecayFunction

func (GaussDecayFunction) Name Uses

func (fn GaussDecayFunction) Name() string

func (GaussDecayFunction) Offset Uses

func (fn GaussDecayFunction) Offset(offset interface{}) GaussDecayFunction

func (GaussDecayFunction) Origin Uses

func (fn GaussDecayFunction) Origin(origin interface{}) GaussDecayFunction

func (GaussDecayFunction) Scale Uses

func (fn GaussDecayFunction) Scale(scale interface{}) GaussDecayFunction

func (GaussDecayFunction) Source Uses

func (fn GaussDecayFunction) Source() interface{}

type GeoBoundsAggregation Uses

type GeoBoundsAggregation struct {
    // contains filtered or unexported fields
}

GeoBoundsAggregation is a metric aggregation that computes the bounding box containing all geo_point values for a field. See: http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/search-aggregations-metrics-geobounds-aggregation.html

func NewGeoBoundsAggregation Uses

func NewGeoBoundsAggregation() GeoBoundsAggregation

func (GeoBoundsAggregation) Field Uses

func (a GeoBoundsAggregation) Field(field string) GeoBoundsAggregation

func (GeoBoundsAggregation) Lang Uses

func (a GeoBoundsAggregation) Lang(lang string) GeoBoundsAggregation

func (GeoBoundsAggregation) Param Uses

func (a GeoBoundsAggregation) Param(name string, value interface{}) GeoBoundsAggregation

func (GeoBoundsAggregation) Params Uses

func (a GeoBoundsAggregation) Params(params map[string]interface{}) GeoBoundsAggregation

func (GeoBoundsAggregation) Script Uses

func (a GeoBoundsAggregation) Script(script string) GeoBoundsAggregation

func (GeoBoundsAggregation) Source Uses

func (a GeoBoundsAggregation) Source() interface{}

func (GeoBoundsAggregation) WrapLongitude Uses

func (a GeoBoundsAggregation) WrapLongitude(wrapLongitude bool) GeoBoundsAggregation

type GeoDistanceAggregation Uses

type GeoDistanceAggregation struct {
    // contains filtered or unexported fields
}

GeoDistanceAggregation is a multi-bucket aggregation that works on geo_point fields and conceptually works very similar to the range aggregation. The user can define a point of origin and a set of distance range buckets. The aggregation evaluate the distance of each document value from the origin point and determines the buckets it belongs to based on the ranges (a document belongs to a bucket if the distance between the document and the origin falls within the distance range of the bucket). See: http://www.elasticsearch.org/guide/en/elasticsearch/reference/master/search-aggregations-bucket-geodistance-aggregation.html

func NewGeoDistanceAggregation Uses

func NewGeoDistanceAggregation() GeoDistanceAggregation

func (GeoDistanceAggregation) AddRange Uses

func (a GeoDistanceAggregation) AddRange(from, to interface{}) GeoDistanceAggregation

func (GeoDistanceAggregation) AddRangeWithKey Uses

func (a GeoDistanceAggregation) AddRangeWithKey(key string, from, to interface{}) GeoDistanceAggregation

func (GeoDistanceAggregation) AddUnboundedFrom Uses

func (a GeoDistanceAggregation) AddUnboundedFrom(to float64) GeoDistanceAggregation

func (GeoDistanceAggregation) AddUnboundedFromWithKey Uses

func (a GeoDistanceAggregation) AddUnboundedFromWithKey(key string, to float64) GeoDistanceAggregation

func (GeoDistanceAggregation) AddUnboundedTo Uses

func (a GeoDistanceAggregation) AddUnboundedTo(from float64) GeoDistanceAggregation

func (GeoDistanceAggregation) AddUnboundedToWithKey Uses

func (a GeoDistanceAggregation) AddUnboundedToWithKey(key string, from float64) GeoDistanceAggregation

func (GeoDistanceAggregation) Between Uses

func (a GeoDistanceAggregation) Between(from, to interface{}) GeoDistanceAggregation

func (GeoDistanceAggregation) BetweenWithKey Uses

func (a GeoDistanceAggregation) BetweenWithKey(key string, from, to interface{}) GeoDistanceAggregation

func (GeoDistanceAggregation) DistanceType Uses

func (a GeoDistanceAggregation) DistanceType(distanceType string) GeoDistanceAggregation

func (GeoDistanceAggregation) Field Uses

func (a GeoDistanceAggregation) Field(field string) GeoDistanceAggregation

func (GeoDistanceAggregation) Point Uses

func (a GeoDistanceAggregation) Point(latLon string) GeoDistanceAggregation

func (GeoDistanceAggregation) Source Uses

func (a GeoDistanceAggregation) Source() interface{}

func (GeoDistanceAggregation) SubAggregation Uses

func (a GeoDistanceAggregation) SubAggregation(name string, subAggregation Aggregation) GeoDistanceAggregation

func (GeoDistanceAggregation) Unit Uses

func (a GeoDistanceAggregation) Unit(unit string) GeoDistanceAggregation

type GeoDistanceFacet Uses

type GeoDistanceFacet struct {
    // contains filtered or unexported fields
}

The geo_distance facet is a facet providing information for ranges of distances from a provided geo_point including count of the number of hits that fall within each range, and aggregation information (like total). See: http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/search-facets-geo-distance-facet.html

func NewGeoDistanceFacet Uses

func NewGeoDistanceFacet() GeoDistanceFacet

func (GeoDistanceFacet) AddRange Uses

func (f GeoDistanceFacet) AddRange(from, to float64) GeoDistanceFacet

func (GeoDistanceFacet) AddUnboundedFrom Uses

func (f GeoDistanceFacet) AddUnboundedFrom(to float64) GeoDistanceFacet

func (GeoDistanceFacet) AddUnboundedTo Uses

func (f GeoDistanceFacet) AddUnboundedTo(from float64) GeoDistanceFacet

func (GeoDistanceFacet) FacetFilter Uses

func (f GeoDistanceFacet) FacetFilter(filter Facet) GeoDistanceFacet

func (GeoDistanceFacet) Field Uses

func (f GeoDistanceFacet) Field(fieldName string) GeoDistanceFacet

func (GeoDistanceFacet) GeoDistance Uses

func (f GeoDistanceFacet) GeoDistance(geoDistance string) GeoDistanceFacet

func (GeoDistanceFacet) GeoHash Uses

func (f GeoDistanceFacet) GeoHash(geoHash string) GeoDistanceFacet

func (GeoDistanceFacet) Global Uses

func (f GeoDistanceFacet) Global(global bool) GeoDistanceFacet

func (GeoDistanceFacet) Lang Uses

func (f GeoDistanceFacet) Lang(lang string) GeoDistanceFacet

func (GeoDistanceFacet) Lat Uses

func (f GeoDistanceFacet) Lat(lat float64) GeoDistanceFacet

func (GeoDistanceFacet) Lon Uses

func (f GeoDistanceFacet) Lon(lon float64) GeoDistanceFacet

func (GeoDistanceFacet) Mode Uses

func (f GeoDistanceFacet) Mode(mode string) GeoDistanceFacet

func (GeoDistanceFacet) Nested Uses

func (f GeoDistanceFacet) Nested(nested string) GeoDistanceFacet

func (GeoDistanceFacet) Point Uses

func (f GeoDistanceFacet) Point(lat, lon float64) GeoDistanceFacet

func (GeoDistanceFacet) ScriptParam Uses

func (f GeoDistanceFacet) ScriptParam(name string, value interface{}) GeoDistanceFacet

func (GeoDistanceFacet) Source Uses

func (f GeoDistanceFacet) Source() interface{}

func (GeoDistanceFacet) Unit Uses

func (f GeoDistanceFacet) Unit(distanceUnit string) GeoDistanceFacet

func (GeoDistanceFacet) ValueField Uses

func (f GeoDistanceFacet) ValueField(valueFieldName string) GeoDistanceFacet

func (GeoDistanceFacet) ValueScript Uses

func (f GeoDistanceFacet) ValueScript(valueScript string) GeoDistanceFacet

type GeoDistanceSort Uses

type GeoDistanceSort struct {
    Sorter
    // contains filtered or unexported fields
}

GeoDistanceSort allows for sorting by geographic distance. See http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/search-request-sort.html#_geo_distance_sorting.

func NewGeoDistanceSort Uses

func NewGeoDistanceSort(fieldName string) GeoDistanceSort

NewGeoDistanceSort creates a new sorter for geo distances.

func (GeoDistanceSort) Asc Uses

func (s GeoDistanceSort) Asc() GeoDistanceSort

Asc sets ascending sort order.

func (GeoDistanceSort) Desc Uses

func (s GeoDistanceSort) Desc() GeoDistanceSort

Desc sets descending sort order.

func (GeoDistanceSort) FieldName Uses

func (s GeoDistanceSort) FieldName(fieldName string) GeoDistanceSort

FieldName specifies the name of the (geo) field to use for sorting.

func (GeoDistanceSort) GeoDistance Uses

func (s GeoDistanceSort) GeoDistance(geoDistance string) GeoDistanceSort

GeoDistance represents how to compute the distance. It can be sloppy_arc (default), arc, or plane. See http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/search-request-sort.html#_geo_distance_sorting.

func (GeoDistanceSort) GeoHashes Uses

func (s GeoDistanceSort) GeoHashes(geohashes ...string) GeoDistanceSort

GeoHashes specifies the geo point to create the range distance facets from.

func (GeoDistanceSort) NestedFilter Uses

func (s GeoDistanceSort) NestedFilter(nestedFilter Filter) GeoDistanceSort

NestedFilter sets a filter that nested objects should match with in order to be taken into account for sorting.

func (GeoDistanceSort) NestedPath Uses

func (s GeoDistanceSort) NestedPath(nestedPath string) GeoDistanceSort

NestedPath is used if sorting occurs on a field that is inside a nested object.

func (GeoDistanceSort) Order Uses

func (s GeoDistanceSort) Order(ascending bool) GeoDistanceSort

Order defines whether sorting ascending (default) or descending.

func (GeoDistanceSort) Point Uses

func (s GeoDistanceSort) Point(lat, lon float64) GeoDistanceSort

Point specifies a point to create the range distance facets from.

func (GeoDistanceSort) Points Uses

func (s GeoDistanceSort) Points(points ...*GeoPoint) GeoDistanceSort

Points specifies the geo point(s) to create the range distance facets from.

func (GeoDistanceSort) SortMode Uses

func (s GeoDistanceSort) SortMode(sortMode string) GeoDistanceSort

SortMode specifies what values to pick in case a document contains multiple values for the targeted sort field. Possible values are: min, max, sum, and avg.

func (GeoDistanceSort) Source Uses

func (s GeoDistanceSort) Source() interface{}

Source returns the JSON-serializable data.

func (GeoDistanceSort) Unit Uses

func (s GeoDistanceSort) Unit(unit string) GeoDistanceSort

Unit specifies the distance unit to use. It defaults to km. See http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/common-options.html#distance-units for details.

type GeoPoint Uses

type GeoPoint struct {
    Lat, Lon float64
}

GeoPoint is a geographic position described via latitude and longitude.

func GeoPointFromLatLon Uses

func GeoPointFromLatLon(lat, lon float64) *GeoPoint

GeoPointFromLatLon initializes a new GeoPoint by latitude and longitude.

func GeoPointFromString Uses

func GeoPointFromString(latLon string) (*GeoPoint, error)

GeoPointFromString initializes a new GeoPoint by a string that is formatted as "{latitude},{longitude}", e.g. "40.10210,-70.12091".

func (*GeoPoint) Source Uses

func (pt *GeoPoint) Source() map[string]float64

Source returns the object to be serialized in Elasticsearch DSL.

type GeoPolygonFilter Uses

type GeoPolygonFilter struct {
    Filter
    // contains filtered or unexported fields
}

A filter allowing to include hits that only fall within a polygon of points. For details, see: http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/query-dsl-geo-polygon-filter.html

func NewGeoPolygonFilter Uses

func NewGeoPolygonFilter(name string) GeoPolygonFilter

func (GeoPolygonFilter) AddPoint Uses

func (f GeoPolygonFilter) AddPoint(point *GeoPoint) GeoPolygonFilter

func (GeoPolygonFilter) Cache Uses

func (f GeoPolygonFilter) Cache(cache bool) GeoPolygonFilter

func (GeoPolygonFilter) CacheKey Uses

func (f GeoPolygonFilter) CacheKey(cacheKey string) GeoPolygonFilter

func (GeoPolygonFilter) FilterName Uses

func (f GeoPolygonFilter) FilterName(filterName string) GeoPolygonFilter

func (GeoPolygonFilter) Source Uses

func (f GeoPolygonFilter) Source() interface{}

type GetResult Uses

type GetResult struct {
    Index   string           `json:"_index"`
    Type    string           `json:"_type"`
    Id      string           `json:"_id"`
    Version int64            `json:"_version,omitempty"`
    Source  *json.RawMessage `json:"_source,omitempty"`
    Found   bool             `json:"found,omitempty"`
    Fields  []string         `json:"fields,omitempty"`
    Error   string           `json:"error,omitempty"` // used only in MultiGet
}

type GetService Uses

type GetService struct {
    // contains filtered or unexported fields
}

func NewGetService Uses

func NewGetService(client *Client) *GetService

func (*GetService) Do Uses

func (b *GetService) Do() (*GetResult, error)

func (*GetService) FetchSource Uses

func (s *GetService) FetchSource(fetchSource bool) *GetService

func (*GetService) FetchSourceContext Uses

func (s *GetService) FetchSourceContext(fetchSourceContext *FetchSourceContext) *GetService

func (*GetService) Fields Uses

func (b *GetService) Fields(fields ...string) *GetService

func (*GetService) Id Uses

func (b *GetService) Id(id string) *GetService

func (*GetService) Index Uses

func (b *GetService) Index(index string) *GetService

func (*GetService) Parent Uses

func (b *GetService) Parent(parent string) *GetService

func (*GetService) Preference Uses

func (b *GetService) Preference(preference string) *GetService

func (*GetService) Realtime Uses

func (b *GetService) Realtime(realtime bool) *GetService

func (*GetService) Refresh Uses

func (b *GetService) Refresh(refresh bool) *GetService

func (*GetService) Routing Uses

func (b *GetService) Routing(routing string) *GetService

func (*GetService) String Uses

func (b *GetService) String() string

func (*GetService) Type Uses

func (b *GetService) Type(_type string) *GetService

func (*GetService) Version Uses

func (b *GetService) Version(version int64) *GetService

Version can be MatchAny (-3), MatchAnyPre120 (0), NotFound (-1), or NotSet (-2). These are specified in org.elasticsearch.common.lucene.uid.Versions. The default is MatchAny (-3).

func (*GetService) VersionType Uses

func (b *GetService) VersionType(versionType string) *GetService

VersionType can be "internal", "external", "external_gt", "external_gte", or "force". See org.elasticsearch.index.VersionType in Elasticsearch source. It is "internal" by default.

type GetTemplateResponse Uses

type GetTemplateResponse struct {
    Template string `json:"template"`
}

type GetTemplateService Uses

type GetTemplateService struct {
    // contains filtered or unexported fields
}

GetTemplateService reads a search template. It is documented at http://www.elasticsearch.org/guide/en/elasticsearch/reference/master/search-template.html.

Code:

client, err := elastic.NewClient(http.DefaultClient)
if err != nil {
    panic(err)
}

// Get template stored under "my-search-template"
resp, err := client.GetTemplate().Id("my-search-template").Do()
if err != nil {
    panic(err)
}
fmt.Printf("search template is: %q\n", resp.Template)

func NewGetTemplateService Uses

func NewGetTemplateService(client *Client) *GetTemplateService

NewGetTemplateService creates a new GetTemplateService.

func (*GetTemplateService) Do Uses

func (s *GetTemplateService) Do() (*GetTemplateResponse, error)

Do executes the operation and returns the template.

func (*GetTemplateService) Id Uses

func (s *GetTemplateService) Id(id string) *GetTemplateService

Id is documented as: Template ID.

func (*GetTemplateService) Validate Uses

func (s *GetTemplateService) Validate() error

Validate checks if the operation is valid.

func (*GetTemplateService) Version Uses

func (s *GetTemplateService) Version(version interface{}) *GetTemplateService

Version is documented as: Explicit version number for concurrency control.

func (*GetTemplateService) VersionType Uses

func (s *GetTemplateService) VersionType(versionType string) *GetTemplateService

VersionType is documented as: Specific version type.

type GlobalAggregation Uses

type GlobalAggregation struct {
    // contains filtered or unexported fields
}

GlobalAggregation defines a single bucket of all the documents within the search execution context. This context is defined by the indices and the document types you’re searching on, but is not influenced by the search query itself. See: http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/search-aggregations-bucket-global-aggregation.html

func NewGlobalAggregation Uses

func NewGlobalAggregation() GlobalAggregation

func (GlobalAggregation) Source Uses

func (a GlobalAggregation) Source() interface{}

func (GlobalAggregation) SubAggregation Uses

func (a GlobalAggregation) SubAggregation(name string, subAggregation Aggregation) GlobalAggregation

type HasChildFilter Uses

type HasChildFilter struct {
    // contains filtered or unexported fields
}

The has_child query works the same as the has_child filter, by automatically wrapping the filter with a constant_score (when using the default score type). For more details, see http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/query-dsl-has-child-query.html

func NewHasChildFilter Uses

func NewHasChildFilter(childType string) HasChildFilter

NewHasChildFilter creates a new has_child query.

func (HasChildFilter) Cache Uses

func (f HasChildFilter) Cache(cache bool) HasChildFilter

func (HasChildFilter) CacheKey Uses

func (f HasChildFilter) CacheKey(cacheKey string) HasChildFilter

func (HasChildFilter) Filter Uses

func (f HasChildFilter) Filter(filter Filter) HasChildFilter

func (HasChildFilter) FilterName Uses

func (f HasChildFilter) FilterName(filterName string) HasChildFilter

func (HasChildFilter) Query Uses

func (f HasChildFilter) Query(query Query) HasChildFilter

func (HasChildFilter) ShortCircuitCutoff Uses

func (f HasChildFilter) ShortCircuitCutoff(shortCircuitCutoff int) HasChildFilter

func (HasChildFilter) Source Uses

func (f HasChildFilter) Source() interface{}

Source returns the JSON document for the filter.

type HasChildQuery Uses

type HasChildQuery struct {
    // contains filtered or unexported fields
}

The has_child query works the same as the has_child filter, by automatically wrapping the filter with a constant_score (when using the default score type). For more details, see http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/query-dsl-has-child-query.html

func NewHasChildQuery Uses

func NewHasChildQuery(childType string, query Query) HasChildQuery

NewHasChildQuery creates a new has_child query.

func (HasChildQuery) Boost Uses

func (q HasChildQuery) Boost(boost float32) HasChildQuery

func (HasChildQuery) QueryName Uses

func (q HasChildQuery) QueryName(queryName string) HasChildQuery

func (HasChildQuery) ScoreType Uses

func (q HasChildQuery) ScoreType(scoreType string) HasChildQuery

func (HasChildQuery) ShortCircuitCutoff Uses

func (q HasChildQuery) ShortCircuitCutoff(shortCircuitCutoff int) HasChildQuery

func (HasChildQuery) Source Uses

func (q HasChildQuery) Source() interface{}

Creates the query source for the ids query.

type HasParentFilter Uses

type HasParentFilter struct {
    // contains filtered or unexported fields
}

The has_parent filter accepts a query and a parent type. The query is executed in the parent document space, which is specified by the parent type. This filter return child documents which associated parents have matched. For more details, see http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/query-dsl-has-parent-filter.html

func NewHasParentFilter Uses

func NewHasParentFilter(parentType string) HasParentFilter

NewHasParentFilter creates a new has_parent filter.

func (HasParentFilter) Cache Uses

func (f HasParentFilter) Cache(cache bool) HasParentFilter

func (HasParentFilter) CacheKey Uses

func (f HasParentFilter) CacheKey(cacheKey string) HasParentFilter

func (HasParentFilter) Filter Uses

func (f HasParentFilter) Filter(filter Filter) HasParentFilter

func (HasParentFilter) FilterName Uses

func (f HasParentFilter) FilterName(filterName string) HasParentFilter

func (HasParentFilter) Query Uses

func (f HasParentFilter) Query(query Query) HasParentFilter

func (HasParentFilter) Source Uses

func (f HasParentFilter) Source() interface{}

Source returns the JSON document for the filter.

type HasParentQuery Uses

type HasParentQuery struct {
    // contains filtered or unexported fields
}

The has_parent query works the same as the has_parent filter, by automatically wrapping the filter with a constant_score (when using the default score type). It has the same syntax as the has_parent filter. For more details, see http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/query-dsl-has-parent-query.html

func NewHasParentQuery Uses

func NewHasParentQuery(parentType string, query Query) HasParentQuery

NewHasParentQuery creates a new has_parent query.

func (HasParentQuery) Boost Uses

func (q HasParentQuery) Boost(boost float32) HasParentQuery

func (HasParentQuery) QueryName Uses

func (q HasParentQuery) QueryName(queryName string) HasParentQuery

func (HasParentQuery) ScoreType Uses

func (q HasParentQuery) ScoreType(scoreType string) HasParentQuery

func (HasParentQuery) Source Uses

func (q HasParentQuery) Source() interface{}

Creates the query source for the ids query.

type Highlight Uses

type Highlight struct {
    // contains filtered or unexported fields
}

Highlight allows highlighting search results on one or more fields. For details, see: http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/search-request-highlighting.html

func NewHighlight Uses

func NewHighlight() *Highlight

func (*Highlight) BoundaryChars Uses

func (hl *Highlight) BoundaryChars(boundaryChars ...rune) *Highlight

func (*Highlight) BoundaryMaxScan Uses

func (hl *Highlight) BoundaryMaxScan(boundaryMaxScan int) *Highlight

func (*Highlight) Encoder Uses

func (hl *Highlight) Encoder(encoder string) *Highlight

func (*Highlight) Field Uses

func (hl *Highlight) Field(name string) *Highlight

func (*Highlight) Fields Uses

func (hl *Highlight) Fields(fields ...*HighlighterField) *Highlight

func (*Highlight) ForceSource Uses

func (hl *Highlight) ForceSource(forceSource bool) *Highlight

func (*Highlight) FragmentSize Uses

func (hl *Highlight) FragmentSize(fragmentSize int) *Highlight

func (*Highlight) Fragmenter Uses

func (hl *Highlight) Fragmenter(fragmenter string) *Highlight

func (*Highlight) HighlighQuery Uses

func (hl *Highlight) HighlighQuery(highlightQuery Query) *Highlight

func (*Highlight) HighlightFilter Uses

func (hl *Highlight) HighlightFilter(highlightFilter bool) *Highlight

func (*Highlight) HighlighterType Uses

func (hl *Highlight) HighlighterType(highlighterType string) *Highlight

func (*Highlight) NoMatchSize Uses

func (hl *Highlight) NoMatchSize(noMatchSize int) *Highlight

func (*Highlight) NumOfFragments Uses

func (hl *Highlight) NumOfFragments(numOfFragments int) *Highlight

func (*Highlight) Options Uses

func (hl *Highlight) Options(options map[string]interface{}) *Highlight

func (*Highlight) Order Uses

func (hl *Highlight) Order(order string) *Highlight

func (*Highlight) PostTags Uses

func (hl *Highlight) PostTags(postTags ...string) *Highlight

func (*Highlight) PreTags Uses

func (hl *Highlight) PreTags(preTags ...string) *Highlight

func (*Highlight) RequireFieldMatch Uses

func (hl *Highlight) RequireFieldMatch(requireFieldMatch bool) *Highlight

func (*Highlight) Source Uses

func (hl *Highlight) Source() interface{}

Creates the query source for the bool query.

func (*Highlight) TagsSchema Uses

func (hl *Highlight) TagsSchema(schemaName string) *Highlight

func (*Highlight) UseExplicitFieldOrder Uses

func (hl *Highlight) UseExplicitFieldOrder(useExplicitFieldOrder bool) *Highlight

type HighlighterField Uses

type HighlighterField struct {
    Name string
    // contains filtered or unexported fields
}

HighlighterField specifies a highlighted field.

func NewHighlighterField Uses

func NewHighlighterField(name string) *HighlighterField

func (*HighlighterField) BoundaryChars Uses

func (f *HighlighterField) BoundaryChars(boundaryChars ...rune) *HighlighterField

func (*HighlighterField) BoundaryMaxScan Uses

func (f *HighlighterField) BoundaryMaxScan(boundaryMaxScan int) *HighlighterField

func (*HighlighterField) ForceSource Uses

func (f *HighlighterField) ForceSource(forceSource bool) *HighlighterField

func (*HighlighterField) FragmentOffset Uses

func (f *HighlighterField) FragmentOffset(fragmentOffset int) *HighlighterField

func (*HighlighterField) FragmentSize Uses

func (f *HighlighterField) FragmentSize(fragmentSize int) *HighlighterField

func (*HighlighterField) Fragmenter Uses

func (f *HighlighterField) Fragmenter(fragmenter string) *HighlighterField

func (*HighlighterField) HighlightFilter Uses

func (f *HighlighterField) HighlightFilter(highlightFilter bool) *HighlighterField

func (*HighlighterField) HighlightQuery Uses

func (f *HighlighterField) HighlightQuery(highlightQuery Query) *HighlighterField

func (*HighlighterField) HighlighterType Uses

func (f *HighlighterField) HighlighterType(highlighterType string) *HighlighterField

func (*HighlighterField) MatchedFields Uses

func (f *HighlighterField) MatchedFields(matchedFields ...string) *HighlighterField

func (*HighlighterField) NoMatchSize Uses

func (f *HighlighterField) NoMatchSize(noMatchSize int) *HighlighterField

func (*HighlighterField) NumOfFragments Uses

func (f *HighlighterField) NumOfFragments(numOfFragments int) *HighlighterField

func (*HighlighterField) Options Uses

func (f *HighlighterField) Options(options map[string]interface{}) *HighlighterField

func (*HighlighterField) Order Uses

func (f *HighlighterField) Order(order string) *HighlighterField

func (*HighlighterField) PhraseLimit Uses

func (f *HighlighterField) PhraseLimit(phraseLimit int) *HighlighterField

func (*HighlighterField) PostTags Uses

func (f *HighlighterField) PostTags(postTags ...string) *HighlighterField

func (*HighlighterField) PreTags Uses

func (f *HighlighterField) PreTags(preTags ...string) *HighlighterField

func (*HighlighterField) RequireFieldMatch Uses

func (f *HighlighterField) RequireFieldMatch(requireFieldMatch bool) *HighlighterField

func (*HighlighterField) Source Uses

func (f *HighlighterField) Source() interface{}

type HistogramAggregation Uses

type HistogramAggregation struct {
    // contains filtered or unexported fields
}

HistogramAggregation is a multi-bucket values source based aggregation that can be applied on numeric values extracted from the documents. It dynamically builds fixed size (a.k.a. interval) buckets over the values. See: http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/search-aggregations-bucket-histogram-aggregation.html

func NewHistogramAggregation Uses

func NewHistogramAggregation() HistogramAggregation

func (HistogramAggregation) ExtendedBoundsMax Uses

func (a HistogramAggregation) ExtendedBoundsMax(max int64) HistogramAggregation

func (HistogramAggregation) ExtendedBoundsMin Uses

func (a HistogramAggregation) ExtendedBoundsMin(min int64) HistogramAggregation

func (HistogramAggregation) Field Uses

func (a HistogramAggregation) Field(field string) HistogramAggregation

func (HistogramAggregation) Interval Uses

func (a HistogramAggregation) Interval(interval int64) HistogramAggregation

func (HistogramAggregation) Lang Uses

func (a HistogramAggregation) Lang(lang string) HistogramAggregation

func (HistogramAggregation) MinDocCount Uses

func (a HistogramAggregation) MinDocCount(minDocCount int64) HistogramAggregation

func (HistogramAggregation) Order Uses

func (a HistogramAggregation) Order(order string, asc bool) HistogramAggregation

Order specifies the sort order. Valid values for order are: "_key", "_count", a sub-aggregation name, or a sub-aggregation name with a metric.

func (HistogramAggregation) OrderByAggregation Uses

func (a HistogramAggregation) OrderByAggregation(aggName string, asc bool) HistogramAggregation

OrderByAggregation creates a bucket ordering strategy which sorts buckets based on a single-valued calc get.

func (HistogramAggregation) OrderByAggregationAndMetric Uses

func (a HistogramAggregation) OrderByAggregationAndMetric(aggName, metric string, asc bool) HistogramAggregation

OrderByAggregationAndMetric creates a bucket ordering strategy which sorts buckets based on a multi-valued calc get.

func (HistogramAggregation) OrderByCount Uses

func (a HistogramAggregation) OrderByCount(asc bool) HistogramAggregation

func (HistogramAggregation) OrderByCountAsc Uses

func (a HistogramAggregation) OrderByCountAsc() HistogramAggregation

func (HistogramAggregation) OrderByCountDesc Uses

func (a HistogramAggregation) OrderByCountDesc() HistogramAggregation

func (HistogramAggregation) OrderByKey Uses

func (a HistogramAggregation) OrderByKey(asc bool) HistogramAggregation

func (HistogramAggregation) OrderByKeyAsc Uses

func (a HistogramAggregation) OrderByKeyAsc() HistogramAggregation

func (HistogramAggregation) OrderByKeyDesc Uses

func (a HistogramAggregation) OrderByKeyDesc() HistogramAggregation

func (HistogramAggregation) Param Uses

func (a HistogramAggregation) Param(name string, value interface{}) HistogramAggregation

func (HistogramAggregation) Script Uses

func (a HistogramAggregation) Script(script string) HistogramAggregation

func (HistogramAggregation) Source Uses

func (a HistogramAggregation) Source() interface{}

func (HistogramAggregation) SubAggregation Uses

func (a HistogramAggregation) SubAggregation(name string, subAggregation Aggregation) HistogramAggregation

type HistogramFacet Uses

type HistogramFacet struct {
    // contains filtered or unexported fields
}

Histogram Facet See: http://www.elasticsearch.org/guide/reference/api/search/facets/histogram-facet.html

func NewHistogramFacet Uses

func NewHistogramFacet() HistogramFacet

func (HistogramFacet) FacetFilter Uses

func (f HistogramFacet) FacetFilter(filter Facet) HistogramFacet

func (HistogramFacet) Field Uses

func (f HistogramFacet) Field(field string) HistogramFacet

func (HistogramFacet) Global Uses

func (f HistogramFacet) Global(global bool) HistogramFacet

func (HistogramFacet) Interval Uses

func (f HistogramFacet) Interval(interval int64) HistogramFacet

func (HistogramFacet) KeyField Uses

func (f HistogramFacet) KeyField(keyField string) HistogramFacet

func (HistogramFacet) Mode Uses

func (f HistogramFacet) Mode(mode string) HistogramFacet

func (HistogramFacet) Nested Uses

func (f HistogramFacet) Nested(nested string) HistogramFacet

func (HistogramFacet) Source Uses

func (f HistogramFacet) Source() interface{}

func (HistogramFacet) TimeInterval Uses

func (f HistogramFacet) TimeInterval(timeInterval string) HistogramFacet

func (HistogramFacet) ValueField Uses

func (f HistogramFacet) ValueField(valueField string) HistogramFacet

type HistogramScriptFacet Uses

type HistogramScriptFacet struct {
    // contains filtered or unexported fields
}

Histogram Facet See: http://www.elasticsearch.org/guide/reference/api/search/facets/histogram-facet.html

func NewHistogramScriptFacet Uses

func NewHistogramScriptFacet() HistogramScriptFacet

func (HistogramScriptFacet) Comparator Uses

func (f HistogramScriptFacet) Comparator(comparatorType string) HistogramScriptFacet

func (HistogramScriptFacet) FacetFilter