Documentation
¶
Overview ¶
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.
Example ¶
package main import ( "encoding/json" "fmt" "net/http" "time" "github.com/olivere/elastic" ) type Tweet struct { User string `json:"user"` Message string `json:"message"` Retweets int `json:"retweets"` Image string `json:"image,omitempty"` Created time.Time `json:"created,omitempty"` Tags []string `json:"tags,omitempty"` Location string `json:"location,omitempty"` Suggest *elastic.SuggestField `json:"suggest_field,omitempty"` } func main() { // 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 } }
Output:
Index ¶
- Constants
- Variables
- type Aggregation
- type AggregationBucketFilters
- type AggregationBucketHistogramItem
- type AggregationBucketHistogramItems
- type AggregationBucketKeyItem
- type AggregationBucketKeyItems
- type AggregationBucketRangeItem
- type AggregationBucketRangeItems
- type AggregationBucketSignificantTerm
- type AggregationBucketSignificantTerms
- type AggregationExtendedStatsMetric
- type AggregationGeoBoundsMetric
- type AggregationPercentilesMetric
- type AggregationSingleBucket
- type AggregationStatsMetric
- type AggregationTopHitsMetric
- type AggregationValueMetric
- type Aggregations
- func (a Aggregations) Avg(name string) (*AggregationValueMetric, bool)
- func (a Aggregations) Cardinality(name string) (*AggregationValueMetric, bool)
- func (a Aggregations) Children(name string) (*AggregationSingleBucket, bool)
- func (a Aggregations) DateHistogram(name string) (*AggregationBucketHistogramItems, bool)
- func (a Aggregations) DateRange(name string) (*AggregationBucketRangeItems, bool)
- func (a Aggregations) ExtendedStats(name string) (*AggregationExtendedStatsMetric, bool)
- func (a Aggregations) Filter(name string) (*AggregationSingleBucket, bool)
- func (a Aggregations) Filters(name string) (*AggregationBucketFilters, bool)
- func (a Aggregations) GeoBounds(name string) (*AggregationGeoBoundsMetric, bool)
- func (a Aggregations) GeoDistance(name string) (*AggregationBucketRangeItems, bool)
- func (a Aggregations) GeoHash(name string) (*AggregationBucketKeyItems, bool)
- func (a Aggregations) Global(name string) (*AggregationSingleBucket, bool)
- func (a Aggregations) Histogram(name string) (*AggregationBucketHistogramItems, bool)
- func (a Aggregations) IPv4Range(name string) (*AggregationBucketRangeItems, bool)
- func (a Aggregations) Max(name string) (*AggregationValueMetric, bool)
- func (a Aggregations) Min(name string) (*AggregationValueMetric, bool)
- func (a Aggregations) Missing(name string) (*AggregationSingleBucket, bool)
- func (a Aggregations) Nested(name string) (*AggregationSingleBucket, bool)
- func (a Aggregations) PercentileRanks(name string) (*AggregationPercentilesMetric, bool)
- func (a Aggregations) Percentiles(name string) (*AggregationPercentilesMetric, bool)
- func (a Aggregations) Range(name string) (*AggregationBucketRangeItems, bool)
- func (a Aggregations) ReverseNested(name string) (*AggregationSingleBucket, bool)
- func (a Aggregations) SignificantTerms(name string) (*AggregationBucketSignificantTerms, bool)
- func (a Aggregations) Stats(name string) (*AggregationStatsMetric, bool)
- func (a Aggregations) Sum(name string) (*AggregationValueMetric, bool)
- func (a Aggregations) Terms(name string) (*AggregationBucketKeyItems, bool)
- func (a Aggregations) TopHits(name string) (*AggregationTopHitsMetric, bool)
- func (a Aggregations) ValueCount(name string) (*AggregationValueMetric, bool)
- type AliasResult
- type AliasService
- func (s *AliasService) Add(indexName string, aliasName string) *AliasService
- func (s *AliasService) AddWithFilter(indexName string, aliasName string, filter *Filter) *AliasService
- func (s *AliasService) Debug(debug bool) *AliasService
- func (s *AliasService) Do() (*AliasResult, error)
- func (s *AliasService) Pretty(pretty bool) *AliasService
- func (s *AliasService) Remove(indexName string, aliasName string) *AliasService
- type AliasesResult
- type AliasesService
- func (s *AliasesService) Debug(debug bool) *AliasesService
- func (s *AliasesService) Do() (*AliasesResult, error)
- func (s *AliasesService) Index(indexName string) *AliasesService
- func (s *AliasesService) Indices(indexNames ...string) *AliasesService
- func (s *AliasesService) Pretty(pretty bool) *AliasesService
- type AndFilter
- type AvgAggregation
- func (a AvgAggregation) Field(field string) AvgAggregation
- func (a AvgAggregation) Format(format string) AvgAggregation
- func (a AvgAggregation) Lang(lang string) AvgAggregation
- func (a AvgAggregation) Param(name string, value interface{}) AvgAggregation
- func (a AvgAggregation) Script(script string) AvgAggregation
- func (a AvgAggregation) Source() interface{}
- func (a AvgAggregation) SubAggregation(name string, subAggregation Aggregation) AvgAggregation
- type BoolFilter
- func (f BoolFilter) Cache(cache bool) BoolFilter
- func (f BoolFilter) CacheKey(cacheKey string) BoolFilter
- func (f BoolFilter) FilterName(filterName string) BoolFilter
- func (f BoolFilter) Must(filters ...Filter) BoolFilter
- func (f BoolFilter) MustNot(filters ...Filter) BoolFilter
- func (f BoolFilter) Should(filters ...Filter) BoolFilter
- func (f BoolFilter) Source() interface{}
- type BoolQuery
- func (q BoolQuery) AdjustPureNegative(adjustPureNegative bool) BoolQuery
- func (q BoolQuery) Boost(boost float32) BoolQuery
- func (q BoolQuery) DisableCoord(disableCoord bool) BoolQuery
- func (q BoolQuery) MinimumShouldMatch(minimumShouldMatch string) BoolQuery
- func (q BoolQuery) Must(queries ...Query) BoolQuery
- func (q BoolQuery) MustNot(queries ...Query) BoolQuery
- func (q BoolQuery) QueryName(queryName string) BoolQuery
- func (q BoolQuery) Should(queries ...Query) BoolQuery
- func (q BoolQuery) Source() interface{}
- type BoostingQuery
- type BulkDeleteRequest
- func (r *BulkDeleteRequest) Id(id string) *BulkDeleteRequest
- func (r *BulkDeleteRequest) Index(index string) *BulkDeleteRequest
- func (r *BulkDeleteRequest) Refresh(refresh bool) *BulkDeleteRequest
- func (r *BulkDeleteRequest) Routing(routing string) *BulkDeleteRequest
- func (r *BulkDeleteRequest) Source() ([]string, error)
- func (r *BulkDeleteRequest) String() string
- func (r *BulkDeleteRequest) Type(typ string) *BulkDeleteRequest
- func (r *BulkDeleteRequest) Version(version int64) *BulkDeleteRequest
- func (r *BulkDeleteRequest) VersionType(versionType string) *BulkDeleteRequest
- type BulkIndexRequest
- func (r *BulkIndexRequest) Doc(doc interface{}) *BulkIndexRequest
- func (r *BulkIndexRequest) Id(id string) *BulkIndexRequest
- func (r *BulkIndexRequest) Index(index string) *BulkIndexRequest
- func (r *BulkIndexRequest) OpType(opType string) *BulkIndexRequest
- func (r *BulkIndexRequest) Parent(parent string) *BulkIndexRequest
- func (r *BulkIndexRequest) Refresh(refresh bool) *BulkIndexRequest
- func (r *BulkIndexRequest) Routing(routing string) *BulkIndexRequest
- func (r *BulkIndexRequest) Source() ([]string, error)
- func (r *BulkIndexRequest) String() string
- func (r *BulkIndexRequest) Timestamp(timestamp string) *BulkIndexRequest
- func (r *BulkIndexRequest) Ttl(ttl int64) *BulkIndexRequest
- func (r *BulkIndexRequest) Type(typ string) *BulkIndexRequest
- func (r *BulkIndexRequest) Version(version int64) *BulkIndexRequest
- func (r *BulkIndexRequest) VersionType(versionType string) *BulkIndexRequest
- type BulkResponse
- func (r *BulkResponse) ByAction(action string) []*BulkResponseItem
- func (r *BulkResponse) ById(id string) []*BulkResponseItem
- func (r *BulkResponse) Created() []*BulkResponseItem
- func (r *BulkResponse) Deleted() []*BulkResponseItem
- func (r *BulkResponse) Failed() []*BulkResponseItem
- func (r *BulkResponse) Indexed() []*BulkResponseItem
- func (r *BulkResponse) Updated() []*BulkResponseItem
- type BulkResponseItem
- type BulkService
- func (s *BulkService) Add(r BulkableRequest) *BulkService
- func (s *BulkService) Debug(debug bool) *BulkService
- func (s *BulkService) DebugOnError(debug bool) *BulkService
- func (s *BulkService) Do() (*BulkResponse, error)
- func (s *BulkService) Index(index string) *BulkService
- func (s *BulkService) NumberOfActions() int
- func (s *BulkService) Pretty(pretty bool) *BulkService
- func (s *BulkService) Refresh(refresh bool) *BulkService
- func (s *BulkService) Timeout(timeout string) *BulkService
- func (s *BulkService) Type(_type string) *BulkService
- type BulkUpdateRequest
- func (r *BulkUpdateRequest) Doc(doc interface{}) *BulkUpdateRequest
- func (r *BulkUpdateRequest) DocAsUpsert(docAsUpsert bool) *BulkUpdateRequest
- func (r *BulkUpdateRequest) Id(id string) *BulkUpdateRequest
- func (r *BulkUpdateRequest) Index(index string) *BulkUpdateRequest
- func (r *BulkUpdateRequest) Parent(parent string) *BulkUpdateRequest
- func (r *BulkUpdateRequest) Refresh(refresh bool) *BulkUpdateRequest
- func (r *BulkUpdateRequest) RetryOnConflict(retryOnConflict int) *BulkUpdateRequest
- func (r *BulkUpdateRequest) Routing(routing string) *BulkUpdateRequest
- func (r *BulkUpdateRequest) Script(script string) *BulkUpdateRequest
- func (r *BulkUpdateRequest) ScriptLang(scriptLang string) *BulkUpdateRequest
- func (r *BulkUpdateRequest) ScriptParams(params map[string]interface{}) *BulkUpdateRequest
- func (r *BulkUpdateRequest) ScriptType(scriptType string) *BulkUpdateRequest
- func (r BulkUpdateRequest) Source() ([]string, error)
- func (r *BulkUpdateRequest) String() string
- func (r *BulkUpdateRequest) Timestamp(timestamp string) *BulkUpdateRequest
- func (r *BulkUpdateRequest) Ttl(ttl int64) *BulkUpdateRequest
- func (r *BulkUpdateRequest) Type(typ string) *BulkUpdateRequest
- func (r *BulkUpdateRequest) Upsert(doc interface{}) *BulkUpdateRequest
- func (r *BulkUpdateRequest) Version(version int64) *BulkUpdateRequest
- func (r *BulkUpdateRequest) VersionType(versionType string) *BulkUpdateRequest
- type BulkableRequest
- type CandidateGenerator
- type CardinalityAggregation
- func (a CardinalityAggregation) Field(field string) CardinalityAggregation
- func (a CardinalityAggregation) Format(format string) CardinalityAggregation
- func (a CardinalityAggregation) Lang(lang string) CardinalityAggregation
- func (a CardinalityAggregation) Param(name string, value interface{}) CardinalityAggregation
- func (a CardinalityAggregation) PrecisionThreshold(threshold int64) CardinalityAggregation
- func (a CardinalityAggregation) Rehash(rehash bool) CardinalityAggregation
- func (a CardinalityAggregation) Script(script string) CardinalityAggregation
- func (a CardinalityAggregation) Source() interface{}
- func (a CardinalityAggregation) SubAggregation(name string, subAggregation Aggregation) CardinalityAggregation
- type ChildrenAggregation
- type Client
- func (c *Client) Alias() *AliasService
- func (c *Client) Aliases() *AliasesService
- func (c *Client) Bulk() *BulkService
- func (c *Client) CloseIndex(name string) *CloseIndexService
- func (c *Client) ClusterHealth() *ClusterHealthService
- func (c *Client) ClusterState() *ClusterStateService
- func (c *Client) Count(indices ...string) *CountService
- func (c *Client) CreateIndex(name string) *CreateIndexService
- func (c *Client) Delete() *DeleteService
- func (c *Client) DeleteByQuery() *DeleteByQueryService
- func (c *Client) DeleteIndex(name string) *DeleteIndexService
- func (c *Client) DeleteTemplate() *DeleteTemplateService
- func (c *Client) ElasticsearchVersion(url string) (string, error)
- func (c *Client) Exists() *ExistsService
- func (c *Client) Flush() *FlushService
- func (c *Client) Get() *GetService
- func (c *Client) GetTemplate() *GetTemplateService
- func (c *Client) Index() *IndexService
- func (c *Client) IndexExists(name string) *IndexExistsService
- func (c *Client) MultiGet() *MultiGetService
- func (c *Client) MultiSearch() *MultiSearchService
- func (c *Client) NewRequest(method, path string) (*Request, error)
- func (c *Client) OpenIndex(name string) *OpenIndexService
- func (c *Client) Optimize(indices ...string) *OptimizeService
- func (c *Client) Ping() *PingService
- func (c *Client) PutTemplate() *PutTemplateService
- func (c *Client) Refresh(indices ...string) *RefreshService
- func (c *Client) Scan(indices ...string) *ScanService
- func (c *Client) Scroll(indices ...string) *ScrollService
- func (c *Client) Search(indices ...string) *SearchService
- func (c *Client) SetLogger(log *log.Logger)
- func (c *Client) Suggest(indices ...string) *SuggestService
- func (c *Client) Update() *UpdateService
- type CloseIndexResponse
- type CloseIndexService
- func (s *CloseIndexService) AllowNoIndices(allowNoIndices bool) *CloseIndexService
- func (s *CloseIndexService) Do() (*CloseIndexResponse, error)
- func (s *CloseIndexService) ExpandWildcards(expandWildcards string) *CloseIndexService
- func (s *CloseIndexService) IgnoreUnavailable(ignoreUnavailable bool) *CloseIndexService
- func (s *CloseIndexService) Index(index string) *CloseIndexService
- func (s *CloseIndexService) MasterTimeout(masterTimeout string) *CloseIndexService
- func (s *CloseIndexService) Timeout(timeout string) *CloseIndexService
- func (s *CloseIndexService) Validate() error
- type ClusterHealthResponse
- type ClusterHealthService
- func (s *ClusterHealthService) Do() (*ClusterHealthResponse, error)
- func (s *ClusterHealthService) Index(index string) *ClusterHealthService
- func (s *ClusterHealthService) Indices(indices ...string) *ClusterHealthService
- func (s *ClusterHealthService) Level(level string) *ClusterHealthService
- func (s *ClusterHealthService) Local(local bool) *ClusterHealthService
- func (s *ClusterHealthService) MasterTimeout(masterTimeout string) *ClusterHealthService
- func (s *ClusterHealthService) Timeout(timeout string) *ClusterHealthService
- func (s *ClusterHealthService) Validate() error
- func (s *ClusterHealthService) WaitForActiveShards(waitForActiveShards int) *ClusterHealthService
- func (s *ClusterHealthService) WaitForNodes(waitForNodes string) *ClusterHealthService
- func (s *ClusterHealthService) WaitForRelocatingShards(waitForRelocatingShards int) *ClusterHealthService
- func (s *ClusterHealthService) WaitForStatus(waitForStatus string) *ClusterHealthService
- type ClusterStateMetadata
- type ClusterStateNode
- type ClusterStateResponse
- type ClusterStateRoutingNode
- type ClusterStateRoutingTable
- type ClusterStateService
- func (s *ClusterStateService) Do() (*ClusterStateResponse, error)
- func (s *ClusterStateService) FlatSettings(flatSettings bool) *ClusterStateService
- func (s *ClusterStateService) Index(index string) *ClusterStateService
- func (s *ClusterStateService) Indices(indices ...string) *ClusterStateService
- func (s *ClusterStateService) Local(local bool) *ClusterStateService
- func (s *ClusterStateService) MasterTimeout(masterTimeout string) *ClusterStateService
- func (s *ClusterStateService) Metric(metric string) *ClusterStateService
- func (s *ClusterStateService) Metrics(metrics ...string) *ClusterStateService
- func (s *ClusterStateService) Validate() error
- type CommonQuery
- func (q *CommonQuery) Analyzer(analyzer string) *CommonQuery
- func (q *CommonQuery) Boost(boost float64) *CommonQuery
- func (q *CommonQuery) CutoffFrequency(f float64) *CommonQuery
- func (q *CommonQuery) DisableCoords(disable bool) *CommonQuery
- func (q *CommonQuery) HighFreq(f float64) *CommonQuery
- func (q *CommonQuery) HighFreqMinMatch(min interface{}) *CommonQuery
- func (q *CommonQuery) HighFreqOperator(op string) *CommonQuery
- func (q *CommonQuery) LowFreq(f float64) *CommonQuery
- func (q *CommonQuery) LowFreqMinMatch(min interface{}) *CommonQuery
- func (q *CommonQuery) LowFreqOperator(op string) *CommonQuery
- func (q CommonQuery) Source() interface{}
- type CompletionSuggester
- func (q CompletionSuggester) Analyzer(analyzer string) CompletionSuggester
- func (q CompletionSuggester) ContextQueries(queries ...SuggesterContextQuery) CompletionSuggester
- func (q CompletionSuggester) ContextQuery(query SuggesterContextQuery) CompletionSuggester
- func (q CompletionSuggester) Field(field string) CompletionSuggester
- func (q CompletionSuggester) Name() string
- func (q CompletionSuggester) ShardSize(shardSize int) CompletionSuggester
- func (q CompletionSuggester) Size(size int) CompletionSuggester
- func (q CompletionSuggester) Source(includeName bool) interface{}
- func (q CompletionSuggester) Text(text string) CompletionSuggester
- type CountResult
- type CountService
- func (s *CountService) Debug(debug bool) *CountService
- func (s *CountService) Do() (int64, error)
- func (s *CountService) Index(index string) *CountService
- func (s *CountService) Indices(indices ...string) *CountService
- func (s *CountService) Pretty(pretty bool) *CountService
- func (s *CountService) Query(query Query) *CountService
- func (s *CountService) Type(typ string) *CountService
- func (s *CountService) Types(types ...string) *CountService
- type CreateIndexResult
- type CreateIndexService
- func (b *CreateIndexService) Body(body string) *CreateIndexService
- func (b *CreateIndexService) Debug(debug bool) *CreateIndexService
- func (b *CreateIndexService) Do() (*CreateIndexResult, error)
- func (b *CreateIndexService) Index(index string) *CreateIndexService
- func (b *CreateIndexService) Pretty(pretty bool) *CreateIndexService
- type CustomFiltersScoreQuery
- func (q CustomFiltersScoreQuery) Filter(filter Filter) CustomFiltersScoreQuery
- func (q CustomFiltersScoreQuery) MaxBoost(maxBoost float32) CustomFiltersScoreQuery
- func (q CustomFiltersScoreQuery) Query(query Query) CustomFiltersScoreQuery
- func (q CustomFiltersScoreQuery) ScoreMode(scoreMode string) CustomFiltersScoreQuery
- func (q CustomFiltersScoreQuery) Script(script string) CustomFiltersScoreQuery
- func (q CustomFiltersScoreQuery) Source() interface{}
- type CustomScoreQuery
- func (q CustomScoreQuery) Boost(boost float32) CustomScoreQuery
- func (q CustomScoreQuery) Filter(filter Filter) CustomScoreQuery
- func (q CustomScoreQuery) Lang(lang string) CustomScoreQuery
- func (q CustomScoreQuery) Param(name string, value interface{}) CustomScoreQuery
- func (q CustomScoreQuery) Params(params map[string]interface{}) CustomScoreQuery
- func (q CustomScoreQuery) Query(query Query) CustomScoreQuery
- func (q CustomScoreQuery) Script(script string) CustomScoreQuery
- func (q CustomScoreQuery) Source() interface{}
- type DateHistogramAggregation
- func (a DateHistogramAggregation) ExtendedBoundsMax(max interface{}) DateHistogramAggregation
- func (a DateHistogramAggregation) ExtendedBoundsMin(min interface{}) DateHistogramAggregation
- func (a DateHistogramAggregation) Factor(factor float32) DateHistogramAggregation
- func (a DateHistogramAggregation) Field(field string) DateHistogramAggregation
- func (a DateHistogramAggregation) Format(format string) DateHistogramAggregation
- func (a DateHistogramAggregation) Interval(interval string) DateHistogramAggregation
- func (a DateHistogramAggregation) Lang(lang string) DateHistogramAggregation
- func (a DateHistogramAggregation) MinDocCount(minDocCount int64) DateHistogramAggregation
- func (a DateHistogramAggregation) Order(order string, asc bool) DateHistogramAggregation
- func (a DateHistogramAggregation) OrderByAggregation(aggName string, asc bool) DateHistogramAggregation
- func (a DateHistogramAggregation) OrderByAggregationAndMetric(aggName, metric string, asc bool) DateHistogramAggregation
- func (a DateHistogramAggregation) OrderByCount(asc bool) DateHistogramAggregation
- func (a DateHistogramAggregation) OrderByCountAsc() DateHistogramAggregation
- func (a DateHistogramAggregation) OrderByCountDesc() DateHistogramAggregation
- func (a DateHistogramAggregation) OrderByKey(asc bool) DateHistogramAggregation
- func (a DateHistogramAggregation) OrderByKeyAsc() DateHistogramAggregation
- func (a DateHistogramAggregation) OrderByKeyDesc() DateHistogramAggregation
- func (a DateHistogramAggregation) Param(name string, value interface{}) DateHistogramAggregation
- func (a DateHistogramAggregation) PostOffset(postOffset int64) DateHistogramAggregation
- func (a DateHistogramAggregation) PostZone(postZone string) DateHistogramAggregation
- func (a DateHistogramAggregation) PreOffset(preOffset int64) DateHistogramAggregation
- func (a DateHistogramAggregation) PreZone(preZone string) DateHistogramAggregation
- func (a DateHistogramAggregation) PreZoneAdjustLargeInterval(preZoneAdjustLargeInterval bool) DateHistogramAggregation
- func (a DateHistogramAggregation) Script(script string) DateHistogramAggregation
- func (a DateHistogramAggregation) Source() interface{}
- func (a DateHistogramAggregation) SubAggregation(name string, subAggregation Aggregation) DateHistogramAggregation
- type DateHistogramFacet
- func (f DateHistogramFacet) Comparator(comparator string) DateHistogramFacet
- func (f DateHistogramFacet) FacetFilter(filter Facet) DateHistogramFacet
- func (f DateHistogramFacet) Factor(factor float32) DateHistogramFacet
- func (f DateHistogramFacet) Field(field string) DateHistogramFacet
- func (f DateHistogramFacet) Global(global bool) DateHistogramFacet
- func (f DateHistogramFacet) Interval(interval string) DateHistogramFacet
- func (f DateHistogramFacet) KeyField(keyField string) DateHistogramFacet
- func (f DateHistogramFacet) Lang(lang string) DateHistogramFacet
- func (f DateHistogramFacet) Mode(mode string) DateHistogramFacet
- func (f DateHistogramFacet) Nested(nested string) DateHistogramFacet
- func (f DateHistogramFacet) Param(name string, value interface{}) DateHistogramFacet
- func (f DateHistogramFacet) PostOffset(postOffset string) DateHistogramFacet
- func (f DateHistogramFacet) PostZone(postZone string) DateHistogramFacet
- func (f DateHistogramFacet) PreOffset(preOffset string) DateHistogramFacet
- func (f DateHistogramFacet) PreZone(preZone string) DateHistogramFacet
- func (f DateHistogramFacet) PreZoneAdjustLargeInterval(preZoneAdjustLargeInterval bool) DateHistogramFacet
- func (f DateHistogramFacet) Source() interface{}
- func (f DateHistogramFacet) ValueField(valueField string) DateHistogramFacet
- func (f DateHistogramFacet) ValueScript(valueScript string) DateHistogramFacet
- type DateRangeAggregation
- func (a DateRangeAggregation) AddRange(from, to interface{}) DateRangeAggregation
- func (a DateRangeAggregation) AddRangeWithKey(key string, from, to interface{}) DateRangeAggregation
- func (a DateRangeAggregation) AddUnboundedFrom(to interface{}) DateRangeAggregation
- func (a DateRangeAggregation) AddUnboundedFromWithKey(key string, to interface{}) DateRangeAggregation
- func (a DateRangeAggregation) AddUnboundedTo(from interface{}) DateRangeAggregation
- func (a DateRangeAggregation) AddUnboundedToWithKey(key string, from interface{}) DateRangeAggregation
- func (a DateRangeAggregation) Between(from, to interface{}) DateRangeAggregation
- func (a DateRangeAggregation) BetweenWithKey(key string, from, to interface{}) DateRangeAggregation
- func (a DateRangeAggregation) Field(field string) DateRangeAggregation
- func (a DateRangeAggregation) Format(format string) DateRangeAggregation
- func (a DateRangeAggregation) Gt(from interface{}) DateRangeAggregation
- func (a DateRangeAggregation) GtWithKey(key string, from interface{}) DateRangeAggregation
- func (a DateRangeAggregation) Keyed(keyed bool) DateRangeAggregation
- func (a DateRangeAggregation) Lang(lang string) DateRangeAggregation
- func (a DateRangeAggregation) Lt(to interface{}) DateRangeAggregation
- func (a DateRangeAggregation) LtWithKey(key string, to interface{}) DateRangeAggregation
- func (a DateRangeAggregation) Param(name string, value interface{}) DateRangeAggregation
- func (a DateRangeAggregation) Script(script string) DateRangeAggregation
- func (a DateRangeAggregation) Source() interface{}
- func (a DateRangeAggregation) SubAggregation(name string, subAggregation Aggregation) DateRangeAggregation
- func (a DateRangeAggregation) Unmapped(unmapped bool) DateRangeAggregation
- type DateRangeAggregationEntry
- type DeleteByQueryResult
- type DeleteByQueryService
- func (s *DeleteByQueryService) AllowNoIndices(allow bool) *DeleteByQueryService
- func (s *DeleteByQueryService) Analyzer(analyzer string) *DeleteByQueryService
- func (s *DeleteByQueryService) Consistency(consistency string) *DeleteByQueryService
- func (s *DeleteByQueryService) DF(defaultField string) *DeleteByQueryService
- func (s *DeleteByQueryService) Debug(debug bool) *DeleteByQueryService
- func (s *DeleteByQueryService) DefaultField(defaultField string) *DeleteByQueryService
- func (s *DeleteByQueryService) DefaultOperator(defaultOperator string) *DeleteByQueryService
- func (s *DeleteByQueryService) Do() (*DeleteByQueryResult, error)
- func (s *DeleteByQueryService) ExpandWildcards(expand string) *DeleteByQueryService
- func (s *DeleteByQueryService) IgnoreUnavailable(ignore bool) *DeleteByQueryService
- func (s *DeleteByQueryService) Index(index string) *DeleteByQueryService
- func (s *DeleteByQueryService) Indices(indices ...string) *DeleteByQueryService
- func (s *DeleteByQueryService) Pretty(pretty bool) *DeleteByQueryService
- func (s *DeleteByQueryService) Q(query string) *DeleteByQueryService
- func (s *DeleteByQueryService) Query(query Query) *DeleteByQueryService
- func (s *DeleteByQueryService) QueryString(query string) *DeleteByQueryService
- func (s *DeleteByQueryService) Replication(replication string) *DeleteByQueryService
- func (s *DeleteByQueryService) Routing(routing string) *DeleteByQueryService
- func (s *DeleteByQueryService) Timeout(timeout string) *DeleteByQueryService
- func (s *DeleteByQueryService) Type(typ string) *DeleteByQueryService
- func (s *DeleteByQueryService) Types(types ...string) *DeleteByQueryService
- type DeleteIndexResult
- type DeleteIndexService
- type DeleteResult
- type DeleteService
- func (s *DeleteService) Debug(debug bool) *DeleteService
- func (s *DeleteService) Do() (*DeleteResult, error)
- func (s *DeleteService) Id(id string) *DeleteService
- func (s *DeleteService) Index(index string) *DeleteService
- func (s *DeleteService) Parent(parent string) *DeleteService
- func (s *DeleteService) Pretty(pretty bool) *DeleteService
- func (s *DeleteService) Refresh(refresh bool) *DeleteService
- func (s *DeleteService) Type(_type string) *DeleteService
- func (s *DeleteService) Version(version int) *DeleteService
- type DeleteTemplateResponse
- type DeleteTemplateService
- func (s *DeleteTemplateService) Do() (*DeleteTemplateResponse, error)
- func (s *DeleteTemplateService) Id(id string) *DeleteTemplateService
- func (s *DeleteTemplateService) Validate() error
- func (s *DeleteTemplateService) Version(version int) *DeleteTemplateService
- func (s *DeleteTemplateService) VersionType(versionType string) *DeleteTemplateService
- type DirectCandidateGenerator
- func (g *DirectCandidateGenerator) Accuracy(accuracy float64) *DirectCandidateGenerator
- func (g *DirectCandidateGenerator) Field(field string) *DirectCandidateGenerator
- func (g *DirectCandidateGenerator) MaxEdits(maxEdits int) *DirectCandidateGenerator
- func (g *DirectCandidateGenerator) MaxInspections(maxInspections int) *DirectCandidateGenerator
- func (g *DirectCandidateGenerator) MaxTermFreq(maxTermFreq float64) *DirectCandidateGenerator
- func (g *DirectCandidateGenerator) MinDocFreq(minDocFreq float64) *DirectCandidateGenerator
- func (g *DirectCandidateGenerator) MinWordLength(minWordLength int) *DirectCandidateGenerator
- func (g *DirectCandidateGenerator) PostFilter(postFilter string) *DirectCandidateGenerator
- func (g *DirectCandidateGenerator) PreFilter(preFilter string) *DirectCandidateGenerator
- func (g *DirectCandidateGenerator) PrefixLength(prefixLength int) *DirectCandidateGenerator
- func (g *DirectCandidateGenerator) Size(size int) *DirectCandidateGenerator
- func (g *DirectCandidateGenerator) Sort(sort string) *DirectCandidateGenerator
- func (g *DirectCandidateGenerator) Source() interface{}
- func (g *DirectCandidateGenerator) StringDistance(stringDistance string) *DirectCandidateGenerator
- func (g *DirectCandidateGenerator) SuggestMode(suggestMode string) *DirectCandidateGenerator
- func (g *DirectCandidateGenerator) Type() string
- type DisMaxQuery
- type Error
- type ExistsFilter
- type ExistsService
- type ExponentialDecayFunction
- func (fn ExponentialDecayFunction) Decay(decay float64) ExponentialDecayFunction
- func (fn ExponentialDecayFunction) FieldName(fieldName string) ExponentialDecayFunction
- func (fn ExponentialDecayFunction) Name() string
- func (fn ExponentialDecayFunction) Offset(offset interface{}) ExponentialDecayFunction
- func (fn ExponentialDecayFunction) Origin(origin interface{}) ExponentialDecayFunction
- func (fn ExponentialDecayFunction) Scale(scale interface{}) ExponentialDecayFunction
- func (fn ExponentialDecayFunction) Source() interface{}
- type ExtendedStatsAggregation
- func (a ExtendedStatsAggregation) Field(field string) ExtendedStatsAggregation
- func (a ExtendedStatsAggregation) Format(format string) ExtendedStatsAggregation
- func (a ExtendedStatsAggregation) Lang(lang string) ExtendedStatsAggregation
- func (a ExtendedStatsAggregation) Param(name string, value interface{}) ExtendedStatsAggregation
- func (a ExtendedStatsAggregation) Script(script string) ExtendedStatsAggregation
- func (a ExtendedStatsAggregation) Source() interface{}
- func (a ExtendedStatsAggregation) SubAggregation(name string, subAggregation Aggregation) ExtendedStatsAggregation
- type Facet
- type FactorFunction
- type FetchSourceContext
- func (fsc *FetchSourceContext) Exclude(excludes ...string) *FetchSourceContext
- func (fsc *FetchSourceContext) FetchSource() bool
- func (fsc *FetchSourceContext) Include(includes ...string) *FetchSourceContext
- func (fsc *FetchSourceContext) Query() url.Values
- func (fsc *FetchSourceContext) SetFetchSource(fetchSource bool)
- func (fsc *FetchSourceContext) Source() interface{}
- func (fsc *FetchSourceContext) TransformSource(transformSource bool) *FetchSourceContext
- type FieldSort
- func (s FieldSort) Asc() FieldSort
- func (s FieldSort) Desc() FieldSort
- func (s FieldSort) FieldName(fieldName string) FieldSort
- func (s FieldSort) IgnoreUnmapped(ignoreUnmapped bool) FieldSort
- func (s FieldSort) Missing(missing interface{}) FieldSort
- func (s FieldSort) NestedFilter(nestedFilter Filter) FieldSort
- func (s FieldSort) NestedPath(nestedPath string) FieldSort
- func (s FieldSort) Order(ascending bool) FieldSort
- func (s FieldSort) SortMode(sortMode string) FieldSort
- func (s FieldSort) Source() interface{}
- func (s FieldSort) UnmappedType(typ string) FieldSort
- type FieldValueFactorFunction
- func (fn FieldValueFactorFunction) Factor(factor float64) FieldValueFactorFunction
- func (fn FieldValueFactorFunction) Field(field string) FieldValueFactorFunction
- func (fn FieldValueFactorFunction) Modifier(modifier string) FieldValueFactorFunction
- func (fn FieldValueFactorFunction) Name() string
- func (fn FieldValueFactorFunction) Source() interface{}
- type Filter
- type FilterAggregation
- type FilterFacet
- func (f FilterFacet) FacetFilter(filter Facet) FilterFacet
- func (f FilterFacet) Filter(filter Filter) FilterFacet
- func (f FilterFacet) Global(global bool) FilterFacet
- func (f FilterFacet) Mode(mode string) FilterFacet
- func (f FilterFacet) Nested(nested string) FilterFacet
- func (f FilterFacet) Source() interface{}
- type FilteredQuery
- type FiltersAggregation
- type FlushResult
- type FlushService
- type FunctionScoreQuery
- func (q FunctionScoreQuery) Add(filter Filter, scoreFunc ScoreFunction) FunctionScoreQuery
- func (q FunctionScoreQuery) AddScoreFunc(scoreFunc ScoreFunction) FunctionScoreQuery
- func (q FunctionScoreQuery) Boost(boost float32) FunctionScoreQuery
- func (q FunctionScoreQuery) BoostMode(boostMode string) FunctionScoreQuery
- func (q FunctionScoreQuery) Filter(filter Filter) FunctionScoreQuery
- func (q FunctionScoreQuery) MaxBoost(maxBoost float32) FunctionScoreQuery
- func (q FunctionScoreQuery) Query(query Query) FunctionScoreQuery
- func (q FunctionScoreQuery) ScoreMode(scoreMode string) FunctionScoreQuery
- func (q FunctionScoreQuery) Source() interface{}
- type FuzzyCompletionSuggester
- func (q FuzzyCompletionSuggester) Analyzer(analyzer string) FuzzyCompletionSuggester
- func (q FuzzyCompletionSuggester) ContextQueries(queries ...SuggesterContextQuery) FuzzyCompletionSuggester
- func (q FuzzyCompletionSuggester) ContextQuery(query SuggesterContextQuery) FuzzyCompletionSuggester
- func (q FuzzyCompletionSuggester) Field(field string) FuzzyCompletionSuggester
- func (q FuzzyCompletionSuggester) Fuzziness(fuzziness interface{}) FuzzyCompletionSuggester
- func (q FuzzyCompletionSuggester) FuzzyMinLength(minLength int) FuzzyCompletionSuggester
- func (q FuzzyCompletionSuggester) FuzzyPrefixLength(prefixLength int) FuzzyCompletionSuggester
- func (q FuzzyCompletionSuggester) FuzzyTranspositions(fuzzyTranspositions bool) FuzzyCompletionSuggester
- func (q FuzzyCompletionSuggester) Name() string
- func (q FuzzyCompletionSuggester) ShardSize(shardSize int) FuzzyCompletionSuggester
- func (q FuzzyCompletionSuggester) Size(size int) FuzzyCompletionSuggester
- func (q FuzzyCompletionSuggester) Source(includeName bool) interface{}
- func (q FuzzyCompletionSuggester) Text(text string) FuzzyCompletionSuggester
- func (q FuzzyCompletionSuggester) UnicodeAware(unicodeAware bool) FuzzyCompletionSuggester
- type FuzzyLikeThisFieldQuery
- func (q FuzzyLikeThisFieldQuery) Analyzer(analyzer string) FuzzyLikeThisFieldQuery
- func (q FuzzyLikeThisFieldQuery) Boost(boost float32) FuzzyLikeThisFieldQuery
- func (q FuzzyLikeThisFieldQuery) FailOnUnsupportedField(fail bool) FuzzyLikeThisFieldQuery
- func (q FuzzyLikeThisFieldQuery) Fuzziness(fuzziness interface{}) FuzzyLikeThisFieldQuery
- func (q FuzzyLikeThisFieldQuery) IgnoreTF(ignoreTF bool) FuzzyLikeThisFieldQuery
- func (q FuzzyLikeThisFieldQuery) LikeText(likeText string) FuzzyLikeThisFieldQuery
- func (q FuzzyLikeThisFieldQuery) MaxQueryTerms(maxQueryTerms int) FuzzyLikeThisFieldQuery
- func (q FuzzyLikeThisFieldQuery) PrefixLength(prefixLength int) FuzzyLikeThisFieldQuery
- func (q FuzzyLikeThisFieldQuery) QueryName(queryName string) FuzzyLikeThisFieldQuery
- func (q FuzzyLikeThisFieldQuery) Source() interface{}
- type FuzzyLikeThisQuery
- func (q FuzzyLikeThisQuery) Analyzer(analyzer string) FuzzyLikeThisQuery
- func (q FuzzyLikeThisQuery) Boost(boost float32) FuzzyLikeThisQuery
- func (q FuzzyLikeThisQuery) FailOnUnsupportedField(fail bool) FuzzyLikeThisQuery
- func (q FuzzyLikeThisQuery) Field(field string) FuzzyLikeThisQuery
- func (q FuzzyLikeThisQuery) Fields(fields ...string) FuzzyLikeThisQuery
- func (q FuzzyLikeThisQuery) Fuzziness(fuzziness interface{}) FuzzyLikeThisQuery
- func (q FuzzyLikeThisQuery) IgnoreTF(ignoreTF bool) FuzzyLikeThisQuery
- func (q FuzzyLikeThisQuery) LikeText(likeText string) FuzzyLikeThisQuery
- func (q FuzzyLikeThisQuery) MaxQueryTerms(maxQueryTerms int) FuzzyLikeThisQuery
- func (q FuzzyLikeThisQuery) PrefixLength(prefixLength int) FuzzyLikeThisQuery
- func (q FuzzyLikeThisQuery) QueryName(queryName string) FuzzyLikeThisQuery
- func (q FuzzyLikeThisQuery) Source() interface{}
- type FuzzyQuery
- func (q FuzzyQuery) Boost(boost float32) FuzzyQuery
- func (q FuzzyQuery) Fuzziness(fuzziness interface{}) FuzzyQuery
- func (q FuzzyQuery) MaxExpansions(maxExpansions int) FuzzyQuery
- func (q FuzzyQuery) Name(name string) FuzzyQuery
- func (q FuzzyQuery) PrefixLength(prefixLength int) FuzzyQuery
- func (q FuzzyQuery) QueryName(queryName string) FuzzyQuery
- func (q FuzzyQuery) Source() interface{}
- func (q FuzzyQuery) Transpositions(transpositions bool) FuzzyQuery
- func (q FuzzyQuery) Value(value interface{}) FuzzyQuery
- type GaussDecayFunction
- func (fn GaussDecayFunction) Decay(decay float64) GaussDecayFunction
- func (fn GaussDecayFunction) FieldName(fieldName string) GaussDecayFunction
- func (fn GaussDecayFunction) Name() string
- func (fn GaussDecayFunction) Offset(offset interface{}) GaussDecayFunction
- func (fn GaussDecayFunction) Origin(origin interface{}) GaussDecayFunction
- func (fn GaussDecayFunction) Scale(scale interface{}) GaussDecayFunction
- func (fn GaussDecayFunction) Source() interface{}
- type GeoBoundsAggregation
- func (a GeoBoundsAggregation) Field(field string) GeoBoundsAggregation
- func (a GeoBoundsAggregation) Lang(lang string) GeoBoundsAggregation
- func (a GeoBoundsAggregation) Param(name string, value interface{}) GeoBoundsAggregation
- func (a GeoBoundsAggregation) Params(params map[string]interface{}) GeoBoundsAggregation
- func (a GeoBoundsAggregation) Script(script string) GeoBoundsAggregation
- func (a GeoBoundsAggregation) Source() interface{}
- func (a GeoBoundsAggregation) WrapLongitude(wrapLongitude bool) GeoBoundsAggregation
- type GeoDistanceAggregation
- func (a GeoDistanceAggregation) AddRange(from, to interface{}) GeoDistanceAggregation
- func (a GeoDistanceAggregation) AddRangeWithKey(key string, from, to interface{}) GeoDistanceAggregation
- func (a GeoDistanceAggregation) AddUnboundedFrom(to float64) GeoDistanceAggregation
- func (a GeoDistanceAggregation) AddUnboundedFromWithKey(key string, to float64) GeoDistanceAggregation
- func (a GeoDistanceAggregation) AddUnboundedTo(from float64) GeoDistanceAggregation
- func (a GeoDistanceAggregation) AddUnboundedToWithKey(key string, from float64) GeoDistanceAggregation
- func (a GeoDistanceAggregation) Between(from, to interface{}) GeoDistanceAggregation
- func (a GeoDistanceAggregation) BetweenWithKey(key string, from, to interface{}) GeoDistanceAggregation
- func (a GeoDistanceAggregation) DistanceType(distanceType string) GeoDistanceAggregation
- func (a GeoDistanceAggregation) Field(field string) GeoDistanceAggregation
- func (a GeoDistanceAggregation) Point(latLon string) GeoDistanceAggregation
- func (a GeoDistanceAggregation) Source() interface{}
- func (a GeoDistanceAggregation) SubAggregation(name string, subAggregation Aggregation) GeoDistanceAggregation
- func (a GeoDistanceAggregation) Unit(unit string) GeoDistanceAggregation
- type GeoDistanceFacet
- func (f GeoDistanceFacet) AddRange(from, to float64) GeoDistanceFacet
- func (f GeoDistanceFacet) AddUnboundedFrom(to float64) GeoDistanceFacet
- func (f GeoDistanceFacet) AddUnboundedTo(from float64) GeoDistanceFacet
- func (f GeoDistanceFacet) FacetFilter(filter Facet) GeoDistanceFacet
- func (f GeoDistanceFacet) Field(fieldName string) GeoDistanceFacet
- func (f GeoDistanceFacet) GeoDistance(geoDistance string) GeoDistanceFacet
- func (f GeoDistanceFacet) GeoHash(geoHash string) GeoDistanceFacet
- func (f GeoDistanceFacet) Global(global bool) GeoDistanceFacet
- func (f GeoDistanceFacet) Lang(lang string) GeoDistanceFacet
- func (f GeoDistanceFacet) Lat(lat float64) GeoDistanceFacet
- func (f GeoDistanceFacet) Lon(lon float64) GeoDistanceFacet
- func (f GeoDistanceFacet) Mode(mode string) GeoDistanceFacet
- func (f GeoDistanceFacet) Nested(nested string) GeoDistanceFacet
- func (f GeoDistanceFacet) Point(lat, lon float64) GeoDistanceFacet
- func (f GeoDistanceFacet) ScriptParam(name string, value interface{}) GeoDistanceFacet
- func (f GeoDistanceFacet) Source() interface{}
- func (f GeoDistanceFacet) Unit(distanceUnit string) GeoDistanceFacet
- func (f GeoDistanceFacet) ValueField(valueFieldName string) GeoDistanceFacet
- func (f GeoDistanceFacet) ValueScript(valueScript string) GeoDistanceFacet
- type GeoDistanceSort
- func (s GeoDistanceSort) Asc() GeoDistanceSort
- func (s GeoDistanceSort) Desc() GeoDistanceSort
- func (s GeoDistanceSort) FieldName(fieldName string) GeoDistanceSort
- func (s GeoDistanceSort) GeoDistance(geoDistance string) GeoDistanceSort
- func (s GeoDistanceSort) GeoHashes(geohashes ...string) GeoDistanceSort
- func (s GeoDistanceSort) NestedFilter(nestedFilter Filter) GeoDistanceSort
- func (s GeoDistanceSort) NestedPath(nestedPath string) GeoDistanceSort
- func (s GeoDistanceSort) Order(ascending bool) GeoDistanceSort
- func (s GeoDistanceSort) Point(lat, lon float64) GeoDistanceSort
- func (s GeoDistanceSort) Points(points ...*GeoPoint) GeoDistanceSort
- func (s GeoDistanceSort) SortMode(sortMode string) GeoDistanceSort
- func (s GeoDistanceSort) Source() interface{}
- func (s GeoDistanceSort) Unit(unit string) GeoDistanceSort
- type GeoPoint
- type GeoPolygonFilter
- func (f GeoPolygonFilter) AddPoint(point *GeoPoint) GeoPolygonFilter
- func (f GeoPolygonFilter) Cache(cache bool) GeoPolygonFilter
- func (f GeoPolygonFilter) CacheKey(cacheKey string) GeoPolygonFilter
- func (f GeoPolygonFilter) FilterName(filterName string) GeoPolygonFilter
- func (f GeoPolygonFilter) Source() interface{}
- type GetResult
- type GetService
- func (b *GetService) Do() (*GetResult, error)
- func (s *GetService) FetchSource(fetchSource bool) *GetService
- func (s *GetService) FetchSourceContext(fetchSourceContext *FetchSourceContext) *GetService
- func (b *GetService) Fields(fields ...string) *GetService
- func (b *GetService) Id(id string) *GetService
- func (b *GetService) Index(index string) *GetService
- func (b *GetService) Parent(parent string) *GetService
- func (b *GetService) Preference(preference string) *GetService
- func (b *GetService) Realtime(realtime bool) *GetService
- func (b *GetService) Refresh(refresh bool) *GetService
- func (b *GetService) Routing(routing string) *GetService
- func (b *GetService) String() string
- func (b *GetService) Type(_type string) *GetService
- func (b *GetService) Version(version int64) *GetService
- func (b *GetService) VersionType(versionType string) *GetService
- type GetTemplateResponse
- type GetTemplateService
- func (s *GetTemplateService) Do() (*GetTemplateResponse, error)
- func (s *GetTemplateService) Id(id string) *GetTemplateService
- func (s *GetTemplateService) Validate() error
- func (s *GetTemplateService) Version(version interface{}) *GetTemplateService
- func (s *GetTemplateService) VersionType(versionType string) *GetTemplateService
- type GlobalAggregation
- type HasChildFilter
- func (f HasChildFilter) Cache(cache bool) HasChildFilter
- func (f HasChildFilter) CacheKey(cacheKey string) HasChildFilter
- func (f HasChildFilter) Filter(filter Filter) HasChildFilter
- func (f HasChildFilter) FilterName(filterName string) HasChildFilter
- func (f HasChildFilter) Query(query Query) HasChildFilter
- func (f HasChildFilter) ShortCircuitCutoff(shortCircuitCutoff int) HasChildFilter
- func (f HasChildFilter) Source() interface{}
- type HasChildQuery
- func (q HasChildQuery) Boost(boost float32) HasChildQuery
- func (q HasChildQuery) QueryName(queryName string) HasChildQuery
- func (q HasChildQuery) ScoreType(scoreType string) HasChildQuery
- func (q HasChildQuery) ShortCircuitCutoff(shortCircuitCutoff int) HasChildQuery
- func (q HasChildQuery) Source() interface{}
- type HasParentFilter
- func (f HasParentFilter) Cache(cache bool) HasParentFilter
- func (f HasParentFilter) CacheKey(cacheKey string) HasParentFilter
- func (f HasParentFilter) Filter(filter Filter) HasParentFilter
- func (f HasParentFilter) FilterName(filterName string) HasParentFilter
- func (f HasParentFilter) Query(query Query) HasParentFilter
- func (f HasParentFilter) Source() interface{}
- type HasParentQuery
- type Highlight
- func (hl *Highlight) BoundaryChars(boundaryChars ...rune) *Highlight
- func (hl *Highlight) BoundaryMaxScan(boundaryMaxScan int) *Highlight
- func (hl *Highlight) Encoder(encoder string) *Highlight
- func (hl *Highlight) Field(name string) *Highlight
- func (hl *Highlight) Fields(fields ...*HighlighterField) *Highlight
- func (hl *Highlight) ForceSource(forceSource bool) *Highlight
- func (hl *Highlight) FragmentSize(fragmentSize int) *Highlight
- func (hl *Highlight) Fragmenter(fragmenter string) *Highlight
- func (hl *Highlight) HighlighQuery(highlightQuery Query) *Highlight
- func (hl *Highlight) HighlightFilter(highlightFilter bool) *Highlight
- func (hl *Highlight) HighlighterType(highlighterType string) *Highlight
- func (hl *Highlight) NoMatchSize(noMatchSize int) *Highlight
- func (hl *Highlight) NumOfFragments(numOfFragments int) *Highlight
- func (hl *Highlight) Options(options map[string]interface{}) *Highlight
- func (hl *Highlight) Order(order string) *Highlight
- func (hl *Highlight) PostTags(postTags ...string) *Highlight
- func (hl *Highlight) PreTags(preTags ...string) *Highlight
- func (hl *Highlight) RequireFieldMatch(requireFieldMatch bool) *Highlight
- func (hl *Highlight) Source() interface{}
- func (hl *Highlight) TagsSchema(schemaName string) *Highlight
- func (hl *Highlight) UseExplicitFieldOrder(useExplicitFieldOrder bool) *Highlight
- type HighlighterField
- func (f *HighlighterField) BoundaryChars(boundaryChars ...rune) *HighlighterField
- func (f *HighlighterField) BoundaryMaxScan(boundaryMaxScan int) *HighlighterField
- func (f *HighlighterField) ForceSource(forceSource bool) *HighlighterField
- func (f *HighlighterField) FragmentOffset(fragmentOffset int) *HighlighterField
- func (f *HighlighterField) FragmentSize(fragmentSize int) *HighlighterField
- func (f *HighlighterField) Fragmenter(fragmenter string) *HighlighterField
- func (f *HighlighterField) HighlightFilter(highlightFilter bool) *HighlighterField
- func (f *HighlighterField) HighlightQuery(highlightQuery Query) *HighlighterField
- func (f *HighlighterField) HighlighterType(highlighterType string) *HighlighterField
- func (f *HighlighterField) MatchedFields(matchedFields ...string) *HighlighterField
- func (f *HighlighterField) NoMatchSize(noMatchSize int) *HighlighterField
- func (f *HighlighterField) NumOfFragments(numOfFragments int) *HighlighterField
- func (f *HighlighterField) Options(options map[string]interface{}) *HighlighterField
- func (f *HighlighterField) Order(order string) *HighlighterField
- func (f *HighlighterField) PhraseLimit(phraseLimit int) *HighlighterField
- func (f *HighlighterField) PostTags(postTags ...string) *HighlighterField
- func (f *HighlighterField) PreTags(preTags ...string) *HighlighterField
- func (f *HighlighterField) RequireFieldMatch(requireFieldMatch bool) *HighlighterField
- func (f *HighlighterField) Source() interface{}
- type HistogramAggregation
- func (a HistogramAggregation) ExtendedBoundsMax(max int64) HistogramAggregation
- func (a HistogramAggregation) ExtendedBoundsMin(min int64) HistogramAggregation
- func (a HistogramAggregation) Field(field string) HistogramAggregation
- func (a HistogramAggregation) Interval(interval int64) HistogramAggregation
- func (a HistogramAggregation) Lang(lang string) HistogramAggregation
- func (a HistogramAggregation) MinDocCount(minDocCount int64) HistogramAggregation
- func (a HistogramAggregation) Order(order string, asc bool) HistogramAggregation
- func (a HistogramAggregation) OrderByAggregation(aggName string, asc bool) HistogramAggregation
- func (a HistogramAggregation) OrderByAggregationAndMetric(aggName, metric string, asc bool) HistogramAggregation
- func (a HistogramAggregation) OrderByCount(asc bool) HistogramAggregation
- func (a HistogramAggregation) OrderByCountAsc() HistogramAggregation
- func (a HistogramAggregation) OrderByCountDesc() HistogramAggregation
- func (a HistogramAggregation) OrderByKey(asc bool) HistogramAggregation
- func (a HistogramAggregation) OrderByKeyAsc() HistogramAggregation
- func (a HistogramAggregation) OrderByKeyDesc() HistogramAggregation
- func (a HistogramAggregation) Param(name string, value interface{}) HistogramAggregation
- func (a HistogramAggregation) Script(script string) HistogramAggregation
- func (a HistogramAggregation) Source() interface{}
- func (a HistogramAggregation) SubAggregation(name string, subAggregation Aggregation) HistogramAggregation
- type HistogramFacet
- func (f HistogramFacet) FacetFilter(filter Facet) HistogramFacet
- func (f HistogramFacet) Field(field string) HistogramFacet
- func (f HistogramFacet) Global(global bool) HistogramFacet
- func (f HistogramFacet) Interval(interval int64) HistogramFacet
- func (f HistogramFacet) KeyField(keyField string) HistogramFacet
- func (f HistogramFacet) Mode(mode string) HistogramFacet
- func (f HistogramFacet) Nested(nested string) HistogramFacet
- func (f HistogramFacet) Source() interface{}
- func (f HistogramFacet) TimeInterval(timeInterval string) HistogramFacet
- func (f HistogramFacet) ValueField(valueField string) HistogramFacet
- type HistogramScriptFacet
- func (f HistogramScriptFacet) Comparator(comparatorType string) HistogramScriptFacet
- func (f HistogramScriptFacet) FacetFilter(filter Facet) HistogramScriptFacet
- func (f HistogramScriptFacet) Global(global bool) HistogramScriptFacet
- func (f HistogramScriptFacet) Interval(interval int64) HistogramScriptFacet
- func (f HistogramScriptFacet) KeyField(keyField string) HistogramScriptFacet
- func (f HistogramScriptFacet) KeyScript(keyScript string) HistogramScriptFacet
- func (f HistogramScriptFacet) Mode(mode string) HistogramScriptFacet
- func (f HistogramScriptFacet) Nested(nested string) HistogramScriptFacet
- func (f HistogramScriptFacet) Param(name string, value interface{}) HistogramScriptFacet
- func (f HistogramScriptFacet) Source() interface{}
- func (f HistogramScriptFacet) ValueScript(valueScript string) HistogramScriptFacet
- type IdsFilter
- type IdsQuery
- type IndexDeleteByQueryResult
- type IndexExistsService
- type IndexResult
- type IndexService
- func (b *IndexService) BodyJson(json interface{}) *IndexService
- func (b *IndexService) BodyString(body string) *IndexService
- func (b *IndexService) Debug(debug bool) *IndexService
- func (b *IndexService) Do() (*IndexResult, error)
- func (b *IndexService) Id(id string) *IndexService
- func (b *IndexService) Index(name string) *IndexService
- func (b *IndexService) OpType(opType string) *IndexService
- func (b *IndexService) Parent(parent string) *IndexService
- func (b *IndexService) Pretty(pretty bool) *IndexService
- func (b *IndexService) Refresh(refresh bool) *IndexService
- func (b *IndexService) Routing(routing string) *IndexService
- func (b *IndexService) TTL(ttl string) *IndexService
- func (b *IndexService) Timeout(timeout string) *IndexService
- func (b *IndexService) Timestamp(timestamp string) *IndexService
- func (b *IndexService) Type(_type string) *IndexService
- func (b *IndexService) Version(version int64) *IndexService
- func (b *IndexService) VersionType(versionType string) *IndexService
- type LaplaceSmoothingModel
- type LimitFilter
- type LinearDecayFunction
- func (fn LinearDecayFunction) Decay(decay float64) LinearDecayFunction
- func (fn LinearDecayFunction) FieldName(fieldName string) LinearDecayFunction
- func (fn LinearDecayFunction) Name() string
- func (fn LinearDecayFunction) Offset(offset interface{}) LinearDecayFunction
- func (fn LinearDecayFunction) Origin(origin interface{}) LinearDecayFunction
- func (fn LinearDecayFunction) Scale(scale interface{}) LinearDecayFunction
- func (fn LinearDecayFunction) Source() interface{}
- type LinearInterpolationSmoothingModel
- type MatchAllFilter
- type MatchAllQuery
- type MatchQuery
- func (q MatchQuery) Analyzer(analyzer string) MatchQuery
- func (q MatchQuery) Boost(boost float32) MatchQuery
- func (q MatchQuery) CutoffFrequency(cutoff float32) MatchQuery
- func (q MatchQuery) Fuzziness(fuzziness string) MatchQuery
- func (q MatchQuery) FuzzyRewrite(fuzzyRewrite string) MatchQuery
- func (q MatchQuery) FuzzyTranspositions(fuzzyTranspositions bool) MatchQuery
- func (q MatchQuery) Lenient(lenient bool) MatchQuery
- func (q MatchQuery) MaxExpansions(maxExpansions int) MatchQuery
- func (q MatchQuery) MinimumShouldMatch(minimumShouldMatch string) MatchQuery
- func (q MatchQuery) Operator(operator string) MatchQuery
- func (q MatchQuery) PrefixLength(prefixLength int) MatchQuery
- func (q MatchQuery) QueryName(queryName string) MatchQuery
- func (q MatchQuery) Rewrite(rewrite string) MatchQuery
- func (q MatchQuery) Slop(slop int) MatchQuery
- func (q MatchQuery) Source() interface{}
- func (q MatchQuery) Type(matchQueryType string) MatchQuery
- func (q MatchQuery) ZeroTermsQuery(zeroTermsQuery string) MatchQuery
- type MaxAggregation
- func (a MaxAggregation) Field(field string) MaxAggregation
- func (a MaxAggregation) Format(format string) MaxAggregation
- func (a MaxAggregation) Lang(lang string) MaxAggregation
- func (a MaxAggregation) Param(name string, value interface{}) MaxAggregation
- func (a MaxAggregation) Script(script string) MaxAggregation
- func (a MaxAggregation) Source() interface{}
- func (a MaxAggregation) SubAggregation(name string, subAggregation Aggregation) MaxAggregation
- type MinAggregation
- func (a MinAggregation) Field(field string) MinAggregation
- func (a MinAggregation) Format(format string) MinAggregation
- func (a MinAggregation) Lang(lang string) MinAggregation
- func (a MinAggregation) Param(name string, value interface{}) MinAggregation
- func (a MinAggregation) Script(script string) MinAggregation
- func (a MinAggregation) Source() interface{}
- func (a MinAggregation) SubAggregation(name string, subAggregation Aggregation) MinAggregation
- type MissingAggregation
- type MissingFilter
- type MoreLikeThisFieldQuery
- func (q MoreLikeThisFieldQuery) Analyzer(analyzer string) MoreLikeThisFieldQuery
- func (q MoreLikeThisFieldQuery) Boost(boost float32) MoreLikeThisFieldQuery
- func (q MoreLikeThisFieldQuery) BoostTerms(boostTerms float32) MoreLikeThisFieldQuery
- func (q MoreLikeThisFieldQuery) FailOnUnsupportedField(fail bool) MoreLikeThisFieldQuery
- func (q MoreLikeThisFieldQuery) LikeText(likeText string) MoreLikeThisFieldQuery
- func (q MoreLikeThisFieldQuery) MaxDocFreq(maxDocFreq int) MoreLikeThisFieldQuery
- func (q MoreLikeThisFieldQuery) MaxQueryTerms(maxQueryTerms int) MoreLikeThisFieldQuery
- func (q MoreLikeThisFieldQuery) MaxWordLen(maxWordLen int) MoreLikeThisFieldQuery
- func (q MoreLikeThisFieldQuery) MinDocFreq(minDocFreq int) MoreLikeThisFieldQuery
- func (q MoreLikeThisFieldQuery) MinTermFreq(minTermFreq int) MoreLikeThisFieldQuery
- func (q MoreLikeThisFieldQuery) MinWordLen(minWordLen int) MoreLikeThisFieldQuery
- func (q MoreLikeThisFieldQuery) Name(name string) MoreLikeThisFieldQuery
- func (q MoreLikeThisFieldQuery) PercentTermsToMatch(percentTermsToMatch float32) MoreLikeThisFieldQuery
- func (q MoreLikeThisFieldQuery) Source() interface{}
- func (q MoreLikeThisFieldQuery) StopWord(stopWord string) MoreLikeThisFieldQuery
- func (q MoreLikeThisFieldQuery) StopWords(stopWords ...string) MoreLikeThisFieldQuery
- type MoreLikeThisQuery
- func (q MoreLikeThisQuery) Analyzer(analyzer string) MoreLikeThisQuery
- func (q MoreLikeThisQuery) Boost(boost float32) MoreLikeThisQuery
- func (q MoreLikeThisQuery) BoostTerms(boostTerms float32) MoreLikeThisQuery
- func (q MoreLikeThisQuery) FailOnUnsupportedField(fail bool) MoreLikeThisQuery
- func (q MoreLikeThisQuery) Field(field string) MoreLikeThisQuery
- func (q MoreLikeThisQuery) Fields(fields ...string) MoreLikeThisQuery
- func (q MoreLikeThisQuery) LikeText(likeText string) MoreLikeThisQuery
- func (q MoreLikeThisQuery) MaxDocFreq(maxDocFreq int) MoreLikeThisQuery
- func (q MoreLikeThisQuery) MaxQueryTerms(maxQueryTerms int) MoreLikeThisQuery
- func (q MoreLikeThisQuery) MaxWordLen(maxWordLen int) MoreLikeThisQuery
- func (q MoreLikeThisQuery) MinDocFreq(minDocFreq int) MoreLikeThisQuery
- func (q MoreLikeThisQuery) MinTermFreq(minTermFreq int) MoreLikeThisQuery
- func (q MoreLikeThisQuery) MinWordLen(minWordLen int) MoreLikeThisQuery
- func (q MoreLikeThisQuery) PercentTermsToMatch(percentTermsToMatch float32) MoreLikeThisQuery
- func (q MoreLikeThisQuery) Source() interface{}
- func (q MoreLikeThisQuery) StopWord(stopWord string) MoreLikeThisQuery
- func (q MoreLikeThisQuery) StopWords(stopWords ...string) MoreLikeThisQuery
- type MultiGetItem
- func (item *MultiGetItem) FetchSource(fetchSourceContext *FetchSourceContext) *MultiGetItem
- func (item *MultiGetItem) Fields(fields ...string) *MultiGetItem
- func (item *MultiGetItem) Id(id string) *MultiGetItem
- func (item *MultiGetItem) Index(index string) *MultiGetItem
- func (item *MultiGetItem) Routing(routing string) *MultiGetItem
- func (item *MultiGetItem) Source() interface{}
- func (item *MultiGetItem) Type(typ string) *MultiGetItem
- func (item *MultiGetItem) Version(version int64) *MultiGetItem
- func (item *MultiGetItem) VersionType(versionType string) *MultiGetItem
- type MultiGetResult
- type MultiGetService
- func (b *MultiGetService) Add(items ...*MultiGetItem) *MultiGetService
- func (b *MultiGetService) Do() (*MultiGetResult, error)
- func (b *MultiGetService) Preference(preference string) *MultiGetService
- func (b *MultiGetService) Realtime(realtime bool) *MultiGetService
- func (b *MultiGetService) Refresh(refresh bool) *MultiGetService
- func (b *MultiGetService) Source() interface{}
- type MultiMatchQuery
- func (q MultiMatchQuery) Analyzer(analyzer string) MultiMatchQuery
- func (q MultiMatchQuery) Boost(boost float32) MultiMatchQuery
- func (q MultiMatchQuery) CutoffFrequency(cutoff float32) MultiMatchQuery
- func (q MultiMatchQuery) Field(field string) MultiMatchQuery
- func (q MultiMatchQuery) FieldWithBoost(field string, boost float32) MultiMatchQuery
- func (q MultiMatchQuery) Fuzziness(fuzziness string) MultiMatchQuery
- func (q MultiMatchQuery) FuzzyRewrite(fuzzyRewrite string) MultiMatchQuery
- func (q MultiMatchQuery) Lenient(lenient bool) MultiMatchQuery
- func (q MultiMatchQuery) MaxExpansions(maxExpansions int) MultiMatchQuery
- func (q MultiMatchQuery) MinimumShouldMatch(minimumShouldMatch string) MultiMatchQuery
- func (q MultiMatchQuery) Operator(operator string) MultiMatchQuery
- func (q MultiMatchQuery) PrefixLength(prefixLength int) MultiMatchQuery
- func (q MultiMatchQuery) QueryName(queryName string) MultiMatchQuery
- func (q MultiMatchQuery) Rewrite(rewrite string) MultiMatchQuery
- func (q MultiMatchQuery) Slop(slop int) MultiMatchQuery
- func (q MultiMatchQuery) Source() interface{}
- func (q MultiMatchQuery) TieBreaker(tieBreaker float32) MultiMatchQuery
- func (q MultiMatchQuery) Type(matchQueryType string) MultiMatchQuery
- func (q MultiMatchQuery) UseDisMax(useDisMax bool) MultiMatchQuery
- func (q MultiMatchQuery) ZeroTermsQuery(zeroTermsQuery string) MultiMatchQuery
- type MultiSearchResult
- type MultiSearchService
- func (s *MultiSearchService) Add(requests ...*SearchRequest) *MultiSearchService
- func (s *MultiSearchService) Debug(debug bool) *MultiSearchService
- func (s *MultiSearchService) Do() (*MultiSearchResult, error)
- func (s *MultiSearchService) Index(index string) *MultiSearchService
- func (s *MultiSearchService) Indices(indices ...string) *MultiSearchService
- func (s *MultiSearchService) Pretty(pretty bool) *MultiSearchService
- type NestedAggregation
- type NestedFilter
- func (f NestedFilter) Cache(cache bool) NestedFilter
- func (f NestedFilter) CacheKey(cacheKey string) NestedFilter
- func (f NestedFilter) Filter(filter Filter) NestedFilter
- func (f NestedFilter) FilterName(filterName string) NestedFilter
- func (f NestedFilter) Join(join bool) NestedFilter
- func (f NestedFilter) Path(path string) NestedFilter
- func (f NestedFilter) Query(query Query) NestedFilter
- func (f NestedFilter) Source() interface{}
- type NestedQuery
- func (q NestedQuery) Boost(boost float32) NestedQuery
- func (q NestedQuery) Filter(filter Filter) NestedQuery
- func (q NestedQuery) Path(path string) NestedQuery
- func (q NestedQuery) Query(query Query) NestedQuery
- func (q NestedQuery) QueryName(queryName string) NestedQuery
- func (q NestedQuery) ScoreMode(scoreMode string) NestedQuery
- func (q NestedQuery) Source() interface{}
- type NotFilter
- type OpenIndexResponse
- type OpenIndexService
- func (s *OpenIndexService) AllowNoIndices(allowNoIndices bool) *OpenIndexService
- func (s *OpenIndexService) Do() (*OpenIndexResponse, error)
- func (s *OpenIndexService) ExpandWildcards(expandWildcards string) *OpenIndexService
- func (s *OpenIndexService) IgnoreUnavailable(ignoreUnavailable bool) *OpenIndexService
- func (s *OpenIndexService) Index(index string) *OpenIndexService
- func (s *OpenIndexService) MasterTimeout(masterTimeout string) *OpenIndexService
- func (s *OpenIndexService) Timeout(timeout string) *OpenIndexService
- func (s *OpenIndexService) Validate() error
- type OptimizeResult
- type OptimizeService
- func (s *OptimizeService) Debug(debug bool) *OptimizeService
- func (s *OptimizeService) Do() (*OptimizeResult, error)
- func (s *OptimizeService) Flush(flush bool) *OptimizeService
- func (s *OptimizeService) Force(force bool) *OptimizeService
- func (s *OptimizeService) Index(index string) *OptimizeService
- func (s *OptimizeService) Indices(indices ...string) *OptimizeService
- func (s *OptimizeService) MaxNumSegments(maxNumSegments int) *OptimizeService
- func (s *OptimizeService) OnlyExpungeDeletes(onlyExpungeDeletes bool) *OptimizeService
- func (s *OptimizeService) Pretty(pretty bool) *OptimizeService
- func (s *OptimizeService) WaitForMerge(waitForMerge bool) *OptimizeService
- type OrFilter
- type PartialField
- type PercentileRanksAggregation
- func (a PercentileRanksAggregation) Compression(compression float64) PercentileRanksAggregation
- func (a PercentileRanksAggregation) Estimator(estimator string) PercentileRanksAggregation
- func (a PercentileRanksAggregation) Field(field string) PercentileRanksAggregation
- func (a PercentileRanksAggregation) Format(format string) PercentileRanksAggregation
- func (a PercentileRanksAggregation) Lang(lang string) PercentileRanksAggregation
- func (a PercentileRanksAggregation) Param(name string, value interface{}) PercentileRanksAggregation
- func (a PercentileRanksAggregation) Script(script string) PercentileRanksAggregation
- func (a PercentileRanksAggregation) Source() interface{}
- func (a PercentileRanksAggregation) SubAggregation(name string, subAggregation Aggregation) PercentileRanksAggregation
- func (a PercentileRanksAggregation) Values(values ...float64) PercentileRanksAggregation
- type PercentilesAggregation
- func (a PercentilesAggregation) Compression(compression float64) PercentilesAggregation
- func (a PercentilesAggregation) Estimator(estimator string) PercentilesAggregation
- func (a PercentilesAggregation) Field(field string) PercentilesAggregation
- func (a PercentilesAggregation) Format(format string) PercentilesAggregation
- func (a PercentilesAggregation) Lang(lang string) PercentilesAggregation
- func (a PercentilesAggregation) Param(name string, value interface{}) PercentilesAggregation
- func (a PercentilesAggregation) Percentiles(percentiles ...float64) PercentilesAggregation
- func (a PercentilesAggregation) Script(script string) PercentilesAggregation
- func (a PercentilesAggregation) Source() interface{}
- func (a PercentilesAggregation) SubAggregation(name string, subAggregation Aggregation) PercentilesAggregation
- type PhraseSuggester
- func (q PhraseSuggester) Analyzer(analyzer string) PhraseSuggester
- func (q PhraseSuggester) CandidateGenerator(generator CandidateGenerator) PhraseSuggester
- func (q PhraseSuggester) CandidateGenerators(generators ...CandidateGenerator) PhraseSuggester
- func (q PhraseSuggester) ClearCandidateGenerator() PhraseSuggester
- func (q PhraseSuggester) CollateFilter(collateFilter string) PhraseSuggester
- func (q PhraseSuggester) CollateParams(collateParams map[string]interface{}) PhraseSuggester
- func (q PhraseSuggester) CollatePreference(collatePreference string) PhraseSuggester
- func (q PhraseSuggester) CollatePrune(collatePrune bool) PhraseSuggester
- func (q PhraseSuggester) CollateQuery(collateQuery string) PhraseSuggester
- func (q PhraseSuggester) Confidence(confidence float32) PhraseSuggester
- func (q PhraseSuggester) ContextQueries(queries ...SuggesterContextQuery) PhraseSuggester
- func (q PhraseSuggester) ContextQuery(query SuggesterContextQuery) PhraseSuggester
- func (q PhraseSuggester) Field(field string) PhraseSuggester
- func (q PhraseSuggester) ForceUnigrams(forceUnigrams bool) PhraseSuggester
- func (q PhraseSuggester) GramSize(gramSize int) PhraseSuggester
- func (q PhraseSuggester) Highlight(preTag, postTag string) PhraseSuggester
- func (q PhraseSuggester) MaxErrors(maxErrors float32) PhraseSuggester
- func (q PhraseSuggester) Name() string
- func (q PhraseSuggester) RealWordErrorLikelihood(realWordErrorLikelihood float32) PhraseSuggester
- func (q PhraseSuggester) Separator(separator string) PhraseSuggester
- func (q PhraseSuggester) ShardSize(shardSize int) PhraseSuggester
- func (q PhraseSuggester) Size(size int) PhraseSuggester
- func (q PhraseSuggester) SmoothingModel(smoothingModel SmoothingModel) PhraseSuggester
- func (q PhraseSuggester) Source(includeName bool) interface{}
- func (q PhraseSuggester) Text(text string) PhraseSuggester
- func (q PhraseSuggester) TokenLimit(tokenLimit int) PhraseSuggester
- type PingResult
- type PingService
- func (s *PingService) Debug(debug bool) *PingService
- func (s *PingService) Do() (*PingResult, int, error)
- func (s *PingService) HttpHeadOnly(httpHeadOnly bool) *PingService
- func (s *PingService) Pretty(pretty bool) *PingService
- func (s *PingService) Timeout(timeout string) *PingService
- func (s *PingService) URL(url string) *PingService
- type PrefixFilter
- type PrefixQuery
- type PutTemplateResponse
- type PutTemplateService
- func (s *PutTemplateService) BodyJson(body interface{}) *PutTemplateService
- func (s *PutTemplateService) BodyString(body string) *PutTemplateService
- func (s *PutTemplateService) Do() (*PutTemplateResponse, error)
- func (s *PutTemplateService) Id(id string) *PutTemplateService
- func (s *PutTemplateService) OpType(opType string) *PutTemplateService
- func (s *PutTemplateService) Validate() error
- func (s *PutTemplateService) Version(version int) *PutTemplateService
- func (s *PutTemplateService) VersionType(versionType string) *PutTemplateService
- type Query
- type QueryFacet
- func (f QueryFacet) FacetFilter(filter Facet) QueryFacet
- func (f QueryFacet) Global(global bool) QueryFacet
- func (f QueryFacet) Mode(mode string) QueryFacet
- func (f QueryFacet) Nested(nested string) QueryFacet
- func (f QueryFacet) Query(query Query) QueryFacet
- func (f QueryFacet) Source() interface{}
- type QueryFilter
- type QueryRescorer
- func (r *QueryRescorer) Name() string
- func (r *QueryRescorer) QueryWeight(queryWeight float64) *QueryRescorer
- func (r *QueryRescorer) RescoreQueryWeight(rescoreQueryWeight float64) *QueryRescorer
- func (r *QueryRescorer) ScoreMode(scoreMode string) *QueryRescorer
- func (r *QueryRescorer) Source() interface{}
- type QueryStringQuery
- func (q QueryStringQuery) AllowLeadingWildcard(allowLeadingWildcard bool) QueryStringQuery
- func (q QueryStringQuery) AnalyzeWildcard(analyzeWildcard bool) QueryStringQuery
- func (q QueryStringQuery) Analyzer(analyzer string) QueryStringQuery
- func (q QueryStringQuery) AutoGeneratePhraseQueries(autoGeneratePhraseQueries bool) QueryStringQuery
- func (q QueryStringQuery) Boost(boost float32) QueryStringQuery
- func (q QueryStringQuery) DefaultField(defaultField string) QueryStringQuery
- func (q QueryStringQuery) DefaultOperator(operator string) QueryStringQuery
- func (q QueryStringQuery) EnablePositionIncrements(enablePositionIncrements bool) QueryStringQuery
- func (q QueryStringQuery) Field(field string) QueryStringQuery
- func (q QueryStringQuery) FieldWithBoost(field string, boost float32) QueryStringQuery
- func (q QueryStringQuery) FuzzyMaxExpansions(fuzzyMaxExpansions int) QueryStringQuery
- func (q QueryStringQuery) FuzzyMinSim(fuzzyMinSim float32) QueryStringQuery
- func (q QueryStringQuery) FuzzyRewrite(fuzzyRewrite string) QueryStringQuery
- func (q QueryStringQuery) Lenient(lenient bool) QueryStringQuery
- func (q QueryStringQuery) LowercaseExpandedTerms(lowercaseExpandedTerms bool) QueryStringQuery
- func (q QueryStringQuery) MinimumShouldMatch(minimumShouldMatch string) QueryStringQuery
- func (q QueryStringQuery) PhraseSlop(phraseSlop int) QueryStringQuery
- func (q QueryStringQuery) QuoteAnalyzer(quoteAnalyzer string) QueryStringQuery
- func (q QueryStringQuery) QuoteFieldSuffix(quoteFieldSuffix string) QueryStringQuery
- func (q QueryStringQuery) Rewrite(rewrite string) QueryStringQuery
- func (q QueryStringQuery) Source() interface{}
- func (q QueryStringQuery) TieBreaker(tieBreaker float32) QueryStringQuery
- func (q QueryStringQuery) UseDisMax(useDisMax bool) QueryStringQuery
- type RandomFunction
- type RangeAggregation
- func (a RangeAggregation) AddRange(from, to interface{}) RangeAggregation
- func (a RangeAggregation) AddRangeWithKey(key string, from, to interface{}) RangeAggregation
- func (a RangeAggregation) AddUnboundedFrom(to interface{}) RangeAggregation
- func (a RangeAggregation) AddUnboundedFromWithKey(key string, to interface{}) RangeAggregation
- func (a RangeAggregation) AddUnboundedTo(from interface{}) RangeAggregation
- func (a RangeAggregation) AddUnboundedToWithKey(key string, from interface{}) RangeAggregation
- func (a RangeAggregation) Between(from, to interface{}) RangeAggregation
- func (a RangeAggregation) BetweenWithKey(key string, from, to interface{}) RangeAggregation
- func (a RangeAggregation) Field(field string) RangeAggregation
- func (a RangeAggregation) Gt(from interface{}) RangeAggregation
- func (a RangeAggregation) GtWithKey(key string, from interface{}) RangeAggregation
- func (a RangeAggregation) Keyed(keyed bool) RangeAggregation
- func (a RangeAggregation) Lang(lang string) RangeAggregation
- func (a RangeAggregation) Lt(to interface{}) RangeAggregation
- func (a RangeAggregation) LtWithKey(key string, to interface{}) RangeAggregation
- func (a RangeAggregation) Param(name string, value interface{}) RangeAggregation
- func (a RangeAggregation) Script(script string) RangeAggregation
- func (a RangeAggregation) Source() interface{}
- func (a RangeAggregation) SubAggregation(name string, subAggregation Aggregation) RangeAggregation
- func (a RangeAggregation) Unmapped(unmapped bool) RangeAggregation
- type RangeFacet
- func (f RangeFacet) AddRange(from, to interface{}) RangeFacet
- func (f RangeFacet) AddUnboundedFrom(to interface{}) RangeFacet
- func (f RangeFacet) AddUnboundedTo(from interface{}) RangeFacet
- func (f RangeFacet) Between(from, to interface{}) RangeFacet
- func (f RangeFacet) FacetFilter(filter Facet) RangeFacet
- func (f RangeFacet) Field(field string) RangeFacet
- func (f RangeFacet) Global(global bool) RangeFacet
- func (f RangeFacet) Gt(from interface{}) RangeFacet
- func (f RangeFacet) KeyField(keyField string) RangeFacet
- func (f RangeFacet) Lt(to interface{}) RangeFacet
- func (f RangeFacet) Mode(mode string) RangeFacet
- func (f RangeFacet) Nested(nested string) RangeFacet
- func (f RangeFacet) Source() interface{}
- func (f RangeFacet) ValueField(valueField string) RangeFacet
- type RangeFilter
- func (f RangeFilter) Cache(cache bool) RangeFilter
- func (f RangeFilter) CacheKey(cacheKey string) RangeFilter
- func (f RangeFilter) Execution(execution string) RangeFilter
- func (f RangeFilter) FilterName(filterName string) RangeFilter
- func (f RangeFilter) From(from interface{}) RangeFilter
- func (f RangeFilter) Gt(from interface{}) RangeFilter
- func (f RangeFilter) Gte(from interface{}) RangeFilter
- func (f RangeFilter) IncludeLower(includeLower bool) RangeFilter
- func (f RangeFilter) IncludeUpper(includeUpper bool) RangeFilter
- func (f RangeFilter) Lt(to interface{}) RangeFilter
- func (f RangeFilter) Lte(to interface{}) RangeFilter
- func (f RangeFilter) Source() interface{}
- func (f RangeFilter) TimeZone(timeZone string) RangeFilter
- func (f RangeFilter) To(to interface{}) RangeFilter
- type RangeQuery
- func (q RangeQuery) Boost(boost float64) RangeQuery
- func (q RangeQuery) From(from interface{}) RangeQuery
- func (q RangeQuery) Gt(from interface{}) RangeQuery
- func (q RangeQuery) Gte(from interface{}) RangeQuery
- func (q RangeQuery) IncludeLower(includeLower bool) RangeQuery
- func (q RangeQuery) IncludeUpper(includeUpper bool) RangeQuery
- func (q RangeQuery) Lt(to interface{}) RangeQuery
- func (q RangeQuery) Lte(to interface{}) RangeQuery
- func (q RangeQuery) QueryName(queryName string) RangeQuery
- func (q RangeQuery) Source() interface{}
- func (f RangeQuery) TimeZone(timeZone string) RangeQuery
- func (q RangeQuery) To(to interface{}) RangeQuery
- type RefreshResult
- type RefreshService
- func (s *RefreshService) Debug(debug bool) *RefreshService
- func (s *RefreshService) Do() (*RefreshResult, error)
- func (s *RefreshService) Force(force bool) *RefreshService
- func (s *RefreshService) Index(index string) *RefreshService
- func (s *RefreshService) Indices(indices ...string) *RefreshService
- func (s *RefreshService) Pretty(pretty bool) *RefreshService
- type RegexpFilter
- func (f RegexpFilter) Cache(cache bool) RegexpFilter
- func (f RegexpFilter) CacheKey(cacheKey string) RegexpFilter
- func (f RegexpFilter) FilterName(filterName string) RegexpFilter
- func (f RegexpFilter) Flags(flags string) RegexpFilter
- func (f RegexpFilter) MaxDeterminizedStates(maxDeterminizedStates int) RegexpFilter
- func (f RegexpFilter) Source() interface{}
- type RegexpQuery
- func (q RegexpQuery) Boost(boost float64) RegexpQuery
- func (q RegexpQuery) Flags(flags string) RegexpQuery
- func (q RegexpQuery) MaxDeterminizedStates(maxDeterminizedStates int) RegexpQuery
- func (q RegexpQuery) QueryName(queryName string) RegexpQuery
- func (q RegexpQuery) Rewrite(rewrite string) RegexpQuery
- func (q RegexpQuery) Source() interface{}
- type Request
- type Rescore
- type Rescorer
- type ScanCursor
- type ScanService
- func (s *ScanService) Debug(debug bool) *ScanService
- func (s *ScanService) Do() (*ScanCursor, error)
- func (s *ScanService) Index(index string) *ScanService
- func (s *ScanService) Indices(indices ...string) *ScanService
- func (s *ScanService) KeepAlive(keepAlive string) *ScanService
- func (s *ScanService) Pretty(pretty bool) *ScanService
- func (s *ScanService) Query(query Query) *ScanService
- func (s *ScanService) Scroll(keepAlive string) *ScanService
- func (s *ScanService) Size(size int) *ScanService
- func (s *ScanService) Type(typ string) *ScanService
- func (s *ScanService) Types(types ...string) *ScanService
- type ScoreFunction
- type ScoreSort
- type ScriptField
- type ScriptFunction
- func (fn ScriptFunction) Lang(lang string) ScriptFunction
- func (fn ScriptFunction) Name() string
- func (fn ScriptFunction) Param(name string, value interface{}) ScriptFunction
- func (fn ScriptFunction) Params(params map[string]interface{}) ScriptFunction
- func (fn ScriptFunction) Script(script string) ScriptFunction
- func (fn ScriptFunction) Source() interface{}
- type ScriptSort
- func (s ScriptSort) Asc() ScriptSort
- func (s ScriptSort) Desc() ScriptSort
- func (s ScriptSort) Lang(lang string) ScriptSort
- func (s ScriptSort) NestedFilter(nestedFilter Filter) ScriptSort
- func (s ScriptSort) NestedPath(nestedPath string) ScriptSort
- func (s ScriptSort) Order(ascending bool) ScriptSort
- func (s ScriptSort) Param(name string, value interface{}) ScriptSort
- func (s ScriptSort) Params(params map[string]interface{}) ScriptSort
- func (s ScriptSort) SortMode(sortMode string) ScriptSort
- func (s ScriptSort) Source() interface{}
- func (s ScriptSort) Type(typ string) ScriptSort
- type ScrollService
- func (s *ScrollService) Debug(debug bool) *ScrollService
- func (s *ScrollService) Do() (*SearchResult, error)
- func (s *ScrollService) GetFirstPage() (*SearchResult, error)
- func (s *ScrollService) GetNextPage() (*SearchResult, error)
- func (s *ScrollService) Index(index string) *ScrollService
- func (s *ScrollService) Indices(indices ...string) *ScrollService
- func (s *ScrollService) KeepAlive(keepAlive string) *ScrollService
- func (s *ScrollService) Pretty(pretty bool) *ScrollService
- func (s *ScrollService) Query(query Query) *ScrollService
- func (s *ScrollService) Scroll(keepAlive string) *ScrollService
- func (s *ScrollService) ScrollId(scrollId string) *ScrollService
- func (s *ScrollService) Size(size int) *ScrollService
- func (s *ScrollService) Type(typ string) *ScrollService
- func (s *ScrollService) Types(types ...string) *ScrollService
- type SearchExplanation
- type SearchFacet
- type SearchFacets
- type SearchHit
- type SearchHitHighlight
- type SearchHits
- type SearchRequest
- func (r *SearchRequest) HasIndices() bool
- func (r *SearchRequest) Index(index string) *SearchRequest
- func (r *SearchRequest) Indices(indices ...string) *SearchRequest
- func (r *SearchRequest) Preference(preference string) *SearchRequest
- func (r *SearchRequest) Routing(routing string) *SearchRequest
- func (r *SearchRequest) Routings(routings ...string) *SearchRequest
- func (r *SearchRequest) SearchType(searchType string) *SearchRequest
- func (r *SearchRequest) SearchTypeCount() *SearchRequest
- func (r *SearchRequest) SearchTypeDfsQueryAndFetch() *SearchRequest
- func (r *SearchRequest) SearchTypeDfsQueryThenFetch() *SearchRequest
- func (r *SearchRequest) SearchTypeQueryAndFetch() *SearchRequest
- func (r *SearchRequest) SearchTypeQueryThenFetch() *SearchRequest
- func (r *SearchRequest) SearchTypeScan() *SearchRequest
- func (r *SearchRequest) Source(source interface{}) *SearchRequest
- func (r *SearchRequest) Type(typ string) *SearchRequest
- func (r *SearchRequest) Types(types ...string) *SearchRequest
- type SearchResult
- type SearchService
- func (s *SearchService) Aggregation(name string, aggregation Aggregation) *SearchService
- func (s *SearchService) Debug(debug bool) *SearchService
- func (s *SearchService) Do() (*SearchResult, error)
- func (s *SearchService) Explain(explain bool) *SearchService
- func (s *SearchService) Facet(name string, facet Facet) *SearchService
- func (s *SearchService) Fields(fields ...string) *SearchService
- func (s *SearchService) From(from int) *SearchService
- func (s *SearchService) GlobalSuggestText(globalText string) *SearchService
- func (s *SearchService) Highlight(highlight *Highlight) *SearchService
- func (s *SearchService) Index(index string) *SearchService
- func (s *SearchService) Indices(indices ...string) *SearchService
- func (s *SearchService) MinScore(minScore float64) *SearchService
- func (s *SearchService) PostFilter(postFilter Filter) *SearchService
- func (s *SearchService) Preference(preference string) *SearchService
- func (s *SearchService) Pretty(pretty bool) *SearchService
- func (s *SearchService) Query(query Query) *SearchService
- func (s *SearchService) QueryHint(queryHint string) *SearchService
- func (s *SearchService) Routing(routing string) *SearchService
- func (s *SearchService) SearchSource(searchSource *SearchSource) *SearchService
- func (s *SearchService) SearchType(searchType string) *SearchService
- func (s *SearchService) Size(size int) *SearchService
- func (s *SearchService) Sort(field string, ascending bool) *SearchService
- func (s *SearchService) SortBy(sorter ...Sorter) *SearchService
- func (s *SearchService) SortWithInfo(info SortInfo) *SearchService
- func (s *SearchService) Source(source interface{}) *SearchService
- func (s *SearchService) Suggester(suggester Suggester) *SearchService
- func (s *SearchService) Timeout(timeout string) *SearchService
- func (s *SearchService) TimeoutInMillis(timeoutInMillis int) *SearchService
- func (s *SearchService) Type(typ string) *SearchService
- func (s *SearchService) Types(types ...string) *SearchService
- func (s *SearchService) Version(version bool) *SearchService
- type SearchSource
- func (s *SearchSource) AddRescore(rescore *Rescore) *SearchSource
- func (s *SearchSource) Aggregation(name string, aggregation Aggregation) *SearchSource
- func (s *SearchSource) ClearRescores() *SearchSource
- func (s *SearchSource) DefaultRescoreWindowSize(defaultRescoreWindowSize int) *SearchSource
- func (s *SearchSource) Explain(explain bool) *SearchSource
- func (s *SearchSource) Facet(name string, facet Facet) *SearchSource
- func (s *SearchSource) FetchSource(fetchSource bool) *SearchSource
- func (s *SearchSource) FetchSourceContext(fetchSourceContext *FetchSourceContext) *SearchSource
- func (s *SearchSource) Field(fieldName string) *SearchSource
- func (s *SearchSource) FieldDataField(fieldDataField string) *SearchSource
- func (s *SearchSource) FieldDataFields(fieldDataFields ...string) *SearchSource
- func (s *SearchSource) Fields(fieldNames ...string) *SearchSource
- func (s *SearchSource) From(from int) *SearchSource
- func (s *SearchSource) GlobalSuggestText(text string) *SearchSource
- func (s *SearchSource) Highlight(highlight *Highlight) *SearchSource
- func (s *SearchSource) Highlighter() *Highlight
- func (s *SearchSource) IndexBoost(index string, boost float64) *SearchSource
- func (s *SearchSource) MinScore(minScore float64) *SearchSource
- func (s *SearchSource) NoFields() *SearchSource
- func (s *SearchSource) PartialField(partialField *PartialField) *SearchSource
- func (s *SearchSource) PartialFields(partialFields ...*PartialField) *SearchSource
- func (s *SearchSource) PostFilter(postFilter Filter) *SearchSource
- func (s *SearchSource) Query(query Query) *SearchSource
- func (s *SearchSource) ScriptField(scriptField *ScriptField) *SearchSource
- func (s *SearchSource) ScriptFields(scriptFields ...*ScriptField) *SearchSource
- func (s *SearchSource) Size(size int) *SearchSource
- func (s *SearchSource) Sort(field string, ascending bool) *SearchSource
- func (s *SearchSource) SortBy(sorter ...Sorter) *SearchSource
- func (s *SearchSource) SortWithInfo(info SortInfo) *SearchSource
- func (s *SearchSource) Source() interface{}
- func (s *SearchSource) Stats(statsGroup ...string) *SearchSource
- func (s *SearchSource) Suggester(suggester Suggester) *SearchSource
- func (s *SearchSource) Timeout(timeout string) *SearchSource
- func (s *SearchSource) TimeoutInMillis(timeoutInMillis int) *SearchSource
- func (s *SearchSource) TrackScores(trackScores bool) *SearchSource
- func (s *SearchSource) Version(version bool) *SearchSource
- type SearchSuggest
- type SearchSuggestion
- type SearchSuggestionOption
- type SignificantTermsAggregation
- func (a SignificantTermsAggregation) Field(field string) SignificantTermsAggregation
- func (a SignificantTermsAggregation) MinDocCount(minDocCount int) SignificantTermsAggregation
- func (a SignificantTermsAggregation) RequiredSize(requiredSize int) SignificantTermsAggregation
- func (a SignificantTermsAggregation) SharedSize(shardSize int) SignificantTermsAggregation
- func (a SignificantTermsAggregation) Source() interface{}
- func (a SignificantTermsAggregation) SubAggregation(name string, subAggregation Aggregation) SignificantTermsAggregation
- type SimpleQueryStringQuery
- func (q SimpleQueryStringQuery) Analyzer(analyzer string) SimpleQueryStringQuery
- func (q SimpleQueryStringQuery) DefaultOperator(defaultOperator string) SimpleQueryStringQuery
- func (q SimpleQueryStringQuery) Field(field string) SimpleQueryStringQuery
- func (q SimpleQueryStringQuery) FieldWithBoost(field string, boost float32) SimpleQueryStringQuery
- func (q SimpleQueryStringQuery) Source() interface{}
- type SmoothingModel
- type SortInfo
- type Sorter
- type StatisticalFacet
- func (f StatisticalFacet) FacetFilter(filter Facet) StatisticalFacet
- func (f StatisticalFacet) Field(fieldName string) StatisticalFacet
- func (f StatisticalFacet) Fields(fieldNames ...string) StatisticalFacet
- func (f StatisticalFacet) Global(global bool) StatisticalFacet
- func (f StatisticalFacet) Mode(mode string) StatisticalFacet
- func (f StatisticalFacet) Nested(nested string) StatisticalFacet
- func (f StatisticalFacet) Source() interface{}
- type StatisticalScriptFacet
- func (f StatisticalScriptFacet) FacetFilter(filter Facet) StatisticalScriptFacet
- func (f StatisticalScriptFacet) Global(global bool) StatisticalScriptFacet
- func (f StatisticalScriptFacet) Lang(lang string) StatisticalScriptFacet
- func (f StatisticalScriptFacet) Mode(mode string) StatisticalScriptFacet
- func (f StatisticalScriptFacet) Nested(nested string) StatisticalScriptFacet
- func (f StatisticalScriptFacet) Param(name string, value interface{}) StatisticalScriptFacet
- func (f StatisticalScriptFacet) Script(script string) StatisticalScriptFacet
- func (f StatisticalScriptFacet) Source() interface{}
- type StatsAggregation
- func (a StatsAggregation) Field(field string) StatsAggregation
- func (a StatsAggregation) Format(format string) StatsAggregation
- func (a StatsAggregation) Lang(lang string) StatsAggregation
- func (a StatsAggregation) Param(name string, value interface{}) StatsAggregation
- func (a StatsAggregation) Script(script string) StatsAggregation
- func (a StatsAggregation) Source() interface{}
- func (a StatsAggregation) SubAggregation(name string, subAggregation Aggregation) StatsAggregation
- type StupidBackoffSmoothingModel
- type SuggestField
- type SuggestResult
- type SuggestService
- func (s *SuggestService) Debug(debug bool) *SuggestService
- func (s *SuggestService) Do() (SuggestResult, error)
- func (s *SuggestService) Index(index string) *SuggestService
- func (s *SuggestService) Indices(indices ...string) *SuggestService
- func (s *SuggestService) Preference(preference string) *SuggestService
- func (s *SuggestService) Pretty(pretty bool) *SuggestService
- func (s *SuggestService) Routing(routing string) *SuggestService
- func (s *SuggestService) Suggester(suggester Suggester) *SuggestService
- type Suggester
- type SuggesterCategoryMapping
- type SuggesterCategoryQuery
- type SuggesterContextQuery
- type SuggesterGeoMapping
- func (q *SuggesterGeoMapping) DefaultLocations(locations ...*GeoPoint) *SuggesterGeoMapping
- func (q *SuggesterGeoMapping) FieldName(fieldName string) *SuggesterGeoMapping
- func (q *SuggesterGeoMapping) Neighbors(neighbors bool) *SuggesterGeoMapping
- func (q *SuggesterGeoMapping) Precision(precision ...string) *SuggesterGeoMapping
- func (q *SuggesterGeoMapping) Source() interface{}
- type SuggesterGeoQuery
- type Suggestion
- type SumAggregation
- func (a SumAggregation) Field(field string) SumAggregation
- func (a SumAggregation) Format(format string) SumAggregation
- func (a SumAggregation) Lang(lang string) SumAggregation
- func (a SumAggregation) Param(name string, value interface{}) SumAggregation
- func (a SumAggregation) Script(script string) SumAggregation
- func (a SumAggregation) Source() interface{}
- func (a SumAggregation) SubAggregation(name string, subAggregation Aggregation) SumAggregation
- type TemplateQuery
- func (q TemplateQuery) Source() interface{}
- func (q TemplateQuery) Template(name string) TemplateQuery
- func (q TemplateQuery) TemplateType(typ string) TemplateQuery
- func (q TemplateQuery) Var(name string, value interface{}) TemplateQuery
- func (q TemplateQuery) Vars(vars map[string]interface{}) TemplateQuery
- type TermFilter
- type TermQuery
- type TermSuggester
- func (q TermSuggester) Accuracy(accuracy float32) TermSuggester
- func (q TermSuggester) Analyzer(analyzer string) TermSuggester
- func (q TermSuggester) ContextQueries(queries ...SuggesterContextQuery) TermSuggester
- func (q TermSuggester) ContextQuery(query SuggesterContextQuery) TermSuggester
- func (q TermSuggester) Field(field string) TermSuggester
- func (q TermSuggester) MaxEdits(maxEdits int) TermSuggester
- func (q TermSuggester) MaxInspections(maxInspections int) TermSuggester
- func (q TermSuggester) MaxTermFreq(maxTermFreq float32) TermSuggester
- func (q TermSuggester) MinDocFreq(minDocFreq float32) TermSuggester
- func (q TermSuggester) MinWordLength(minWordLength int) TermSuggester
- func (q TermSuggester) Name() string
- func (q TermSuggester) PrefixLength(prefixLength int) TermSuggester
- func (q TermSuggester) ShardSize(shardSize int) TermSuggester
- func (q TermSuggester) Size(size int) TermSuggester
- func (q TermSuggester) Sort(sort string) TermSuggester
- func (q TermSuggester) Source(includeName bool) interface{}
- func (q TermSuggester) StringDistance(stringDistance string) TermSuggester
- func (q TermSuggester) SuggestMode(suggestMode string) TermSuggester
- func (q TermSuggester) Text(text string) TermSuggester
- type TermsAggregation
- func (a TermsAggregation) CollectionMode(collectionMode string) TermsAggregation
- func (a TermsAggregation) Exclude(regexp string) TermsAggregation
- func (a TermsAggregation) ExcludeTerms(terms ...string) TermsAggregation
- func (a TermsAggregation) ExcludeWithFlags(regexp string, flags int) TermsAggregation
- func (a TermsAggregation) ExecutionHint(hint string) TermsAggregation
- func (a TermsAggregation) Field(field string) TermsAggregation
- func (a TermsAggregation) Include(regexp string) TermsAggregation
- func (a TermsAggregation) IncludeTerms(terms ...string) TermsAggregation
- func (a TermsAggregation) IncludeWithFlags(regexp string, flags int) TermsAggregation
- func (a TermsAggregation) Lang(lang string) TermsAggregation
- func (a TermsAggregation) MinDocCount(minDocCount int) TermsAggregation
- func (a TermsAggregation) Order(order string, asc bool) TermsAggregation
- func (a TermsAggregation) OrderByAggregation(aggName string, asc bool) TermsAggregation
- func (a TermsAggregation) OrderByAggregationAndMetric(aggName, metric string, asc bool) TermsAggregation
- func (a TermsAggregation) OrderByCount(asc bool) TermsAggregation
- func (a TermsAggregation) OrderByCountAsc() TermsAggregation
- func (a TermsAggregation) OrderByCountDesc() TermsAggregation
- func (a TermsAggregation) OrderByTerm(asc bool) TermsAggregation
- func (a TermsAggregation) OrderByTermAsc() TermsAggregation
- func (a TermsAggregation) OrderByTermDesc() TermsAggregation
- func (a TermsAggregation) Param(name string, value interface{}) TermsAggregation
- func (a TermsAggregation) RequiredSize(requiredSize int) TermsAggregation
- func (a TermsAggregation) Script(script string) TermsAggregation
- func (a TermsAggregation) ShardMinDocCount(shardMinDocCount int) TermsAggregation
- func (a TermsAggregation) ShardSize(shardSize int) TermsAggregation
- func (a TermsAggregation) ShowTermDocCountError(showTermDocCountError bool) TermsAggregation
- func (a TermsAggregation) Size(size int) TermsAggregation
- func (a TermsAggregation) Source() interface{}
- func (a TermsAggregation) SubAggregation(name string, subAggregation Aggregation) TermsAggregation
- func (a TermsAggregation) ValueType(valueType string) TermsAggregation
- type TermsFacet
- func (f TermsFacet) AllTerms(allTerms bool) TermsFacet
- func (f TermsFacet) Comparator(comparatorType string) TermsFacet
- func (f TermsFacet) Exclude(exclude ...string) TermsFacet
- func (f TermsFacet) ExecutionHint(hint string) TermsFacet
- func (f TermsFacet) FacetFilter(filter Facet) TermsFacet
- func (f TermsFacet) Field(fieldName string) TermsFacet
- func (f TermsFacet) Fields(fields ...string) TermsFacet
- func (f TermsFacet) Global(global bool) TermsFacet
- func (f TermsFacet) Index(index string) TermsFacet
- func (f TermsFacet) Lang(lang string) TermsFacet
- func (f TermsFacet) Mode(mode string) TermsFacet
- func (f TermsFacet) Nested(nested string) TermsFacet
- func (f TermsFacet) Order(order string) TermsFacet
- func (f TermsFacet) Param(name string, value interface{}) TermsFacet
- func (f TermsFacet) Regex(regex string) TermsFacet
- func (f TermsFacet) RegexFlags(regexFlags string) TermsFacet
- func (f TermsFacet) Script(script string) TermsFacet
- func (f TermsFacet) ScriptField(scriptField string) TermsFacet
- func (f TermsFacet) ShardSize(shardSize int) TermsFacet
- func (f TermsFacet) Size(size int) TermsFacet
- func (f TermsFacet) Source() interface{}
- type TermsFilter
- type TermsQuery
- type TermsStatsFacet
- func (f TermsStatsFacet) AllTerms() TermsStatsFacet
- func (f TermsStatsFacet) FacetFilter(filter Facet) TermsStatsFacet
- func (f TermsStatsFacet) Global(global bool) TermsStatsFacet
- func (f TermsStatsFacet) KeyField(keyField string) TermsStatsFacet
- func (f TermsStatsFacet) Mode(mode string) TermsStatsFacet
- func (f TermsStatsFacet) Nested(nested string) TermsStatsFacet
- func (f TermsStatsFacet) Order(comparatorType string) TermsStatsFacet
- func (f TermsStatsFacet) Param(name string, value interface{}) TermsStatsFacet
- func (f TermsStatsFacet) ShardSize(shardSize int) TermsStatsFacet
- func (f TermsStatsFacet) Size(size int) TermsStatsFacet
- func (f TermsStatsFacet) Source() interface{}
- func (f TermsStatsFacet) ValueField(valueField string) TermsStatsFacet
- func (f TermsStatsFacet) ValueScript(script string) TermsStatsFacet
- type TopHitsAggregation
- func (a TopHitsAggregation) Explain(explain bool) TopHitsAggregation
- func (a TopHitsAggregation) FetchSource(fetchSource bool) TopHitsAggregation
- func (a TopHitsAggregation) FetchSourceContext(fetchSourceContext *FetchSourceContext) TopHitsAggregation
- func (a TopHitsAggregation) FieldDataField(fieldDataField string) TopHitsAggregation
- func (a TopHitsAggregation) FieldDataFields(fieldDataFields ...string) TopHitsAggregation
- func (a TopHitsAggregation) From(from int) TopHitsAggregation
- func (a TopHitsAggregation) Highlight(highlight *Highlight) TopHitsAggregation
- func (a TopHitsAggregation) Highlighter() *Highlight
- func (a TopHitsAggregation) NoFields() TopHitsAggregation
- func (a TopHitsAggregation) PartialField(partialField *PartialField) TopHitsAggregation
- func (a TopHitsAggregation) PartialFields(partialFields ...*PartialField) TopHitsAggregation
- func (a TopHitsAggregation) ScriptField(scriptField *ScriptField) TopHitsAggregation
- func (a TopHitsAggregation) ScriptFields(scriptFields ...*ScriptField) TopHitsAggregation
- func (a TopHitsAggregation) Size(size int) TopHitsAggregation
- func (a TopHitsAggregation) Sort(field string, ascending bool) TopHitsAggregation
- func (a TopHitsAggregation) SortBy(sorter ...Sorter) TopHitsAggregation
- func (a TopHitsAggregation) SortWithInfo(info SortInfo) TopHitsAggregation
- func (a TopHitsAggregation) Source() interface{}
- func (a TopHitsAggregation) TrackScores(trackScores bool) TopHitsAggregation
- func (a TopHitsAggregation) Version(version bool) TopHitsAggregation
- type TypeFilter
- type UpdateResult
- type UpdateService
- func (b *UpdateService) ConsistencyLevel(consistencyLevel string) *UpdateService
- func (b *UpdateService) Debug(debug bool) *UpdateService
- func (b *UpdateService) DetectNoop(detectNoop bool) *UpdateService
- func (b *UpdateService) Do() (*UpdateResult, error)
- func (b *UpdateService) Doc(doc interface{}) *UpdateService
- func (b *UpdateService) DocAsUpsert(docAsUpsert bool) *UpdateService
- func (b *UpdateService) Fields(fields ...string) *UpdateService
- func (b *UpdateService) Id(id string) *UpdateService
- func (b *UpdateService) Index(name string) *UpdateService
- func (b *UpdateService) Parent(parent string) *UpdateService
- func (b *UpdateService) Pretty(pretty bool) *UpdateService
- func (b *UpdateService) Refresh(refresh bool) *UpdateService
- func (b *UpdateService) ReplicationType(replicationType string) *UpdateService
- func (b *UpdateService) RetryOnConflict(retryOnConflict int) *UpdateService
- func (b *UpdateService) Routing(routing string) *UpdateService
- func (b *UpdateService) Script(script string) *UpdateService
- func (b *UpdateService) ScriptId(scriptId string) *UpdateService
- func (b *UpdateService) ScriptLang(scriptLang string) *UpdateService
- func (b *UpdateService) ScriptParams(params map[string]interface{}) *UpdateService
- func (b *UpdateService) ScriptType(scriptType string) *UpdateService
- func (b *UpdateService) ScriptedUpsert(scriptedUpsert bool) *UpdateService
- func (b *UpdateService) Timeout(timeout string) *UpdateService
- func (b *UpdateService) Type(typ string) *UpdateService
- func (b *UpdateService) Upsert(doc interface{}) *UpdateService
- func (b *UpdateService) Version(version int64) *UpdateService
- func (b *UpdateService) VersionType(versionType string) *UpdateService
- type ValueCountAggregation
- func (a ValueCountAggregation) Field(field string) ValueCountAggregation
- func (a ValueCountAggregation) Format(format string) ValueCountAggregation
- func (a ValueCountAggregation) Lang(lang string) ValueCountAggregation
- func (a ValueCountAggregation) Param(name string, value interface{}) ValueCountAggregation
- func (a ValueCountAggregation) Script(script string) ValueCountAggregation
- func (a ValueCountAggregation) Source() interface{}
- func (a ValueCountAggregation) SubAggregation(name string, subAggregation Aggregation) ValueCountAggregation
- type WildcardQuery
- func (q WildcardQuery) Boost(boost float32) WildcardQuery
- func (q WildcardQuery) Name(name string) WildcardQuery
- func (q WildcardQuery) QueryName(queryName string) WildcardQuery
- func (q WildcardQuery) Rewrite(rewrite string) WildcardQuery
- func (q WildcardQuery) Source() interface{}
- func (q WildcardQuery) Wildcard(wildcard string) WildcardQuery
Examples ¶
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") )
Functions ¶
This section is empty.
Types ¶
type Aggregation ¶
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 ¶
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 ¶
func (a *AggregationBucketFilters) UnmarshalJSON(data []byte) error
UnmarshalJSON decodes JSON data and initializes an AggregationBucketFilters structure.
type AggregationBucketHistogramItem ¶
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 ¶
func (a *AggregationBucketHistogramItem) UnmarshalJSON(data []byte) error
UnmarshalJSON decodes JSON data and initializes an AggregationBucketHistogramItem structure.
type AggregationBucketHistogramItems ¶
type AggregationBucketHistogramItems struct { Aggregations Buckets []*AggregationBucketHistogramItem //`json:"buckets"` }
AggregationBucketHistogramItems is a bucket aggregation that is returned with a date histogram aggregation.
func (*AggregationBucketHistogramItems) UnmarshalJSON ¶
func (a *AggregationBucketHistogramItems) UnmarshalJSON(data []byte) error
UnmarshalJSON decodes JSON data and initializes an AggregationBucketHistogramItems structure.
type AggregationBucketKeyItem ¶
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 ¶
func (a *AggregationBucketKeyItem) UnmarshalJSON(data []byte) error
UnmarshalJSON decodes JSON data and initializes an AggregationBucketKeyItem structure.
type AggregationBucketKeyItems ¶
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 ¶
func (a *AggregationBucketKeyItems) UnmarshalJSON(data []byte) error
UnmarshalJSON decodes JSON data and initializes an AggregationBucketKeyItems structure.
type AggregationBucketRangeItem ¶
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 ¶
func (a *AggregationBucketRangeItem) UnmarshalJSON(data []byte) error
UnmarshalJSON decodes JSON data and initializes an AggregationBucketRangeItem structure.
type AggregationBucketRangeItems ¶
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 ¶
func (a *AggregationBucketRangeItems) UnmarshalJSON(data []byte) error
UnmarshalJSON decodes JSON data and initializes an AggregationBucketRangeItems structure.
type AggregationBucketSignificantTerm ¶
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 ¶
func (a *AggregationBucketSignificantTerm) UnmarshalJSON(data []byte) error
UnmarshalJSON decodes JSON data and initializes an AggregationBucketSignificantTerm structure.
type AggregationBucketSignificantTerms ¶
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 ¶
func (a *AggregationBucketSignificantTerms) UnmarshalJSON(data []byte) error
UnmarshalJSON decodes JSON data and initializes an AggregationBucketSignificantTerms structure.
type AggregationExtendedStatsMetric ¶
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 ¶
func (a *AggregationExtendedStatsMetric) UnmarshalJSON(data []byte) error
UnmarshalJSON decodes JSON data and initializes an AggregationExtendedStatsMetric structure.
type AggregationGeoBoundsMetric ¶
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 ¶
func (a *AggregationGeoBoundsMetric) UnmarshalJSON(data []byte) error
UnmarshalJSON decodes JSON data and initializes an AggregationGeoBoundsMetric structure.
type AggregationPercentilesMetric ¶
type AggregationPercentilesMetric struct { Aggregations Values map[string]float64 // `json:"values"` }
AggregationPercentilesMetric is a multi-value metric, returned by a Percentiles aggregation.
func (*AggregationPercentilesMetric) UnmarshalJSON ¶
func (a *AggregationPercentilesMetric) UnmarshalJSON(data []byte) error
UnmarshalJSON decodes JSON data and initializes an AggregationPercentilesMetric structure.
type AggregationSingleBucket ¶
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 ¶
func (a *AggregationSingleBucket) UnmarshalJSON(data []byte) error
UnmarshalJSON decodes JSON data and initializes an AggregationSingleBucket structure.
type AggregationStatsMetric ¶
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 ¶
func (a *AggregationStatsMetric) UnmarshalJSON(data []byte) error
UnmarshalJSON decodes JSON data and initializes an AggregationStatsMetric structure.
type AggregationTopHitsMetric ¶
type AggregationTopHitsMetric struct { Aggregations Hits *SearchHits //`json:"hits"` }
AggregationTopHitsMetric is a metric returned by a TopHits aggregation.
func (*AggregationTopHitsMetric) UnmarshalJSON ¶
func (a *AggregationTopHitsMetric) UnmarshalJSON(data []byte) error
UnmarshalJSON decodes JSON data and initializes an AggregationTopHitsMetric structure.
type AggregationValueMetric ¶
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 ¶
func (a *AggregationValueMetric) UnmarshalJSON(data []byte) error
UnmarshalJSON decodes JSON data and initializes an AggregationValueMetric structure.
type Aggregations ¶
type Aggregations map[string]json.RawMessage
Aggregations is a list of aggregations that are part of a search result.
Example ¶
package main import ( "fmt" "log" "net/http" "github.com/olivere/elastic" ) func main() { // 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) } } } }
Output:
func (Aggregations) Avg ¶
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 ¶
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 ¶
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 ¶
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 ¶
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 ¶
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 ¶
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 ¶
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 ¶
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 ¶
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 ¶
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 ¶
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 ¶
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 ¶
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 ¶
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 ¶
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 ¶
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 ¶
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 ¶
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 ¶
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 ¶
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 ¶
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 ¶
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 ¶
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 ¶
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 ¶
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 ¶
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 ¶
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 ¶
type AliasResult struct {
Acknowledged bool `json:"acknowledged"`
}
type AliasService ¶
type AliasService struct {
// contains filtered or unexported fields
}
func NewAliasService ¶
func NewAliasService(client *Client) *AliasService
func (*AliasService) Add ¶
func (s *AliasService) Add(indexName string, aliasName string) *AliasService
func (*AliasService) AddWithFilter ¶
func (s *AliasService) AddWithFilter(indexName string, aliasName string, filter *Filter) *AliasService
func (*AliasService) Debug ¶
func (s *AliasService) Debug(debug bool) *AliasService
func (*AliasService) Do ¶
func (s *AliasService) Do() (*AliasResult, error)
func (*AliasService) Pretty ¶
func (s *AliasService) Pretty(pretty bool) *AliasService
func (*AliasService) Remove ¶
func (s *AliasService) Remove(indexName string, aliasName string) *AliasService
type AliasesResult ¶
type AliasesResult struct {
Indices map[string]indexResult
}
func (AliasesResult) IndicesByAlias ¶
func (ar AliasesResult) IndicesByAlias(aliasName string) []string
type AliasesService ¶
type AliasesService struct {
// contains filtered or unexported fields
}
func NewAliasesService ¶
func NewAliasesService(client *Client) *AliasesService
func (*AliasesService) Debug ¶
func (s *AliasesService) Debug(debug bool) *AliasesService
func (*AliasesService) Do ¶
func (s *AliasesService) Do() (*AliasesResult, error)
func (*AliasesService) Index ¶
func (s *AliasesService) Index(indexName string) *AliasesService
func (*AliasesService) Indices ¶
func (s *AliasesService) Indices(indexNames ...string) *AliasesService
func (*AliasesService) Pretty ¶
func (s *AliasesService) Pretty(pretty bool) *AliasesService
type AndFilter ¶
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 ¶
func (AndFilter) FilterName ¶
type AvgAggregation ¶
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 ¶
func NewAvgAggregation() AvgAggregation
func (AvgAggregation) Field ¶
func (a AvgAggregation) Field(field string) AvgAggregation
func (AvgAggregation) Format ¶
func (a AvgAggregation) Format(format string) AvgAggregation
func (AvgAggregation) Lang ¶
func (a AvgAggregation) Lang(lang string) AvgAggregation
func (AvgAggregation) Param ¶
func (a AvgAggregation) Param(name string, value interface{}) AvgAggregation
func (AvgAggregation) Script ¶
func (a AvgAggregation) Script(script string) AvgAggregation
func (AvgAggregation) Source ¶
func (a AvgAggregation) Source() interface{}
func (AvgAggregation) SubAggregation ¶
func (a AvgAggregation) SubAggregation(name string, subAggregation Aggregation) AvgAggregation
type BoolFilter ¶
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 (BoolFilter) Cache ¶
func (f BoolFilter) Cache(cache bool) BoolFilter
func (BoolFilter) CacheKey ¶
func (f BoolFilter) CacheKey(cacheKey string) BoolFilter
func (BoolFilter) FilterName ¶
func (f BoolFilter) FilterName(filterName string) BoolFilter
func (BoolFilter) Must ¶
func (f BoolFilter) Must(filters ...Filter) BoolFilter
func (BoolFilter) MustNot ¶
func (f BoolFilter) MustNot(filters ...Filter) BoolFilter
func (BoolFilter) Should ¶
func (f BoolFilter) Should(filters ...Filter) BoolFilter
func (BoolFilter) Source ¶
func (f BoolFilter) Source() interface{}
Creates the query source for the bool query.
type BoolQuery ¶
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 (BoolQuery) AdjustPureNegative ¶
func (BoolQuery) DisableCoord ¶
func (BoolQuery) MinimumShouldMatch ¶
type BoostingQuery ¶
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 (BoostingQuery) Boost ¶
func (q BoostingQuery) Boost(boost float64) BoostingQuery
func (BoostingQuery) Negative ¶
func (q BoostingQuery) Negative(negative Query) BoostingQuery
func (BoostingQuery) NegativeBoost ¶
func (q BoostingQuery) NegativeBoost(negativeBoost float64) BoostingQuery
func (BoostingQuery) Positive ¶
func (q BoostingQuery) Positive(positive Query) BoostingQuery
func (BoostingQuery) Source ¶
func (q BoostingQuery) Source() interface{}
Creates the query source for the boosting query.
type BulkDeleteRequest ¶
type BulkDeleteRequest struct { BulkableRequest // contains filtered or unexported fields }
Bulk request to remove document from Elasticsearch.
func NewBulkDeleteRequest ¶
func NewBulkDeleteRequest() *BulkDeleteRequest
func (*BulkDeleteRequest) Id ¶
func (r *BulkDeleteRequest) Id(id string) *BulkDeleteRequest
func (*BulkDeleteRequest) Index ¶
func (r *BulkDeleteRequest) Index(index string) *BulkDeleteRequest
func (*BulkDeleteRequest) Refresh ¶
func (r *BulkDeleteRequest) Refresh(refresh bool) *BulkDeleteRequest
func (*BulkDeleteRequest) Routing ¶
func (r *BulkDeleteRequest) Routing(routing string) *BulkDeleteRequest
func (*BulkDeleteRequest) Source ¶
func (r *BulkDeleteRequest) Source() ([]string, error)
func (*BulkDeleteRequest) String ¶
func (r *BulkDeleteRequest) String() string
func (*BulkDeleteRequest) Type ¶
func (r *BulkDeleteRequest) Type(typ string) *BulkDeleteRequest
func (*BulkDeleteRequest) Version ¶
func (r *BulkDeleteRequest) Version(version int64) *BulkDeleteRequest
func (*BulkDeleteRequest) VersionType ¶
func (r *BulkDeleteRequest) VersionType(versionType string) *BulkDeleteRequest
VersionType can be "internal" (default), "external", "external_gte", "external_gt", or "force".
type BulkIndexRequest ¶
type BulkIndexRequest struct { BulkableRequest // contains filtered or unexported fields }
Bulk request to add document to Elasticsearch.
func NewBulkIndexRequest ¶
func NewBulkIndexRequest() *BulkIndexRequest
func (*BulkIndexRequest) Doc ¶
func (r *BulkIndexRequest) Doc(doc interface{}) *BulkIndexRequest
func (*BulkIndexRequest) Id ¶
func (r *BulkIndexRequest) Id(id string) *BulkIndexRequest
func (*BulkIndexRequest) Index ¶
func (r *BulkIndexRequest) Index(index string) *BulkIndexRequest
func (*BulkIndexRequest) OpType ¶
func (r *BulkIndexRequest) OpType(opType string) *BulkIndexRequest
func (*BulkIndexRequest) Parent ¶
func (r *BulkIndexRequest) Parent(parent string) *BulkIndexRequest
func (*BulkIndexRequest) Refresh ¶
func (r *BulkIndexRequest) Refresh(refresh bool) *BulkIndexRequest
func (*BulkIndexRequest) Routing ¶
func (r *BulkIndexRequest) Routing(routing string) *BulkIndexRequest
func (*BulkIndexRequest) Source ¶
func (r *BulkIndexRequest) Source() ([]string, error)
func (*BulkIndexRequest) String ¶
func (r *BulkIndexRequest) String() string
func (*BulkIndexRequest) Timestamp ¶
func (r *BulkIndexRequest) Timestamp(timestamp string) *BulkIndexRequest
func (*BulkIndexRequest) Ttl ¶
func (r *BulkIndexRequest) Ttl(ttl int64) *BulkIndexRequest
func (*BulkIndexRequest) Type ¶
func (r *BulkIndexRequest) Type(typ string) *BulkIndexRequest
func (*BulkIndexRequest) Version ¶
func (r *BulkIndexRequest) Version(version int64) *BulkIndexRequest
func (*BulkIndexRequest) VersionType ¶
func (r *BulkIndexRequest) VersionType(versionType string) *BulkIndexRequest
type BulkResponse ¶
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 ¶
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 ¶
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 ¶
func (r *BulkResponse) Created() []*BulkResponseItem
Created returns all bulk request results of "create" actions.
func (*BulkResponse) Deleted ¶
func (r *BulkResponse) Deleted() []*BulkResponseItem
Deleted returns all bulk request results of "delete" actions.
func (*BulkResponse) Failed ¶
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 ¶
func (r *BulkResponse) Indexed() []*BulkResponseItem
Indexed returns all bulk request results of "index" actions.
func (*BulkResponse) Updated ¶
func (r *BulkResponse) Updated() []*BulkResponseItem
Updated returns all bulk request results of "update" actions.
type BulkResponseItem ¶
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 ¶
type BulkService struct {
// contains filtered or unexported fields
}
func NewBulkService ¶
func NewBulkService(client *Client) *BulkService
func (*BulkService) Add ¶
func (s *BulkService) Add(r BulkableRequest) *BulkService
func (*BulkService) Debug ¶
func (s *BulkService) Debug(debug bool) *BulkService
func (*BulkService) DebugOnError ¶
func (s *BulkService) DebugOnError(debug bool) *BulkService
func (*BulkService) Do ¶
func (s *BulkService) Do() (*BulkResponse, error)
func (*BulkService) Index ¶
func (s *BulkService) Index(index string) *BulkService
func (*BulkService) NumberOfActions ¶
func (s *BulkService) NumberOfActions() int
func (*BulkService) Pretty ¶
func (s *BulkService) Pretty(pretty bool) *BulkService
func (*BulkService) Refresh ¶
func (s *BulkService) Refresh(refresh bool) *BulkService
func (*BulkService) Timeout ¶
func (s *BulkService) Timeout(timeout string) *BulkService
func (*BulkService) Type ¶
func (s *BulkService) Type(_type string) *BulkService
type BulkUpdateRequest ¶
type BulkUpdateRequest struct { BulkableRequest // contains filtered or unexported fields }
Bulk request to update document in Elasticsearch.
func NewBulkUpdateRequest ¶
func NewBulkUpdateRequest() *BulkUpdateRequest
func (*BulkUpdateRequest) Doc ¶
func (r *BulkUpdateRequest) Doc(doc interface{}) *BulkUpdateRequest
func (*BulkUpdateRequest) DocAsUpsert ¶
func (r *BulkUpdateRequest) DocAsUpsert(docAsUpsert bool) *BulkUpdateRequest
func (*BulkUpdateRequest) Id ¶
func (r *BulkUpdateRequest) Id(id string) *BulkUpdateRequest
func (*BulkUpdateRequest) Index ¶
func (r *BulkUpdateRequest) Index(index string) *BulkUpdateRequest
func (*BulkUpdateRequest) Parent ¶
func (r *BulkUpdateRequest) Parent(parent string) *BulkUpdateRequest
func (*BulkUpdateRequest) Refresh ¶
func (r *BulkUpdateRequest) Refresh(refresh bool) *BulkUpdateRequest
func (*BulkUpdateRequest) RetryOnConflict ¶
func (r *BulkUpdateRequest) RetryOnConflict(retryOnConflict int) *BulkUpdateRequest
func (*BulkUpdateRequest) Routing ¶
func (r *BulkUpdateRequest) Routing(routing string) *BulkUpdateRequest
func (*BulkUpdateRequest) Script ¶
func (r *BulkUpdateRequest) Script(script string) *BulkUpdateRequest
func (*BulkUpdateRequest) ScriptLang ¶
func (r *BulkUpdateRequest) ScriptLang(scriptLang string) *BulkUpdateRequest
func (*BulkUpdateRequest) ScriptParams ¶
func (r *BulkUpdateRequest) ScriptParams(params map[string]interface{}) *BulkUpdateRequest
func (*BulkUpdateRequest) ScriptType ¶
func (r *BulkUpdateRequest) ScriptType(scriptType string) *BulkUpdateRequest
func (BulkUpdateRequest) Source ¶
func (r BulkUpdateRequest) Source() ([]string, error)
func (*BulkUpdateRequest) String ¶
func (r *BulkUpdateRequest) String() string
func (*BulkUpdateRequest) Timestamp ¶
func (r *BulkUpdateRequest) Timestamp(timestamp string) *BulkUpdateRequest
func (*BulkUpdateRequest) Ttl ¶
func (r *BulkUpdateRequest) Ttl(ttl int64) *BulkUpdateRequest
func (*BulkUpdateRequest) Type ¶
func (r *BulkUpdateRequest) Type(typ string) *BulkUpdateRequest
func (*BulkUpdateRequest) Upsert ¶
func (r *BulkUpdateRequest) Upsert(doc interface{}) *BulkUpdateRequest
func (*BulkUpdateRequest) Version ¶
func (r *BulkUpdateRequest) Version(version int64) *BulkUpdateRequest
func (*BulkUpdateRequest) VersionType ¶
func (r *BulkUpdateRequest) VersionType(versionType string) *BulkUpdateRequest
VersionType can be "internal" (default), "external", "external_gte", "external_gt", or "force".
type BulkableRequest ¶
Generic interface to bulkable requests.
type CandidateGenerator ¶
type CandidateGenerator interface { Type() string Source() interface{} }
type CardinalityAggregation ¶
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 ¶
func NewCardinalityAggregation() CardinalityAggregation
func (CardinalityAggregation) Field ¶
func (a CardinalityAggregation) Field(field string) CardinalityAggregation
func (CardinalityAggregation) Format ¶
func (a CardinalityAggregation) Format(format string) CardinalityAggregation
func (CardinalityAggregation) Lang ¶
func (a CardinalityAggregation) Lang(lang string) CardinalityAggregation
func (CardinalityAggregation) Param ¶
func (a CardinalityAggregation) Param(name string, value interface{}) CardinalityAggregation
func (CardinalityAggregation) PrecisionThreshold ¶
func (a CardinalityAggregation) PrecisionThreshold(threshold int64) CardinalityAggregation
func (CardinalityAggregation) Rehash ¶
func (a CardinalityAggregation) Rehash(rehash bool) CardinalityAggregation
func (CardinalityAggregation) Script ¶
func (a CardinalityAggregation) Script(script string) CardinalityAggregation
func (CardinalityAggregation) Source ¶
func (a CardinalityAggregation) Source() interface{}
func (CardinalityAggregation) SubAggregation ¶
func (a CardinalityAggregation) SubAggregation(name string, subAggregation Aggregation) CardinalityAggregation
type ChildrenAggregation ¶
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 ¶
func NewChildrenAggregation() ChildrenAggregation
func (ChildrenAggregation) Source ¶
func (a ChildrenAggregation) Source() interface{}
func (ChildrenAggregation) SubAggregation ¶
func (a ChildrenAggregation) SubAggregation(name string, subAggregation Aggregation) ChildrenAggregation
func (ChildrenAggregation) Type ¶
func (a ChildrenAggregation) Type(typ string) ChildrenAggregation
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client is an Elasticsearch client. Create one by calling NewClient.
func (*Client) Alias ¶
func (c *Client) Alias() *AliasService
Alias enables the caller to add and/or remove aliases.
func (*Client) Aliases ¶
func (c *Client) Aliases() *AliasesService
Aliases returns aliases by index name(s).
func (*Client) Bulk ¶
func (c *Client) Bulk() *BulkService
Bulk is the entry point to mass insert/update/delete documents.
func (*Client) CloseIndex ¶
func (c *Client) CloseIndex(name string) *CloseIndexService
CloseIndex closes an index.
func (*Client) ClusterHealth ¶
func (c *Client) ClusterHealth() *ClusterHealthService
ClusterHealth retrieves the health of the cluster.
func (*Client) ClusterState ¶
func (c *Client) ClusterState() *ClusterStateService
ClusterState retrieves the state of the cluster.
func (*Client) CreateIndex ¶
func (c *Client) CreateIndex(name string) *CreateIndexService
CreateIndex returns a service to create a new index.
func (*Client) DeleteByQuery ¶
func (c *Client) DeleteByQuery() *DeleteByQueryService
DeleteByQuery deletes documents as found by a query.
func (*Client) DeleteIndex ¶
func (c *Client) DeleteIndex(name string) *DeleteIndexService
DeleteIndex returns a service to delete an index.
func (*Client) DeleteTemplate ¶
func (c *Client) DeleteTemplate() *DeleteTemplateService
DeleteTemplate deletes a search template.
func (*Client) ElasticsearchVersion ¶
ElasticsearchVersion returns the version number of Elasticsearch running on the given URL.
func (*Client) Exists ¶
func (c *Client) Exists() *ExistsService
Exists checks if a document exists.
func (*Client) Flush ¶
func (c *Client) Flush() *FlushService
Flush asks Elasticsearch to free memory from the index and flush data to disk.
func (*Client) GetTemplate ¶
func (c *Client) GetTemplate() *GetTemplateService
GetTemplate gets a search template.
func (*Client) IndexExists ¶
func (c *Client) IndexExists(name string) *IndexExistsService
IndexExists allows to check if an index exists.
func (*Client) MultiGet ¶
func (c *Client) MultiGet() *MultiGetService
MultiGet retrieves multiple documents in one roundtrip.
func (*Client) MultiSearch ¶
func (c *Client) MultiSearch() *MultiSearchService
MultiSearch is the entry point for multi searches.
func (*Client) NewRequest ¶
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 ¶
func (c *Client) OpenIndex(name string) *OpenIndexService
OpenIndex opens an index.
func (*Client) Optimize ¶
func (c *Client) Optimize(indices ...string) *OptimizeService
Optimize asks Elasticsearch to optimize one or more indices.
func (*Client) Ping ¶
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 ¶
func (c *Client) PutTemplate() *PutTemplateService
PutTemplate creates or updates a search template.
func (*Client) Refresh ¶
func (c *Client) Refresh(indices ...string) *RefreshService
Refresh asks Elasticsearch to refresh one or more indices.
func (*Client) Scan ¶
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 ¶
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 ¶
func (c *Client) Search(indices ...string) *SearchService
Search is the entry point for searches.
func (*Client) SetLogger ¶
SetLogger sets the logger for output from Elastic. If you don't set the logger, it will print to os.Stdout.
func (*Client) Suggest ¶
func (c *Client) Suggest(indices ...string) *SuggestService
Suggest returns a service to return suggestions.
type CloseIndexResponse ¶
type CloseIndexResponse struct {
Acknowledged bool `json:"acknowledged"`
}
CloseIndexResponse is the response of CloseIndexService.Do.
type CloseIndexService ¶
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 ¶
func NewCloseIndexService(client *Client) *CloseIndexService
NewCloseIndexService creates a new CloseIndexService.
func (*CloseIndexService) AllowNoIndices ¶
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 ¶
func (s *CloseIndexService) Do() (*CloseIndexResponse, error)
Do executes the operation.
func (*CloseIndexService) ExpandWildcards ¶
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 ¶
func (s *CloseIndexService) IgnoreUnavailable(ignoreUnavailable bool) *CloseIndexService
IgnoreUnavailable indicates whether specified concrete indices should be ignored when unavailable (missing or closed).
func (*CloseIndexService) Index ¶
func (s *CloseIndexService) Index(index string) *CloseIndexService
Index is the name of the index.
func (*CloseIndexService) MasterTimeout ¶
func (s *CloseIndexService) MasterTimeout(masterTimeout string) *CloseIndexService
MasterTimeout specifies the timeout for connection to master.
func (*CloseIndexService) Timeout ¶
func (s *CloseIndexService) Timeout(timeout string) *CloseIndexService
Timeout is an explicit operation timeout.
func (*CloseIndexService) Validate ¶
func (s *CloseIndexService) Validate() error
Validate checks if the operation is valid.
type ClusterHealthResponse ¶
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 ¶
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.
Example ¶
package main import ( "fmt" "net/http" "github.com/olivere/elastic" ) func main() { 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) }
Output:
func NewClusterHealthService ¶
func NewClusterHealthService(client *Client) *ClusterHealthService
NewClusterHealthService creates a new ClusterHealthService.
func (*ClusterHealthService) Do ¶
func (s *ClusterHealthService) Do() (*ClusterHealthResponse, error)
Do executes the operation.
func (*ClusterHealthService) Index ¶
func (s *ClusterHealthService) Index(index string) *ClusterHealthService
Index limits the information returned to a specific index.
func (*ClusterHealthService) Indices ¶
func (s *ClusterHealthService) Indices(indices ...string) *ClusterHealthService
Indices limits the information returned to specific indices.
func (*ClusterHealthService) Level ¶
func (s *ClusterHealthService) Level(level string) *ClusterHealthService
Level specifies the level of detail for returned information.
func (*ClusterHealthService) Local ¶
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 ¶
func (s *ClusterHealthService) MasterTimeout(masterTimeout string) *ClusterHealthService