Categorygithub.com/coveo/elasticsearch-client-go
modulepackage
1.0.1
Repository: https://github.com/coveo/elasticsearch-client-go.git
Documentation: pkg.go.dev

# README

Elastic

Elastic is an Elasticsearch client for Go.

Build Status Godoc license

Releases

Notice: This is version 1.0 of Elastic. There is a newer version available on https://github.com/olivere/elastic. I encourage anyone to use the newest version.

However, if you want to continue using the 1.0 version, you need to go-get a new URL and switch your import path. We're using gopkg.in for that. Here's how to use Elastic version 1:

$ go get -u gopkg.in/olivere/elastic.v1

In your Go code:

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

If you instead use github.com/olivere/elastic in your code base, you are following master. I try to keep master stable, but things might break now and then.

Status

We use Elastic in production for more than two years now. Although Elastic is quite stable from our experience, we don't have a stable API yet. The reason for this is that Elasticsearch changes quite often and at a fast pace. At this moment we focus on features, not on a stable API. Having said that, there have been no huge changes for the last 12 months that required you to rewrite your application big time. More often than not it's renaming APIs and adding/removing features so that we are in sync with the Elasticsearch API.

Elastic supports and has been tested in production with the following Elasticsearch versions: 0.90, 1.0, 1.1, 1.2, 1.3, and 1.4.

Elasticsearch has quite a few features. A lot of them are not yet implemented in Elastic (see below for details). I add features and APIs as required. It's straightforward to implement missing pieces. I'm accepting pull requests :-)

Having said that, I hope you find the project useful. Fork it as you like.

Usage

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.

Here's a longer example:

// Import Elastic
import (
  "github.com/olivere/elastic"
)

// 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
}

Installation

Grab the code with go get github.com/olivere/elastic.

API Status

Here's the current API status.

APIs

  • Search (most queries, filters, facets, aggregations etc. are implemented: see below)
  • Index
  • Get
  • Delete
  • Delete By Query
  • Update
  • Multi Get
  • Bulk
  • Bulk UDP
  • Term vectors
  • Multi term vectors
  • Count
  • Validate
  • Explain
  • Search
  • Search shards
  • Search template
  • Facets (most are implemented, see below)
  • Aggregates (most are implemented, see below)
  • Multi Search
  • Percolate
  • More like this
  • Benchmark

Indices

  • Create index
  • Delete index
  • Indices exists
  • Open/close index
  • Put mapping
  • Get mapping
  • Get field mapping
  • Types exist
  • Delete mapping
  • Index aliases
  • Update indices settings
  • Get settings
  • Analyze
  • Index templates
  • Warmers
  • Status
  • Indices stats
  • Indices segments
  • Indices recovery
  • Clear cache
  • Flush
  • Refresh
  • Optimize

Snapshot and Restore

  • Snapshot
  • Restore
  • Snapshot status
  • Monitoring snapshot/restore progress
  • Partial restore

Cat APIs

Not implemented. Those are better suited for operating with Elasticsearch on the command line.

Cluster

  • Health
  • State
  • Stats
  • Pending cluster tasks
  • Cluster reroute
  • Cluster update settings
  • Nodes stats
  • Nodes info
  • Nodes hot_threads
  • Nodes shutdown

Query DSL

Queries

  • match
  • multi_match
  • bool
  • boosting
  • common_terms
  • constant_score
  • dis_max
  • filtered
  • fuzzy_like_this_query (flt)
  • fuzzy_like_this_field_query (flt_field)
  • function_score
  • fuzzy
  • geo_shape
  • has_child
  • has_parent
  • ids
  • indices
  • match_all
  • mlt
  • mlt_field
  • nested
  • prefix
  • query_string
  • simple_query_string
  • range
  • regexp
  • span_first
  • span_multi_term
  • span_near
  • span_not
  • span_or
  • span_term
  • term
  • terms
  • top_children
  • wildcard
  • minimum_should_match
  • multi_term_query_rewrite
  • template_query

Filters

  • and
  • bool
  • exists
  • geo_bounding_box
  • geo_distance
  • geo_distance_range
  • geo_polygon
  • geoshape
  • geohash
  • has_child
  • has_parent
  • ids
  • indices
  • limit
  • match_all
  • missing
  • nested
  • not
  • or
  • prefix
  • query
  • range
  • regexp
  • script
  • term
  • terms
  • type

Facets

  • Terms
  • Range
  • Histogram
  • Date Histogram
  • Filter
  • Query
  • Statistical
  • Terms Stats
  • Geo Distance

Aggregations

  • min
  • max
  • sum
  • avg
  • stats
  • extended stats
  • value count
  • percentiles
  • percentile ranks
  • cardinality
  • geo bounds
  • top hits
  • scripted metric
  • global
  • filter
  • filters
  • missing
  • nested
  • reverse nested
  • children
  • terms
  • significant terms
  • range
  • date range
  • ipv4 range
  • histogram
  • date histogram
  • geo distance
  • geohash grid

Sorting

  • Sort by score
  • Sort by field
  • Sort by geo distance
  • Sort by script

Scan

Scrolling through documents (e.g. search_type=scan) are implemented via the Scroll and Scan services.

How to contribute

Read the contribution guidelines.

Credits

Thanks a lot for the great folks working hard on Elasticsearch and Go.

LICENSE

MIT-LICENSE. See LICENSE or the LICENSE file provided in the repository for details.

# Packages

Package uritemplates is a level 4 implementation of RFC 6570 (URI Template, http://tools.ietf.org/html/rfc6570).

# Functions

GeoPointFromLatLon initializes a new GeoPoint by latitude and longitude.
GeoPointFromString initializes a new GeoPoint by a string that is formatted as "{latitude},{longitude}", e.g.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
NewBoolFilter creates a new bool filter.
Creates a new bool query.
Creates a new boosting query.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
NewClient creates a new client to work with Elasticsearch.
NewCloseIndexService creates a new CloseIndexService.
NewClusterHealthService creates a new ClusterHealthService.
NewClusterStateService creates a new ClusterStateService.
Creates a new common query.
Creates a new completion suggester.
No description provided by the author
No description provided by the author
Creates a new custom_filters_score query.
Creates a new custom_score query.
No description provided by the author
No description provided by the author
No description provided by the author
NewDeleteByQueryService creates a new DeleteByQueryService.
No description provided by the author
No description provided by the author
NewDeleteTemplateService creates a new DeleteTemplateService.
No description provided by the author
Creates a new dis_max query.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
NewFieldSort creates a new FieldSort.
NewFieldValueFactorFunction creates a new FieldValueFactorFunction.
No description provided by the author
Creates a new filtered query.
No description provided by the author
No description provided by the author
No description provided by the author
NewFunctionScoreQuery creates a new function score query.
Creates a new completion suggester.
NewFuzzyLikeThisFieldQuery creates a new fuzzy like this field query.
NewFuzzyLikeThisQuery creates a new fuzzy query.
NewFuzzyQuery creates a new fuzzy query.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
NewGeoDistanceSort creates a new sorter for geo distances.
No description provided by the author
No description provided by the author
NewGetTemplateService creates a new GetTemplateService.
No description provided by the author
NewHasChildFilter creates a new has_child query.
NewHasChildQuery creates a new has_child query.
NewHasParentFilter creates a new has_parent filter.
NewHasParentQuery creates a new has_parent query.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
NewIdsQuery creates a new ids query.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
NewMatchAllQuery creates a new match all query.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
Creates a new mlt_field query.
Creates a new mlt query.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
Creates a new nested_query query.
No description provided by the author
NewOpenIndexService creates a new OpenIndexService.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
Creates a new phrase suggester.
No description provided by the author
No description provided by the author
Creates a new prefix query.
NewPutTemplateService creates a new PutTemplateService.
No description provided by the author
No description provided by the author
No description provided by the author
Creates a new query string query.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
NewRegexpFilter sets up a new RegexpFilter.
NewRegexpQuery creates a new regexp query.
No description provided by the author
No description provided by the author
newScanCursor returns a new initialized instance of scanCursor.
No description provided by the author
NewScoreSort creates a new ScoreSort.
No description provided by the author
No description provided by the author
NewScriptSort creates a new ScriptSort.
No description provided by the author
NewSearchRequest creates a new search request.
NewSearchService creates a new service for searching in Elasticsearch.
No description provided by the author
No description provided by the author
Creates a new simple query string query.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
NewSuggesterCategoryMapping creates a new SuggesterCategoryMapping.
NewSuggesterCategoryQuery creates a new SuggesterCategoryQuery.
NewSuggesterGeoMapping creates a new SuggesterGeoMapping.
NewSuggesterGeoQuery creates a new SuggesterGeoQuery.
No description provided by the author
No description provided by the author
No description provided by the author
NewTemplateQuery creates a new TemplateQuery.
No description provided by the author
Creates a new term query.
No description provided by the author
No description provided by the author
No description provided by the author
NewTermsQuery creates a new terms query.
No description provided by the author
Creates a new term suggester.
No description provided by the author
No description provided by the author
NewUpdateService creates the service to update documents in Elasticsearch.
No description provided by the author
NewWildcardQuery creates a new wildcard query.

# Constants

Version is the current version of Elastic.

# Variables

End of stream (or scan).
ErrNoClient is raised when no active Elasticsearch client is available.
No ScrollId.

# Structs

AggregationBucketFilters is a multi-bucket aggregation that is returned with a filters aggregation.
AggregationBucketHistogramItem is a single bucket of an AggregationBucketHistogramItems structure.
AggregationBucketHistogramItems is a bucket aggregation that is returned with a date histogram aggregation.
AggregationBucketKeyItem is a single bucket of an AggregationBucketKeyItems structure.
AggregationBucketKeyItems is a bucket aggregation that is e.g.
AggregationBucketRangeItem is a single bucket of an AggregationBucketRangeItems structure.
AggregationBucketRangeItems is a bucket aggregation that is e.g.
AggregationBucketSignificantTerm is a single bucket of an AggregationBucketSignificantTerms structure.
AggregationBucketSignificantTerms is a bucket aggregation returned with a significant terms aggregation.
AggregationExtendedStatsMetric is a multi-value metric, returned by an ExtendedStats aggregation.
AggregationGeoBoundsMetric is a metric as returned by a GeoBounds aggregation.
AggregationPercentilesMetric is a multi-value metric, returned by a Percentiles aggregation.
AggregationSingleBucket is a single bucket, returned e.g.
AggregationStatsMetric is a multi-value metric, returned by a Stats aggregation.
AggregationTopHitsMetric is a metric returned by a TopHits aggregation.
AggregationValueMetric is a single-value metric, returned e.g.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
A filter that matches documents using AND boolean operator on other filters.
AvgAggregation is a single-value metrics aggregation that computes the average of numeric values that are extracted from the aggregated documents.
A filter that matches documents matching boolean combinations of other queries.
A bool query matches documents matching boolean combinations of other queries.
A boosting query can be used to effectively demote results that match a given query.
Bulk request to remove document from Elasticsearch.
Bulk request to add document to Elasticsearch.
BulkResponse is a response to a bulk execution.
BulkResponseItem is the result of a single bulk request.
No description provided by the author
Bulk request to update document in Elasticsearch.
CardinalityAggregation is a single-value metrics aggregation that calculates an approximate count of distinct values.
ChildrenAggregation is a special single bucket aggregation that enables aggregating from buckets on parent document types to buckets on child documents.
Client is an Elasticsearch client.
CloseIndexResponse is the response of CloseIndexService.Do.
CloseIndexService closes an index.
ClusterHealthResponse is the response of ClusterHealthService.Do.
ClusterHealthService allows to get the status of the cluster.
No description provided by the author
No description provided by the author
ClusterStateResponse is the response of ClusterStateService.Do.
No description provided by the author
No description provided by the author
ClusterStateService returns the state of the cluster.
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.
CompletionSuggester is a fast suggester for e.g.
CountResult is the result returned from using the Count API (http://www.elasticsearch.org/guide/reference/api/count/).
CountService is a convenient service for determining the number of documents in an index.
No description provided by the author
No description provided by the author
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.
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.
DateHistogramAggregation is a multi-bucket aggregation similar to the histogram except it can only be applied on date values.
A specific histogram facet that can work with date field types enhancing it over the regular histogram facet.
DateRangeAggregation is a range aggregation that is dedicated for date values.
No description provided by the author
DeleteByQueryResult is the outcome of executing Do with DeleteByQueryService.
DeleteByQueryService deletes documents that match a query.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
DeleteTemplateResponse is the response of DeleteTemplateService.Do.
DeleteTemplateService deletes a search template.
DirectCandidateGenerator implements a direct candidate generator.
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.
No description provided by the author
Filters documents where a specific field has a value in them.
No description provided by the author
No description provided by the author
ExtendedExtendedStatsAggregation is a multi-value metrics aggregation that computes stats over numeric values extracted from the aggregated documents.
No description provided by the author
No description provided by the author
FieldSort sorts by a given field.
FieldValueFactorFunction is a function score function that allows you to use a field from a document to influence the score.
FilterAggregation defines a single bucket of all the documents in the current document set context that match a specified filter.
A query that applies a filter to the results of another query.
A filter facet (not to be confused with a facet filter) allows you to return a count of the hits matching the filter.
FiltersAggregation defines a multi bucket aggregations where each bucket is associated with a filter.
No description provided by the author
No description provided by the author
The function_score allows you to modify the score of documents that are retrieved by a query.
FuzzyFuzzyCompletionSuggester is a FuzzyCompletionSuggester that allows fuzzy completion.
FuzzyLikeThisFieldQuery is the same as the fuzzy_like_this query, except that it runs against a single field.
FuzzyLikeThisQuery finds documents that are "like" provided text by running it against one or more fields.
FuzzyQuery uses similarity based on Levenshtein edit distance for string fields, and a +/- margin on numeric and date fields.
No description provided by the author
GeoBoundsAggregation is a metric aggregation that computes the bounding box containing all geo_point values for a field.
GeoDistanceAggregation is a multi-bucket aggregation that works on geo_point fields and conceptually works very similar to the range aggregation.
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).
GeoDistanceSort allows for sorting by geographic distance.
GeoPoint is a geographic position described via latitude and longitude.
A filter allowing to include hits that only fall within a polygon of points.
No description provided by the author
No description provided by the author
No description provided by the author
GetTemplateService reads a search template.
GlobalAggregation defines a single bucket of all the documents within the search execution context.
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).
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).
The has_parent filter accepts a query and a parent type.
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).
Highlight allows highlighting search results on one or more fields.
HighlighterField specifies a highlighted field.
HistogramAggregation is a multi-bucket values source based aggregation that can be applied on numeric values extracted from the documents.
Histogram Facet See: http://www.elasticsearch.org/guide/reference/api/search/facets/histogram-facet.html.
Histogram Facet See: http://www.elasticsearch.org/guide/reference/api/search/facets/histogram-facet.html.
Filters documents that only have the provided ids.
Filters documents that only have the provided ids.
IndexDeleteByQueryResult is the result of a delete-by-query for a specific index.
No description provided by the author
IndexResult is the result of indexing a document in Elasticsearch.
IndexService adds documents to Elasticsearch.
LaplaceSmoothingModel implements a laplace smoothing model.
A limit filter limits the number of documents (per shard) to execute on.
No description provided by the author
LinearInterpolationSmoothingModel implements a linear interpolation smoothing model.
A filter that matches on all documents.
A query that matches all documents.
Match query is a family of match queries that accept text/numerics/dates, analyzes it, and constructs a query out of it.
MaxAggregation is a single-value metrics aggregation that keeps track and returns the maximum value among the numeric values extracted from the aggregated documents.
MinAggregation is a single-value metrics aggregation that keeps track and returns the minimum value among numeric values extracted from the aggregated documents.
MissingAggregation is a field data based single bucket aggregation, that creates a bucket of all documents in the current document set context that are missing a field value (effectively, missing a field or having the configured NULL value set).
Filters documents where a specific field has no value in them.
The more_like_this_field query is the same as the more_like_this query, except it runs against a single field.
More like this query find documents that are “like” provided text by running it against one or more fields.
MultiGetItem is a single document to retrieve via the MultiGetService.
No description provided by the author
No description provided by the author
The multi_match query builds further on top of the match query by allowing multiple fields to be specified.
No description provided by the author
MultiSearch executes one or more searches in one roundtrip.
NestedAggregation is a special single bucket aggregation that enables aggregating nested documents.
A nested filter, works in a similar fashion to the nested query, except used as a filter.
Nested query allows to query nested objects / docs (see nested mapping).
A filter that filters out matched documents using a query.
OpenIndexResponse is the response of OpenIndexService.Do.
OpenIndexService opens an index.
No description provided by the author
No description provided by the author
A filter that matches documents using OR boolean operator on other queries.
No description provided by the author
PercentileRanksAggregation See: http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/search-aggregations-metrics-percentile-rank-aggregation.html.
PercentilesAggregation See: http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/search-aggregations-metrics-percentile-aggregation.html.
For more details, see http://www.elasticsearch.org/guide/reference/api/search/phrase-suggest/.
PingResult is the result returned from querying the Elasticsearch server.
PingService checks if an Elasticsearch server on a given URL is alive.
Filters documents that have fiels containing terms with a specified prefix (not analyzed).
Matches documents that have fields containing terms with a specified prefix (not analyzed).
PutTemplateResponse is the response of PutTemplateService.Do.
PutTemplateService creates or updates a search template.
Query Facet See: http://www.elasticsearch.org/guide/reference/api/search/facets/query-facet.html.
QueryFilter wraps any query to be used as a filter.
No description provided by the author
A query that uses the query parser in order to parse its content.
No description provided by the author
RangeAggregation is a multi-bucket value source based aggregation that enables the user to define a set of ranges - each representing a bucket.
Range facet allows to specify a set of ranges and get both the number of docs (count) that fall within each range, and aggregated data either based on the field, or using another field.
Filters documents with fields that have terms within a certain range.
Matches documents with fields that have terms within a certain range.
No description provided by the author
No description provided by the author
RegexpFilter allows filtering for regular expressions.
RegexpQuery allows you to use regular expression term queries.
No description provided by the author
scanCursor represents a single page of results from an Elasticsearch Scan operation.
ScanService manages a cursor through documents in Elasticsearch.
ScoreSort sorts by relevancy score.
No description provided by the author
No description provided by the author
ScriptSort sorts by a custom script.
ScrollService manages a cursor through documents in Elasticsearch.
SearchExplanation explains how the score for a hit was computed.
SearchFacet is a single facet.
SearchHit is a single hit.
SearchHits specifies the list of search hits.
SearchRequest combines a search request and its query details (see SearchSource).
SearchResult is the result of a search in Elasticsearch.
Search for documents in Elasticsearch.
SearchSource enables users to build the search source.
SearchSuggestion is a single search suggestion.
SearchSuggestionOption is an option of a SearchSuggestion.
SignificantSignificantTermsAggregation is an aggregation that returns interesting or unusual occurrences of terms in a set.
SimpleQueryStringQuery is a query that uses the SimpleQueryParser to parse its context.
SortInfo contains information about sorting a field.
Statistical facet allows to compute statistical data on a numeric fields.
Statistical facet allows to compute statistical data on a numeric fields.
StatsAggregation is a multi-value metrics aggregation that computes stats over numeric values extracted from the aggregated documents.
StupidBackoffSmoothingModel implements a stupid backoff smoothing model.
SuggesterCategoryMapping provides a mapping for a category context in a suggester.
SuggesterCategoryQuery provides querying a category context in a suggester.
SuggesterGeoMapping provides a mapping for a geolocation context in a suggester.
SuggesterGeoQuery provides querying a geolocation context in a suggester.
SuggestField can be used by the caller to specify a suggest field at index time.
No description provided by the author
SuggestService returns suggestions for text.
SumAggregation is a single-value metrics aggregation that sums up numeric values that are extracted from the aggregated documents.
TemplateQuery is a query that accepts a query template and a map of key/value pairs to fill in template parameters.
Filters documents that have fields that contain a term (not analyzed).
A term query matches documents that contain a term (not analyzed).
TermsAggregation is a multi-bucket value source based aggregation where buckets are dynamically built - one per unique value.
Allow to specify field facets that return the N most frequent terms.
Filters documents that have fields that match any of the provided terms (not analyzed).
A query that match on any (configurable) of the provided terms.
The terms_stats facet combines both the terms and statistical allowing to compute stats computed on a field, per term value driven by another field.
For more details, see http://www.elasticsearch.org/guide/reference/api/search/term-suggest/.
TopHitsAggregation keeps track of the most relevant document being aggregated.
Filters documents matching the provided document / mapping type.
UpdateResult is the result of updating a document in Elasticsearch.
UpdateService updates a document in Elasticsearch.
ValueCountAggregation is a single-value metrics aggregation that counts the number of values that are extracted from the aggregated documents.
WildcardQuery matches documents that have fields matching a wildcard expression (not analyzed).

# Interfaces

Aggregations can be seen as a unit-of-work that build analytic information over a set of documents.
Generic interface to bulkable requests.
No description provided by the author
Represents a glimpse into the data.
No description provided by the author
Represents the generic query interface.
No description provided by the author
ScoreFunction is used in combination with the Function Score Query.
No description provided by the author
Sorter is an interface for sorting strategies, e.g.
Represents the generic suggester interface.
SuggesterContextQuery is used to define context information within a suggestion request.

# Type aliases

Aggregations is a list of aggregations that are part of a search result.
Elasticsearch-specific HTTP request.
SearchFacets is a map of facets.
SearchHitHighlight is the highlight information of a search hit.
SearchSuggest is a map of suggestions.
No description provided by the author