Documentation ¶
Overview ¶
Package elastic provides an interface to the Elasticsearch server (http://www.elasticsearch.org/).
The first thing you do is to create a Client. If you have Elasticsearch installed and running with its default settings (i.e. available at http://127.0.0.1:9200), all you need to do is:
client, err := elastic.NewClient() if err != nil { // Handle error }
If your Elasticsearch server is running on a different IP and/or port, just provide a URL to NewClient:
// Create a client and connect to http://192.168.2.10:9201 client, err := elastic.NewClient(elastic.SetURL("http://192.168.2.10:9201")) if err != nil { // Handle error }
You can pass many more configuration parameters to NewClient. Review the documentation of NewClient for more information.
If no Elasticsearch server is available, services will fail when creating a new request and will return ErrNoClient.
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. Also see the wiki on Github for more details.
Example ¶
errorlog := log.New(os.Stdout, "APP ", log.LstdFlags) // Obtain a client. You can provide your own HTTP client here. client, err := elastic.NewClient(elastic.SetErrorLog(errorlog)) if err != nil { // Handle error panic(err) } // Trace request and response details like this //client.SetTracer(log.New(os.Stdout, "", 0)) // Ping the Elasticsearch server to get e.g. the version number info, code, err := client.Ping("http://127.0.0.1:9200").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 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) // Each is a convenience function that iterates over hits in a search result. // It makes sure you don't need to check for nil values in the response. // However, it ignores errors in serialization. If you want full control // over iterating the hits, see below. var ttyp Tweet for _, item := range searchResult.Each(reflect.TypeOf(ttyp)) { t := item.(Tweet) fmt.Printf("Tweet by %s: %s\n", t.User, t.Message) } // TotalHits is another convenience function that works even when something goes wrong. fmt.Printf("Found a total of %d tweets\n", searchResult.TotalHits()) // Here's how you iterate through results with full control over each step. 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. script := elastic.NewScript("ctx._source.retweets += num").Param("num", 1) update, err := client.Update().Index("twitter").Type("tweet").Id("1"). Script(script). 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
- func IsNotFound(err interface{}) bool
- func IsTimeout(err interface{}) bool
- func SetDecoder(decoder Decoder) func(*Client) error
- func SetErrorLog(logger *log.Logger) func(*Client) error
- func SetInfoLog(logger *log.Logger) func(*Client) error
- func SetMaxRetries(maxRetries int) func(*Client) error
- func SetSendGetBodyAs(httpMethod string) func(*Client) error
- func SetTraceLog(logger *log.Logger) func(*Client) error
- type Aggregation
- type AggregationBucketFilters
- type AggregationBucketHistogramItem
- type AggregationBucketHistogramItems
- type AggregationBucketKeyItem
- type AggregationBucketKeyItems
- type AggregationBucketKeyedRangeItems
- type AggregationBucketRangeItem
- type AggregationBucketRangeItems
- type AggregationBucketSignificantTerm
- type AggregationBucketSignificantTerms
- type AggregationExtendedStatsMetric
- type AggregationGeoBoundsMetric
- type AggregationPercentilesMetric
- type AggregationPipelineBucketMetricValue
- type AggregationPipelineDerivative
- type AggregationPipelineSimpleValue
- type AggregationSingleBucket
- type AggregationStatsMetric
- type AggregationTopHitsMetric
- type AggregationValueMetric
- type Aggregations
- func (a Aggregations) Avg(name string) (*AggregationValueMetric, bool)
- func (a Aggregations) AvgBucket(name string) (*AggregationPipelineSimpleValue, bool)
- func (a Aggregations) BucketScript(name string) (*AggregationPipelineSimpleValue, bool)
- func (a Aggregations) Cardinality(name string) (*AggregationValueMetric, bool)
- func (a Aggregations) Children(name string) (*AggregationSingleBucket, bool)
- func (a Aggregations) CumulativeSum(name string) (*AggregationPipelineSimpleValue, bool)
- func (a Aggregations) DateHistogram(name string) (*AggregationBucketHistogramItems, bool)
- func (a Aggregations) DateRange(name string) (*AggregationBucketRangeItems, bool)
- func (a Aggregations) Derivative(name string) (*AggregationPipelineDerivative, 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) KeyedRange(name string) (*AggregationBucketKeyedRangeItems, bool)
- func (a Aggregations) Max(name string) (*AggregationValueMetric, bool)
- func (a Aggregations) MaxBucket(name string) (*AggregationPipelineBucketMetricValue, bool)
- func (a Aggregations) Min(name string) (*AggregationValueMetric, bool)
- func (a Aggregations) MinBucket(name string) (*AggregationPipelineBucketMetricValue, bool)
- func (a Aggregations) Missing(name string) (*AggregationSingleBucket, bool)
- func (a Aggregations) MovAvg(name string) (*AggregationPipelineSimpleValue, 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) SerialDiff(name string) (*AggregationPipelineSimpleValue, 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) SumBucket(name string) (*AggregationPipelineSimpleValue, 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 Query) *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
- type AvgAggregation
- func (a *AvgAggregation) Field(field string) *AvgAggregation
- func (a *AvgAggregation) Format(format string) *AvgAggregation
- func (a *AvgAggregation) Meta(metaData map[string]interface{}) *AvgAggregation
- func (a *AvgAggregation) Script(script *Script) *AvgAggregation
- func (a *AvgAggregation) Source() (interface{}, error)
- func (a *AvgAggregation) SubAggregation(name string, subAggregation Aggregation) *AvgAggregation
- type AvgBucketAggregation
- func (a *AvgBucketAggregation) BucketsPath(bucketsPaths ...string) *AvgBucketAggregation
- func (a *AvgBucketAggregation) Format(format string) *AvgBucketAggregation
- func (a *AvgBucketAggregation) GapInsertZeros() *AvgBucketAggregation
- func (a *AvgBucketAggregation) GapPolicy(gapPolicy string) *AvgBucketAggregation
- func (a *AvgBucketAggregation) GapSkip() *AvgBucketAggregation
- func (a *AvgBucketAggregation) Meta(metaData map[string]interface{}) *AvgBucketAggregation
- func (a *AvgBucketAggregation) Source() (interface{}, error)
- func (a *AvgBucketAggregation) SubAggregation(name string, subAggregation Aggregation) *AvgBucketAggregation
- type BoolQuery
- func (q *BoolQuery) AdjustPureNegative(adjustPureNegative bool) *BoolQuery
- func (q *BoolQuery) Boost(boost float64) *BoolQuery
- func (q *BoolQuery) DisableCoord(disableCoord bool) *BoolQuery
- func (q *BoolQuery) Filter(filters ...Query) *BoolQuery
- func (q *BoolQuery) MinimumNumberShouldMatch(minimumNumberShouldMatch int) *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{}, error)
- type BoostingQuery
- func (q *BoostingQuery) Boost(boost float64) *BoostingQuery
- func (q *BoostingQuery) Negative(negative Query) *BoostingQuery
- func (q *BoostingQuery) NegativeBoost(negativeBoost float64) *BoostingQuery
- func (q *BoostingQuery) Positive(positive Query) *BoostingQuery
- func (q *BoostingQuery) Source() (interface{}, error)
- type BucketScriptAggregation
- func (a *BucketScriptAggregation) AddBucketsPath(name, path string) *BucketScriptAggregation
- func (a *BucketScriptAggregation) BucketsPathsMap(bucketsPathsMap map[string]string) *BucketScriptAggregation
- func (a *BucketScriptAggregation) Format(format string) *BucketScriptAggregation
- func (a *BucketScriptAggregation) GapInsertZeros() *BucketScriptAggregation
- func (a *BucketScriptAggregation) GapPolicy(gapPolicy string) *BucketScriptAggregation
- func (a *BucketScriptAggregation) GapSkip() *BucketScriptAggregation
- func (a *BucketScriptAggregation) Meta(metaData map[string]interface{}) *BucketScriptAggregation
- func (a *BucketScriptAggregation) Script(script *Script) *BucketScriptAggregation
- func (a *BucketScriptAggregation) Source() (interface{}, error)
- func (a *BucketScriptAggregation) SubAggregation(name string, subAggregation Aggregation) *BucketScriptAggregation
- type BucketSelectorAggregation
- func (a *BucketSelectorAggregation) AddBucketsPath(name, path string) *BucketSelectorAggregation
- func (a *BucketSelectorAggregation) BucketsPathsMap(bucketsPathsMap map[string]string) *BucketSelectorAggregation
- func (a *BucketSelectorAggregation) Format(format string) *BucketSelectorAggregation
- func (a *BucketSelectorAggregation) GapInsertZeros() *BucketSelectorAggregation
- func (a *BucketSelectorAggregation) GapPolicy(gapPolicy string) *BucketSelectorAggregation
- func (a *BucketSelectorAggregation) GapSkip() *BucketSelectorAggregation
- func (a *BucketSelectorAggregation) Meta(metaData map[string]interface{}) *BucketSelectorAggregation
- func (a *BucketSelectorAggregation) Script(script *Script) *BucketSelectorAggregation
- func (a *BucketSelectorAggregation) Source() (interface{}, error)
- func (a *BucketSelectorAggregation) SubAggregation(name string, subAggregation Aggregation) *BucketSelectorAggregation
- 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) Succeeded() []*BulkResponseItem
- func (r *BulkResponse) Updated() []*BulkResponseItem
- type BulkResponseItem
- type BulkService
- func (s *BulkService) Add(r BulkableRequest) *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 *Script) *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) Meta(metaData map[string]interface{}) *CardinalityAggregation
- func (a *CardinalityAggregation) PrecisionThreshold(threshold int64) *CardinalityAggregation
- func (a *CardinalityAggregation) Rehash(rehash bool) *CardinalityAggregation
- func (a *CardinalityAggregation) Script(script *Script) *CardinalityAggregation
- func (a *CardinalityAggregation) Source() (interface{}, error)
- func (a *CardinalityAggregation) SubAggregation(name string, subAggregation Aggregation) *CardinalityAggregation
- type ChildrenAggregation
- func (a *ChildrenAggregation) Meta(metaData map[string]interface{}) *ChildrenAggregation
- func (a *ChildrenAggregation) Source() (interface{}, error)
- func (a *ChildrenAggregation) SubAggregation(name string, subAggregation Aggregation) *ChildrenAggregation
- func (a *ChildrenAggregation) Type(typ string) *ChildrenAggregation
- type ClearScrollResponse
- type ClearScrollService
- type Client
- func (c *Client) Alias() *AliasService
- func (c *Client) Aliases() *AliasesService
- func (c *Client) Bulk() *BulkService
- func (c *Client) ClearScroll(scrollIds ...string) *ClearScrollService
- func (c *Client) CloseIndex(name string) *IndicesCloseService
- func (c *Client) ClusterHealth() *ClusterHealthService
- func (c *Client) ClusterState() *ClusterStateService
- func (c *Client) ClusterStats() *ClusterStatsService
- func (c *Client) Count(indices ...string) *CountService
- func (c *Client) CreateIndex(name string) *IndicesCreateService
- func (c *Client) Delete() *DeleteService
- func (c *Client) DeleteByQuery(indices ...string) *DeleteByQueryService
- func (c *Client) DeleteIndex(indices ...string) *IndicesDeleteService
- func (c *Client) DeleteTemplate() *DeleteTemplateService
- func (c *Client) ElasticsearchVersion(url string) (string, error)
- func (c *Client) Exists() *ExistsService
- func (c *Client) Explain(index, typ, id string) *ExplainService
- func (c *Client) Flush(indices ...string) *IndicesFlushService
- func (c *Client) Forcemerge(indices ...string) *IndicesForcemergeService
- func (c *Client) Get() *GetService
- func (c *Client) GetMapping() *GetMappingService
- func (c *Client) GetTemplate() *GetTemplateService
- func (c *Client) HasPlugin(name string) (bool, error)
- func (c *Client) Index() *IndexService
- func (c *Client) IndexDeleteTemplate(name string) *IndicesDeleteTemplateService
- func (c *Client) IndexExists(indices ...string) *IndicesExistsService
- func (c *Client) IndexGet(indices ...string) *IndicesGetService
- func (c *Client) IndexGetSettings(indices ...string) *IndicesGetSettingsService
- func (c *Client) IndexGetTemplate(names ...string) *IndicesGetTemplateService
- func (c *Client) IndexNames() ([]string, error)
- func (c *Client) IndexPutTemplate(name string) *IndicesPutTemplateService
- func (c *Client) IndexStats(indices ...string) *IndicesStatsService
- func (c *Client) IndexTemplateExists(name string) *IndicesExistsTemplateService
- func (c *Client) IsRunning() bool
- func (c *Client) Mget() *MgetService
- func (c *Client) MultiGet() *MgetService
- func (c *Client) MultiSearch() *MultiSearchService
- func (c *Client) NodesInfo() *NodesInfoService
- func (c *Client) OpenIndex(name string) *IndicesOpenService
- func (c *Client) Optimize(indices ...string) *OptimizeService
- func (c *Client) Percolate() *PercolateService
- func (c *Client) PerformRequest(method, path string, params url.Values, body interface{}, ignoreErrors ...int) (*Response, error)
- func (c *Client) Ping(url string) *PingService
- func (c *Client) Plugins() ([]string, error)
- func (c *Client) PutMapping() *PutMappingService
- func (c *Client) PutTemplate() *PutTemplateService
- func (c *Client) Refresh(indices ...string) *RefreshService
- func (c *Client) Reindex(sourceIndex, targetIndex string) *Reindexer
- func (c *Client) Scan(indices ...string) *ScanService
- func (c *Client) Scroll(indices ...string) *ScrollService
- func (c *Client) Search(indices ...string) *SearchService
- func (c *Client) Start()
- func (c *Client) Stop()
- func (c *Client) String() string
- func (c *Client) Suggest(indices ...string) *SuggestService
- func (c *Client) TermVectors(index, typ string) *TermvectorsService
- func (c *Client) TypeExists() *IndicesExistsTypeService
- func (c *Client) Update() *UpdateService
- func (c *Client) WaitForGreenStatus(timeout string) error
- func (c *Client) WaitForStatus(status string, timeout string) error
- func (c *Client) WaitForYellowStatus(timeout string) error
- type ClientOptionFunc
- func SetBasicAuth(username, password string) ClientOptionFunc
- func SetGzip(enabled bool) ClientOptionFunc
- func SetHealthcheck(enabled bool) ClientOptionFunc
- func SetHealthcheckInterval(interval time.Duration) ClientOptionFunc
- func SetHealthcheckTimeout(timeout time.Duration) ClientOptionFunc
- func SetHealthcheckTimeoutStartup(timeout time.Duration) ClientOptionFunc
- func SetHttpClient(httpClient *http.Client) ClientOptionFunc
- func SetRequiredPlugins(plugins ...string) ClientOptionFunc
- func SetScheme(scheme string) ClientOptionFunc
- func SetSniff(enabled bool) ClientOptionFunc
- func SetSnifferInterval(interval time.Duration) ClientOptionFunc
- func SetSnifferTimeout(timeout time.Duration) ClientOptionFunc
- func SetSnifferTimeoutStartup(timeout time.Duration) ClientOptionFunc
- func SetURL(urls ...string) ClientOptionFunc
- type ClusterHealthResponse
- type ClusterHealthService
- func (s *ClusterHealthService) Do() (*ClusterHealthResponse, error)
- func (s *ClusterHealthService) Index(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) Pretty(pretty bool) *ClusterHealthService
- func (s *ClusterHealthService) Timeout(timeout string) *ClusterHealthService
- func (s *ClusterHealthService) Validate() error
- func (s *ClusterHealthService) WaitForActiveShards(waitForActiveShards int) *ClusterHealthService
- func (s *ClusterHealthService) WaitForGreenStatus() *ClusterHealthService
- func (s *ClusterHealthService) WaitForNodes(waitForNodes string) *ClusterHealthService
- func (s *ClusterHealthService) WaitForRelocatingShards(waitForRelocatingShards int) *ClusterHealthService
- func (s *ClusterHealthService) WaitForStatus(waitForStatus string) *ClusterHealthService
- func (s *ClusterHealthService) WaitForYellowStatus() *ClusterHealthService
- type ClusterIndexHealth
- type ClusterShardHealth
- type ClusterStateResponse
- type ClusterStateService
- func (s *ClusterStateService) AllowNoIndices(allowNoIndices bool) *ClusterStateService
- func (s *ClusterStateService) Do() (*ClusterStateResponse, error)
- func (s *ClusterStateService) ExpandWildcards(expandWildcards string) *ClusterStateService
- func (s *ClusterStateService) FlatSettings(flatSettings bool) *ClusterStateService
- func (s *ClusterStateService) IgnoreUnavailable(ignoreUnavailable bool) *ClusterStateService
- func (s *ClusterStateService) Index(indices ...string) *ClusterStateService
- func (s *ClusterStateService) Local(local bool) *ClusterStateService
- func (s *ClusterStateService) MasterTimeout(masterTimeout string) *ClusterStateService
- func (s *ClusterStateService) Metric(metrics ...string) *ClusterStateService
- func (s *ClusterStateService) Pretty(pretty bool) *ClusterStateService
- func (s *ClusterStateService) Validate() error
- type ClusterStatsIndices
- type ClusterStatsIndicesCompletion
- type ClusterStatsIndicesDocs
- type ClusterStatsIndicesFieldData
- type ClusterStatsIndicesFilterCache
- type ClusterStatsIndicesIdCache
- type ClusterStatsIndicesPercolate
- type ClusterStatsIndicesSegments
- type ClusterStatsIndicesShards
- type ClusterStatsIndicesShardsIndex
- type ClusterStatsIndicesShardsIndexFloat64MinMax
- type ClusterStatsIndicesShardsIndexIntMinMax
- type ClusterStatsIndicesStore
- type ClusterStatsNodes
- type ClusterStatsNodesCounts
- type ClusterStatsNodesFsStats
- type ClusterStatsNodesJvmStats
- type ClusterStatsNodesJvmStatsMem
- type ClusterStatsNodesJvmStatsVersion
- type ClusterStatsNodesOsStats
- type ClusterStatsNodesOsStatsCPU
- type ClusterStatsNodesOsStatsMem
- type ClusterStatsNodesPlugin
- type ClusterStatsNodesProcessStats
- type ClusterStatsNodesProcessStatsCPU
- type ClusterStatsNodesProcessStatsOpenFileDescriptors
- type ClusterStatsResponse
- type ClusterStatsService
- func (s *ClusterStatsService) Do() (*ClusterStatsResponse, error)
- func (s *ClusterStatsService) FlatSettings(flatSettings bool) *ClusterStatsService
- func (s *ClusterStatsService) Human(human bool) *ClusterStatsService
- func (s *ClusterStatsService) NodeId(nodeId []string) *ClusterStatsService
- func (s *ClusterStatsService) Pretty(pretty bool) *ClusterStatsService
- func (s *ClusterStatsService) Validate() error
- type CommonTermsQuery
- func (q *CommonTermsQuery) Analyzer(analyzer string) *CommonTermsQuery
- func (q *CommonTermsQuery) Boost(boost float64) *CommonTermsQuery
- func (q *CommonTermsQuery) CutoffFrequency(f float64) *CommonTermsQuery
- func (q *CommonTermsQuery) DisableCoord(disableCoord bool) *CommonTermsQuery
- func (q *CommonTermsQuery) HighFreq(f float64) *CommonTermsQuery
- func (q *CommonTermsQuery) HighFreqMinimumShouldMatch(minShouldMatch string) *CommonTermsQuery
- func (q *CommonTermsQuery) HighFreqOperator(op string) *CommonTermsQuery
- func (q *CommonTermsQuery) LowFreq(f float64) *CommonTermsQuery
- func (q *CommonTermsQuery) LowFreqMinimumShouldMatch(minShouldMatch string) *CommonTermsQuery
- func (q *CommonTermsQuery) LowFreqOperator(op string) *CommonTermsQuery
- func (q *CommonTermsQuery) QueryName(queryName string) *CommonTermsQuery
- func (q *CommonTermsQuery) Source() (interface{}, error)
- 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{}, error)
- func (q *CompletionSuggester) Text(text string) *CompletionSuggester
- type ConstantScoreQuery
- type CountResponse
- type CountService
- func (s *CountService) AllowNoIndices(allowNoIndices bool) *CountService
- func (s *CountService) AnalyzeWildcard(analyzeWildcard bool) *CountService
- func (s *CountService) Analyzer(analyzer string) *CountService
- func (s *CountService) BodyJson(body interface{}) *CountService
- func (s *CountService) BodyString(body string) *CountService
- func (s *CountService) DefaultOperator(defaultOperator string) *CountService
- func (s *CountService) Df(df string) *CountService
- func (s *CountService) Do() (int64, error)
- func (s *CountService) ExpandWildcards(expandWildcards string) *CountService
- func (s *CountService) IgnoreUnavailable(ignoreUnavailable bool) *CountService
- func (s *CountService) Index(index ...string) *CountService
- func (s *CountService) Lenient(lenient bool) *CountService
- func (s *CountService) LowercaseExpandedTerms(lowercaseExpandedTerms bool) *CountService
- func (s *CountService) MinScore(minScore interface{}) *CountService
- func (s *CountService) Preference(preference string) *CountService
- func (s *CountService) Pretty(pretty bool) *CountService
- func (s *CountService) Q(q string) *CountService
- func (s *CountService) Query(query Query) *CountService
- func (s *CountService) Routing(routing string) *CountService
- func (s *CountService) Type(typ ...string) *CountService
- func (s *CountService) Validate() error
- type CumulativeSumAggregation
- func (a *CumulativeSumAggregation) BucketsPath(bucketsPaths ...string) *CumulativeSumAggregation
- func (a *CumulativeSumAggregation) Format(format string) *CumulativeSumAggregation
- func (a *CumulativeSumAggregation) Meta(metaData map[string]interface{}) *CumulativeSumAggregation
- func (a *CumulativeSumAggregation) Source() (interface{}, error)
- func (a *CumulativeSumAggregation) SubAggregation(name string, subAggregation Aggregation) *CumulativeSumAggregation
- type DateHistogramAggregation
- func (a *DateHistogramAggregation) ExtendedBoundsMax(max interface{}) *DateHistogramAggregation
- func (a *DateHistogramAggregation) ExtendedBoundsMin(min interface{}) *DateHistogramAggregation
- func (a *DateHistogramAggregation) Factor(factor float64) *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) Meta(metaData map[string]interface{}) *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) 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 *Script) *DateHistogramAggregation
- func (a *DateHistogramAggregation) Source() (interface{}, error)
- func (a *DateHistogramAggregation) SubAggregation(name string, subAggregation Aggregation) *DateHistogramAggregation
- 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) Lt(to interface{}) *DateRangeAggregation
- func (a *DateRangeAggregation) LtWithKey(key string, to interface{}) *DateRangeAggregation
- func (a *DateRangeAggregation) Meta(metaData map[string]interface{}) *DateRangeAggregation
- func (a *DateRangeAggregation) Script(script *Script) *DateRangeAggregation
- func (a *DateRangeAggregation) Source() (interface{}, error)
- func (a *DateRangeAggregation) SubAggregation(name string, subAggregation Aggregation) *DateRangeAggregation
- func (a *DateRangeAggregation) Unmapped(unmapped bool) *DateRangeAggregation
- type DateRangeAggregationEntry
- type Decoder
- type DefaultDecoder
- 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) 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(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(types ...string) *DeleteByQueryService
- type DeleteResponse
- type DeleteService
- func (s *DeleteService) Consistency(consistency string) *DeleteService
- func (s *DeleteService) Do() (*DeleteResponse, 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) Replication(replication string) *DeleteService
- func (s *DeleteService) Routing(routing string) *DeleteService
- func (s *DeleteService) Timeout(timeout string) *DeleteService
- func (s *DeleteService) Type(typ string) *DeleteService
- func (s *DeleteService) Validate() error
- func (s *DeleteService) Version(version interface{}) *DeleteService
- func (s *DeleteService) VersionType(versionType string) *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 DerivativeAggregation
- func (a *DerivativeAggregation) BucketsPath(bucketsPaths ...string) *DerivativeAggregation
- func (a *DerivativeAggregation) Format(format string) *DerivativeAggregation
- func (a *DerivativeAggregation) GapInsertZeros() *DerivativeAggregation
- func (a *DerivativeAggregation) GapPolicy(gapPolicy string) *DerivativeAggregation
- func (a *DerivativeAggregation) GapSkip() *DerivativeAggregation
- func (a *DerivativeAggregation) Meta(metaData map[string]interface{}) *DerivativeAggregation
- func (a *DerivativeAggregation) Source() (interface{}, error)
- func (a *DerivativeAggregation) SubAggregation(name string, subAggregation Aggregation) *DerivativeAggregation
- func (a *DerivativeAggregation) Unit(unit string) *DerivativeAggregation
- 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{}, error)
- func (g *DirectCandidateGenerator) StringDistance(stringDistance string) *DirectCandidateGenerator
- func (g *DirectCandidateGenerator) SuggestMode(suggestMode string) *DirectCandidateGenerator
- func (g *DirectCandidateGenerator) Type() string
- type DisMaxQuery
- type EWMAMovAvgModel
- type Error
- type ErrorDetails
- type ExistsQuery
- type ExistsService
- func (s *ExistsService) Do() (bool, error)
- func (s *ExistsService) Id(id string) *ExistsService
- func (s *ExistsService) Index(index string) *ExistsService
- func (s *ExistsService) Parent(parent string) *ExistsService
- func (s *ExistsService) Preference(preference string) *ExistsService
- func (s *ExistsService) Pretty(pretty bool) *ExistsService
- func (s *ExistsService) Realtime(realtime bool) *ExistsService
- func (s *ExistsService) Refresh(refresh bool) *ExistsService
- func (s *ExistsService) Routing(routing string) *ExistsService
- func (s *ExistsService) Type(typ string) *ExistsService
- func (s *ExistsService) Validate() error
- type ExplainResponse
- type ExplainService
- func (s *ExplainService) AnalyzeWildcard(analyzeWildcard bool) *ExplainService
- func (s *ExplainService) Analyzer(analyzer string) *ExplainService
- func (s *ExplainService) BodyJson(body interface{}) *ExplainService
- func (s *ExplainService) BodyString(body string) *ExplainService
- func (s *ExplainService) DefaultOperator(defaultOperator string) *ExplainService
- func (s *ExplainService) Df(df string) *ExplainService
- func (s *ExplainService) Do() (*ExplainResponse, error)
- func (s *ExplainService) Fields(fields ...string) *ExplainService
- func (s *ExplainService) Id(id string) *ExplainService
- func (s *ExplainService) Index(index string) *ExplainService
- func (s *ExplainService) Lenient(lenient bool) *ExplainService
- func (s *ExplainService) LowercaseExpandedTerms(lowercaseExpandedTerms bool) *ExplainService
- func (s *ExplainService) Parent(parent string) *ExplainService
- func (s *ExplainService) Preference(preference string) *ExplainService
- func (s *ExplainService) Pretty(pretty bool) *ExplainService
- func (s *ExplainService) Q(q string) *ExplainService
- func (s *ExplainService) Query(query Query) *ExplainService
- func (s *ExplainService) Routing(routing string) *ExplainService
- func (s *ExplainService) Source(source string) *ExplainService
- func (s *ExplainService) Type(typ string) *ExplainService
- func (s *ExplainService) Validate() error
- func (s *ExplainService) XSource(xSource ...string) *ExplainService
- func (s *ExplainService) XSourceExclude(xSourceExclude ...string) *ExplainService
- func (s *ExplainService) XSourceInclude(xSourceInclude ...string) *ExplainService
- type ExponentialDecayFunction
- func (fn *ExponentialDecayFunction) Decay(decay float64) *ExponentialDecayFunction
- func (fn *ExponentialDecayFunction) FieldName(fieldName string) *ExponentialDecayFunction
- func (fn *ExponentialDecayFunction) GetWeight() *float64
- func (fn *ExponentialDecayFunction) MultiValueMode(mode 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{}, error)
- func (fn *ExponentialDecayFunction) Weight(weight float64) *ExponentialDecayFunction
- type ExtendedStatsAggregation
- func (a *ExtendedStatsAggregation) Field(field string) *ExtendedStatsAggregation
- func (a *ExtendedStatsAggregation) Format(format string) *ExtendedStatsAggregation
- func (a *ExtendedStatsAggregation) Meta(metaData map[string]interface{}) *ExtendedStatsAggregation
- func (a *ExtendedStatsAggregation) Script(script *Script) *ExtendedStatsAggregation
- func (a *ExtendedStatsAggregation) Source() (interface{}, error)
- func (a *ExtendedStatsAggregation) SubAggregation(name string, subAggregation Aggregation) *ExtendedStatsAggregation
- 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{}, error)
- 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 Query) 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{}, error)
- func (s FieldSort) UnmappedType(typ string) FieldSort
- type FieldStatistics
- type FieldValueFactorFunction
- func (fn *FieldValueFactorFunction) Factor(factor float64) *FieldValueFactorFunction
- func (fn *FieldValueFactorFunction) Field(field string) *FieldValueFactorFunction
- func (fn *FieldValueFactorFunction) GetWeight() *float64
- func (fn *FieldValueFactorFunction) Missing(missing float64) *FieldValueFactorFunction
- func (fn *FieldValueFactorFunction) Modifier(modifier string) *FieldValueFactorFunction
- func (fn *FieldValueFactorFunction) Name() string
- func (fn *FieldValueFactorFunction) Source() (interface{}, error)
- func (fn *FieldValueFactorFunction) Weight(weight float64) *FieldValueFactorFunction
- type FilterAggregation
- func (a *FilterAggregation) Filter(filter Query) *FilterAggregation
- func (a *FilterAggregation) Meta(metaData map[string]interface{}) *FilterAggregation
- func (a *FilterAggregation) Source() (interface{}, error)
- func (a *FilterAggregation) SubAggregation(name string, subAggregation Aggregation) *FilterAggregation
- type FiltersAggregation
- func (a *FiltersAggregation) Filter(filter Query) *FiltersAggregation
- func (a *FiltersAggregation) Filters(filters ...Query) *FiltersAggregation
- func (a *FiltersAggregation) Meta(metaData map[string]interface{}) *FiltersAggregation
- func (a *FiltersAggregation) Source() (interface{}, error)
- func (a *FiltersAggregation) SubAggregation(name string, subAggregation Aggregation) *FiltersAggregation
- type FunctionScoreQuery
- func (q *FunctionScoreQuery) Add(filter Query, scoreFunc ScoreFunction) *FunctionScoreQuery
- func (q *FunctionScoreQuery) AddScoreFunc(scoreFunc ScoreFunction) *FunctionScoreQuery
- func (q *FunctionScoreQuery) Boost(boost float64) *FunctionScoreQuery
- func (q *FunctionScoreQuery) BoostMode(boostMode string) *FunctionScoreQuery
- func (q *FunctionScoreQuery) Filter(filter Query) *FunctionScoreQuery
- func (q *FunctionScoreQuery) MaxBoost(maxBoost float64) *FunctionScoreQuery
- func (q *FunctionScoreQuery) MinScore(minScore float64) *FunctionScoreQuery
- func (q *FunctionScoreQuery) Query(query Query) *FunctionScoreQuery
- func (q *FunctionScoreQuery) ScoreMode(scoreMode string) *FunctionScoreQuery
- func (q *FunctionScoreQuery) Source() (interface{}, error)
- type Fuzziness
- 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{}, error)
- func (q *FuzzyCompletionSuggester) Text(text string) *FuzzyCompletionSuggester
- func (q *FuzzyCompletionSuggester) UnicodeAware(unicodeAware bool) *FuzzyCompletionSuggester
- type FuzzyQuery
- func (q *FuzzyQuery) Boost(boost float64) *FuzzyQuery
- func (q *FuzzyQuery) Fuzziness(fuzziness interface{}) *FuzzyQuery
- func (q *FuzzyQuery) MaxExpansions(maxExpansions int) *FuzzyQuery
- func (q *FuzzyQuery) PrefixLength(prefixLength int) *FuzzyQuery
- func (q *FuzzyQuery) QueryName(queryName string) *FuzzyQuery
- func (q *FuzzyQuery) Rewrite(rewrite string) *FuzzyQuery
- func (q *FuzzyQuery) Source() (interface{}, error)
- func (q *FuzzyQuery) Transpositions(transpositions bool) *FuzzyQuery
- type GaussDecayFunction
- func (fn *GaussDecayFunction) Decay(decay float64) *GaussDecayFunction
- func (fn *GaussDecayFunction) FieldName(fieldName string) *GaussDecayFunction
- func (fn *GaussDecayFunction) GetWeight() *float64
- func (fn *GaussDecayFunction) MultiValueMode(mode 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{}, error)
- func (fn *GaussDecayFunction) Weight(weight float64) *GaussDecayFunction
- type GeoBoundingBoxQuery
- func (q *GeoBoundingBoxQuery) BottomLeft(bottom, left float64) *GeoBoundingBoxQuery
- func (q *GeoBoundingBoxQuery) BottomLeftFromGeoPoint(point *GeoPoint) *GeoBoundingBoxQuery
- func (q *GeoBoundingBoxQuery) BottomRight(bottom, right float64) *GeoBoundingBoxQuery
- func (q *GeoBoundingBoxQuery) BottomRightFromGeoPoint(point *GeoPoint) *GeoBoundingBoxQuery
- func (q *GeoBoundingBoxQuery) QueryName(queryName string) *GeoBoundingBoxQuery
- func (q *GeoBoundingBoxQuery) Source() (interface{}, error)
- func (q *GeoBoundingBoxQuery) TopLeft(top, left float64) *GeoBoundingBoxQuery
- func (q *GeoBoundingBoxQuery) TopLeftFromGeoPoint(point *GeoPoint) *GeoBoundingBoxQuery
- func (q *GeoBoundingBoxQuery) TopRight(top, right float64) *GeoBoundingBoxQuery
- func (q *GeoBoundingBoxQuery) TopRightFromGeoPoint(point *GeoPoint) *GeoBoundingBoxQuery
- func (q *GeoBoundingBoxQuery) Type(typ string) *GeoBoundingBoxQuery
- type GeoBoundsAggregation
- func (a *GeoBoundsAggregation) Field(field string) *GeoBoundsAggregation
- func (a *GeoBoundsAggregation) Meta(metaData map[string]interface{}) *GeoBoundsAggregation
- func (a *GeoBoundsAggregation) Script(script *Script) *GeoBoundsAggregation
- func (a *GeoBoundsAggregation) Source() (interface{}, error)
- func (a *GeoBoundsAggregation) SubAggregation(name string, subAggregation Aggregation) *GeoBoundsAggregation
- 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) Meta(metaData map[string]interface{}) *GeoDistanceAggregation
- func (a *GeoDistanceAggregation) Point(latLon string) *GeoDistanceAggregation
- func (a *GeoDistanceAggregation) Source() (interface{}, error)
- func (a *GeoDistanceAggregation) SubAggregation(name string, subAggregation Aggregation) *GeoDistanceAggregation
- func (a *GeoDistanceAggregation) Unit(unit string) *GeoDistanceAggregation
- type GeoDistanceQuery
- func (q *GeoDistanceQuery) Distance(distance string) *GeoDistanceQuery
- func (q *GeoDistanceQuery) DistanceType(distanceType string) *GeoDistanceQuery
- func (q *GeoDistanceQuery) GeoHash(geohash string) *GeoDistanceQuery
- func (q *GeoDistanceQuery) GeoPoint(point *GeoPoint) *GeoDistanceQuery
- func (q *GeoDistanceQuery) Lat(lat float64) *GeoDistanceQuery
- func (q *GeoDistanceQuery) Lon(lon float64) *GeoDistanceQuery
- func (q *GeoDistanceQuery) OptimizeBbox(optimizeBbox string) *GeoDistanceQuery
- func (q *GeoDistanceQuery) Point(lat, lon float64) *GeoDistanceQuery
- func (q *GeoDistanceQuery) QueryName(queryName string) *GeoDistanceQuery
- func (q *GeoDistanceQuery) Source() (interface{}, error)
- 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 Query) 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{}, error)
- func (s GeoDistanceSort) Unit(unit string) GeoDistanceSort
- type GeoPoint
- type GeoPolygonQuery
- type GetMappingService
- func (s *GetMappingService) AllowNoIndices(allowNoIndices bool) *GetMappingService
- func (s *GetMappingService) Do() (map[string]interface{}, error)
- func (s *GetMappingService) ExpandWildcards(expandWildcards string) *GetMappingService
- func (s *GetMappingService) IgnoreUnavailable(ignoreUnavailable bool) *GetMappingService
- func (s *GetMappingService) Index(indices ...string) *GetMappingService
- func (s *GetMappingService) Local(local bool) *GetMappingService
- func (s *GetMappingService) Pretty(pretty bool) *GetMappingService
- func (s *GetMappingService) Type(types ...string) *GetMappingService
- func (s *GetMappingService) Validate() error
- type GetResult
- type GetService
- func (s *GetService) Do() (*GetResult, error)
- func (s *GetService) FetchSource(fetchSource bool) *GetService
- func (s *GetService) FetchSourceContext(fetchSourceContext *FetchSourceContext) *GetService
- func (s *GetService) Fields(fields ...string) *GetService
- func (s *GetService) Id(id string) *GetService
- func (s *GetService) IgnoreErrorsOnGeneratedFields(ignore bool) *GetService
- func (s *GetService) Index(index string) *GetService
- func (s *GetService) Parent(parent string) *GetService
- func (s *GetService) Preference(preference string) *GetService
- func (s *GetService) Pretty(pretty bool) *GetService
- func (s *GetService) Realtime(realtime bool) *GetService
- func (s *GetService) Refresh(refresh bool) *GetService
- func (s *GetService) Routing(routing string) *GetService
- func (s *GetService) Type(typ string) *GetService
- func (s *GetService) Validate() error
- func (s *GetService) Version(version interface{}) *GetService
- func (s *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 HasChildQuery
- func (q *HasChildQuery) Boost(boost float64) *HasChildQuery
- func (q *HasChildQuery) InnerHit(innerHit *InnerHit) *HasChildQuery
- func (q *HasChildQuery) MaxChildren(maxChildren int) *HasChildQuery
- func (q *HasChildQuery) MinChildren(minChildren int) *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{}, error)
- type HasParentQuery
- func (q *HasParentQuery) Boost(boost float64) *HasParentQuery
- func (q *HasParentQuery) InnerHit(innerHit *InnerHit) *HasParentQuery
- func (q *HasParentQuery) QueryName(queryName string) *HasParentQuery
- func (q *HasParentQuery) ScoreType(scoreType string) *HasParentQuery
- func (q *HasParentQuery) Source() (interface{}, error)
- 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{}, error)
- 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{}, error)
- type HistogramAggregation
- func (a *HistogramAggregation) ExtendedBounds(min, max int64) *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) Meta(metaData map[string]interface{}) *HistogramAggregation
- func (a *HistogramAggregation) MinDocCount(minDocCount int64) *HistogramAggregation
- func (a *HistogramAggregation) Offset(offset 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) Script(script *Script) *HistogramAggregation
- func (a *HistogramAggregation) Source() (interface{}, error)
- func (a *HistogramAggregation) SubAggregation(name string, subAggregation Aggregation) *HistogramAggregation
- type HoltLinearMovAvgModel
- type HoltWintersMovAvgModel
- func (m *HoltWintersMovAvgModel) Alpha(alpha float64) *HoltWintersMovAvgModel
- func (m *HoltWintersMovAvgModel) Beta(beta float64) *HoltWintersMovAvgModel
- func (m *HoltWintersMovAvgModel) Gamma(gamma float64) *HoltWintersMovAvgModel
- func (m *HoltWintersMovAvgModel) Name() string
- func (m *HoltWintersMovAvgModel) Pad(pad bool) *HoltWintersMovAvgModel
- func (m *HoltWintersMovAvgModel) Period(period int) *HoltWintersMovAvgModel
- func (m *HoltWintersMovAvgModel) SeasonalityType(typ string) *HoltWintersMovAvgModel
- func (m *HoltWintersMovAvgModel) Settings() map[string]interface{}
- type IdsQuery
- type IndexDeleteByQueryResult
- type IndexResponse
- type IndexService
- func (s *IndexService) BodyJson(body interface{}) *IndexService
- func (s *IndexService) BodyString(body string) *IndexService
- func (s *IndexService) Consistency(consistency string) *IndexService
- func (s *IndexService) Do() (*IndexResponse, error)
- func (s *IndexService) Id(id string) *IndexService
- func (s *IndexService) Index(index string) *IndexService
- func (s *IndexService) OpType(opType string) *IndexService
- func (s *IndexService) Parent(parent string) *IndexService
- func (s *IndexService) Pretty(pretty bool) *IndexService
- func (s *IndexService) Refresh(refresh bool) *IndexService
- func (s *IndexService) Replication(replication string) *IndexService
- func (s *IndexService) Routing(routing string) *IndexService
- func (s *IndexService) TTL(ttl string) *IndexService
- func (s *IndexService) Timeout(timeout string) *IndexService
- func (s *IndexService) Timestamp(timestamp string) *IndexService
- func (s *IndexService) Ttl(ttl string) *IndexService
- func (s *IndexService) Type(typ string) *IndexService
- func (s *IndexService) Validate() error
- func (s *IndexService) Version(version interface{}) *IndexService
- func (s *IndexService) VersionType(versionType string) *IndexService
- type IndexStats
- type IndexStatsCompletion
- type IndexStatsDetails
- type IndexStatsDocs
- type IndexStatsFielddata
- type IndexStatsFilterCache
- type IndexStatsFlush
- type IndexStatsGet
- type IndexStatsIdCache
- type IndexStatsIndexing
- type IndexStatsMerges
- type IndexStatsPercolate
- type IndexStatsQueryCache
- type IndexStatsRefresh
- type IndexStatsSearch
- type IndexStatsSegments
- type IndexStatsStore
- type IndexStatsSuggest
- type IndexStatsTranslog
- type IndexStatsWarmer
- type IndicesCloseResponse
- type IndicesCloseService
- func (s *IndicesCloseService) AllowNoIndices(allowNoIndices bool) *IndicesCloseService
- func (s *IndicesCloseService) Do() (*IndicesCloseResponse, error)
- func (s *IndicesCloseService) ExpandWildcards(expandWildcards string) *IndicesCloseService
- func (s *IndicesCloseService) IgnoreUnavailable(ignoreUnavailable bool) *IndicesCloseService
- func (s *IndicesCloseService) Index(index string) *IndicesCloseService
- func (s *IndicesCloseService) MasterTimeout(masterTimeout string) *IndicesCloseService
- func (s *IndicesCloseService) Pretty(pretty bool) *IndicesCloseService
- func (s *IndicesCloseService) Timeout(timeout string) *IndicesCloseService
- func (s *IndicesCloseService) Validate() error
- type IndicesCreateResult
- type IndicesCreateService
- func (b *IndicesCreateService) Body(body string) *IndicesCreateService
- func (b *IndicesCreateService) BodyJson(body interface{}) *IndicesCreateService
- func (b *IndicesCreateService) BodyString(body string) *IndicesCreateService
- func (b *IndicesCreateService) Do() (*IndicesCreateResult, error)
- func (b *IndicesCreateService) Index(index string) *IndicesCreateService
- func (s *IndicesCreateService) MasterTimeout(masterTimeout string) *IndicesCreateService
- func (b *IndicesCreateService) Pretty(pretty bool) *IndicesCreateService
- func (s *IndicesCreateService) Timeout(timeout string) *IndicesCreateService
- type IndicesDeleteResponse
- type IndicesDeleteService
- func (s *IndicesDeleteService) Do() (*IndicesDeleteResponse, error)
- func (s *IndicesDeleteService) Index(index []string) *IndicesDeleteService
- func (s *IndicesDeleteService) MasterTimeout(masterTimeout string) *IndicesDeleteService
- func (s *IndicesDeleteService) Pretty(pretty bool) *IndicesDeleteService
- func (s *IndicesDeleteService) Timeout(timeout string) *IndicesDeleteService
- func (s *IndicesDeleteService) Validate() error
- type IndicesDeleteTemplateResponse
- type IndicesDeleteTemplateService
- func (s *IndicesDeleteTemplateService) Do() (*IndicesDeleteTemplateResponse, error)
- func (s *IndicesDeleteTemplateService) MasterTimeout(masterTimeout string) *IndicesDeleteTemplateService
- func (s *IndicesDeleteTemplateService) Name(name string) *IndicesDeleteTemplateService
- func (s *IndicesDeleteTemplateService) Pretty(pretty bool) *IndicesDeleteTemplateService
- func (s *IndicesDeleteTemplateService) Timeout(timeout string) *IndicesDeleteTemplateService
- func (s *IndicesDeleteTemplateService) Validate() error
- type IndicesExistsService
- func (s *IndicesExistsService) AllowNoIndices(allowNoIndices bool) *IndicesExistsService
- func (s *IndicesExistsService) Do() (bool, error)
- func (s *IndicesExistsService) ExpandWildcards(expandWildcards string) *IndicesExistsService
- func (s *IndicesExistsService) IgnoreUnavailable(ignoreUnavailable bool) *IndicesExistsService
- func (s *IndicesExistsService) Index(index []string) *IndicesExistsService
- func (s *IndicesExistsService) Local(local bool) *IndicesExistsService
- func (s *IndicesExistsService) Pretty(pretty bool) *IndicesExistsService
- func (s *IndicesExistsService) Validate() error
- type IndicesExistsTemplateService
- func (s *IndicesExistsTemplateService) Do() (bool, error)
- func (s *IndicesExistsTemplateService) Local(local bool) *IndicesExistsTemplateService
- func (s *IndicesExistsTemplateService) Name(name string) *IndicesExistsTemplateService
- func (s *IndicesExistsTemplateService) Pretty(pretty bool) *IndicesExistsTemplateService
- func (s *IndicesExistsTemplateService) Validate() error
- type IndicesExistsTypeService
- func (s *IndicesExistsTypeService) AllowNoIndices(allowNoIndices bool) *IndicesExistsTypeService
- func (s *IndicesExistsTypeService) Do() (bool, error)
- func (s *IndicesExistsTypeService) ExpandWildcards(expandWildcards string) *IndicesExistsTypeService
- func (s *IndicesExistsTypeService) IgnoreUnavailable(ignoreUnavailable bool) *IndicesExistsTypeService
- func (s *IndicesExistsTypeService) Index(indices ...string) *IndicesExistsTypeService
- func (s *IndicesExistsTypeService) Local(local bool) *IndicesExistsTypeService
- func (s *IndicesExistsTypeService) Pretty(pretty bool) *IndicesExistsTypeService
- func (s *IndicesExistsTypeService) Type(types ...string) *IndicesExistsTypeService
- func (s *IndicesExistsTypeService) Validate() error
- type IndicesFlushResponse
- type IndicesFlushService
- func (s *IndicesFlushService) AllowNoIndices(allowNoIndices bool) *IndicesFlushService
- func (s *IndicesFlushService) Do() (*IndicesFlushResponse, error)
- func (s *IndicesFlushService) ExpandWildcards(expandWildcards string) *IndicesFlushService
- func (s *IndicesFlushService) Force(force bool) *IndicesFlushService
- func (s *IndicesFlushService) IgnoreUnavailable(ignoreUnavailable bool) *IndicesFlushService
- func (s *IndicesFlushService) Index(indices ...string) *IndicesFlushService
- func (s *IndicesFlushService) Pretty(pretty bool) *IndicesFlushService
- func (s *IndicesFlushService) Validate() error
- func (s *IndicesFlushService) WaitIfOngoing(waitIfOngoing bool) *IndicesFlushService
- type IndicesForcemergeResponse
- type IndicesForcemergeService
- func (s *IndicesForcemergeService) AllowNoIndices(allowNoIndices bool) *IndicesForcemergeService
- func (s *IndicesForcemergeService) Do() (*IndicesForcemergeResponse, error)
- func (s *IndicesForcemergeService) ExpandWildcards(expandWildcards string) *IndicesForcemergeService
- func (s *IndicesForcemergeService) Flush(flush bool) *IndicesForcemergeService
- func (s *IndicesForcemergeService) IgnoreUnavailable(ignoreUnavailable bool) *IndicesForcemergeService
- func (s *IndicesForcemergeService) Index(index ...string) *IndicesForcemergeService
- func (s *IndicesForcemergeService) MaxNumSegments(maxNumSegments interface{}) *IndicesForcemergeService
- func (s *IndicesForcemergeService) OnlyExpungeDeletes(onlyExpungeDeletes bool) *IndicesForcemergeService
- func (s *IndicesForcemergeService) OperationThreading(operationThreading interface{}) *IndicesForcemergeService
- func (s *IndicesForcemergeService) Pretty(pretty bool) *IndicesForcemergeService
- func (s *IndicesForcemergeService) Validate() error
- func (s *IndicesForcemergeService) WaitForMerge(waitForMerge bool) *IndicesForcemergeService
- type IndicesGetResponse
- type IndicesGetService
- func (s *IndicesGetService) AllowNoIndices(allowNoIndices bool) *IndicesGetService
- func (s *IndicesGetService) Do() (map[string]*IndicesGetResponse, error)
- func (s *IndicesGetService) ExpandWildcards(expandWildcards string) *IndicesGetService
- func (s *IndicesGetService) Feature(features ...string) *IndicesGetService
- func (s *IndicesGetService) Human(human bool) *IndicesGetService
- func (s *IndicesGetService) IgnoreUnavailable(ignoreUnavailable bool) *IndicesGetService
- func (s *IndicesGetService) Index(indices ...string) *IndicesGetService
- func (s *IndicesGetService) Local(local bool) *IndicesGetService
- func (s *IndicesGetService) Pretty(pretty bool) *IndicesGetService
- func (s *IndicesGetService) Validate() error
- type IndicesGetSettingsResponse
- type IndicesGetSettingsService
- func (s *IndicesGetSettingsService) AllowNoIndices(allowNoIndices bool) *IndicesGetSettingsService
- func (s *IndicesGetSettingsService) Do() (map[string]*IndicesGetSettingsResponse, error)
- func (s *IndicesGetSettingsService) ExpandWildcards(expandWildcards string) *IndicesGetSettingsService
- func (s *IndicesGetSettingsService) FlatSettings(flatSettings bool) *IndicesGetSettingsService
- func (s *IndicesGetSettingsService) IgnoreUnavailable(ignoreUnavailable bool) *IndicesGetSettingsService
- func (s *IndicesGetSettingsService) Index(indices ...string) *IndicesGetSettingsService
- func (s *IndicesGetSettingsService) Local(local bool) *IndicesGetSettingsService
- func (s *IndicesGetSettingsService) Name(name ...string) *IndicesGetSettingsService
- func (s *IndicesGetSettingsService) Pretty(pretty bool) *IndicesGetSettingsService
- func (s *IndicesGetSettingsService) Validate() error
- type IndicesGetTemplateResponse
- type IndicesGetTemplateService
- func (s *IndicesGetTemplateService) Do() (map[string]*IndicesGetTemplateResponse, error)
- func (s *IndicesGetTemplateService) FlatSettings(flatSettings bool) *IndicesGetTemplateService
- func (s *IndicesGetTemplateService) Local(local bool) *IndicesGetTemplateService
- func (s *IndicesGetTemplateService) Name(name ...string) *IndicesGetTemplateService
- func (s *IndicesGetTemplateService) Pretty(pretty bool) *IndicesGetTemplateService
- func (s *IndicesGetTemplateService) Validate() error
- type IndicesOpenResponse
- type IndicesOpenService
- func (s *IndicesOpenService) AllowNoIndices(allowNoIndices bool) *IndicesOpenService
- func (s *IndicesOpenService) Do() (*IndicesOpenResponse, error)
- func (s *IndicesOpenService) ExpandWildcards(expandWildcards string) *IndicesOpenService
- func (s *IndicesOpenService) IgnoreUnavailable(ignoreUnavailable bool) *IndicesOpenService
- func (s *IndicesOpenService) Index(index string) *IndicesOpenService
- func (s *IndicesOpenService) MasterTimeout(masterTimeout string) *IndicesOpenService
- func (s *IndicesOpenService) Pretty(pretty bool) *IndicesOpenService
- func (s *IndicesOpenService) Timeout(timeout string) *IndicesOpenService
- func (s *IndicesOpenService) Validate() error
- type IndicesPutTemplateResponse
- type IndicesPutTemplateService
- func (s *IndicesPutTemplateService) BodyJson(body interface{}) *IndicesPutTemplateService
- func (s *IndicesPutTemplateService) BodyString(body string) *IndicesPutTemplateService
- func (s *IndicesPutTemplateService) Create(create bool) *IndicesPutTemplateService
- func (s *IndicesPutTemplateService) Do() (*IndicesPutTemplateResponse, error)
- func (s *IndicesPutTemplateService) FlatSettings(flatSettings bool) *IndicesPutTemplateService
- func (s *IndicesPutTemplateService) MasterTimeout(masterTimeout string) *IndicesPutTemplateService
- func (s *IndicesPutTemplateService) Name(name string) *IndicesPutTemplateService
- func (s *IndicesPutTemplateService) Order(order interface{}) *IndicesPutTemplateService
- func (s *IndicesPutTemplateService) Pretty(pretty bool) *IndicesPutTemplateService
- func (s *IndicesPutTemplateService) Timeout(timeout string) *IndicesPutTemplateService
- func (s *IndicesPutTemplateService) Validate() error
- type IndicesQuery
- type IndicesStatsResponse
- type IndicesStatsService
- func (s *IndicesStatsService) CompletionFields(completionFields ...string) *IndicesStatsService
- func (s *IndicesStatsService) Do() (*IndicesStatsResponse, error)
- func (s *IndicesStatsService) FielddataFields(fielddataFields ...string) *IndicesStatsService
- func (s *IndicesStatsService) Fields(fields ...string) *IndicesStatsService
- func (s *IndicesStatsService) Groups(groups ...string) *IndicesStatsService
- func (s *IndicesStatsService) Human(human bool) *IndicesStatsService
- func (s *IndicesStatsService) Index(indices ...string) *IndicesStatsService
- func (s *IndicesStatsService) Level(level string) *IndicesStatsService
- func (s *IndicesStatsService) Metric(metric ...string) *IndicesStatsService
- func (s *IndicesStatsService) Pretty(pretty bool) *IndicesStatsService
- func (s *IndicesStatsService) Type(types ...string) *IndicesStatsService
- func (s *IndicesStatsService) Validate() error
- type InnerHit
- func (hit *InnerHit) Explain(explain bool) *InnerHit
- func (hit *InnerHit) FetchSource(fetchSource bool) *InnerHit
- func (hit *InnerHit) FetchSourceContext(fetchSourceContext *FetchSourceContext) *InnerHit
- func (hit *InnerHit) Field(fieldName string) *InnerHit
- func (hit *InnerHit) FieldDataField(fieldDataField string) *InnerHit
- func (hit *InnerHit) FieldDataFields(fieldDataFields ...string) *InnerHit
- func (hit *InnerHit) Fields(fieldNames ...string) *InnerHit
- func (hit *InnerHit) From(from int) *InnerHit
- func (hit *InnerHit) Highlight(highlight *Highlight) *InnerHit
- func (hit *InnerHit) Highlighter() *Highlight
- func (hit *InnerHit) Name(name string) *InnerHit
- func (hit *InnerHit) NoFields() *InnerHit
- func (hit *InnerHit) Path(path string) *InnerHit
- func (hit *InnerHit) Query(query Query) *InnerHit
- func (hit *InnerHit) ScriptField(scriptField *ScriptField) *InnerHit
- func (hit *InnerHit) ScriptFields(scriptFields ...*ScriptField) *InnerHit
- func (hit *InnerHit) Size(size int) *InnerHit
- func (hit *InnerHit) Sort(field string, ascending bool) *InnerHit
- func (hit *InnerHit) SortBy(sorter ...Sorter) *InnerHit
- func (hit *InnerHit) SortWithInfo(info SortInfo) *InnerHit
- func (hit *InnerHit) Source() (interface{}, error)
- func (hit *InnerHit) TrackScores(trackScores bool) *InnerHit
- func (hit *InnerHit) Type(typ string) *InnerHit
- func (hit *InnerHit) Version(version bool) *InnerHit
- type LaplaceSmoothingModel
- type LinearDecayFunction
- func (fn *LinearDecayFunction) Decay(decay float64) *LinearDecayFunction
- func (fn *LinearDecayFunction) FieldName(fieldName string) *LinearDecayFunction
- func (fn *LinearDecayFunction) GetMultiValueMode() string
- func (fn *LinearDecayFunction) GetWeight() *float64
- func (fn *LinearDecayFunction) MultiValueMode(mode 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{}, error)
- func (fn *LinearDecayFunction) Weight(weight float64) *LinearDecayFunction
- type LinearInterpolationSmoothingModel
- type LinearMovAvgModel
- type MatchAllQuery
- type MatchQuery
- func (q *MatchQuery) Analyzer(analyzer string) *MatchQuery
- func (q *MatchQuery) Boost(boost float64) *MatchQuery
- func (q *MatchQuery) CutoffFrequency(cutoff float64) *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{}, error)
- func (q *MatchQuery) Type(typ 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) Meta(metaData map[string]interface{}) *MaxAggregation
- func (a *MaxAggregation) Script(script *Script) *MaxAggregation
- func (a *MaxAggregation) Source() (interface{}, error)
- func (a *MaxAggregation) SubAggregation(name string, subAggregation Aggregation) *MaxAggregation
- type MaxBucketAggregation
- func (a *MaxBucketAggregation) BucketsPath(bucketsPaths ...string) *MaxBucketAggregation
- func (a *MaxBucketAggregation) Format(format string) *MaxBucketAggregation
- func (a *MaxBucketAggregation) GapInsertZeros() *MaxBucketAggregation
- func (a *MaxBucketAggregation) GapPolicy(gapPolicy string) *MaxBucketAggregation
- func (a *MaxBucketAggregation) GapSkip() *MaxBucketAggregation
- func (a *MaxBucketAggregation) Meta(metaData map[string]interface{}) *MaxBucketAggregation
- func (a *MaxBucketAggregation) Source() (interface{}, error)
- func (a *MaxBucketAggregation) SubAggregation(name string, subAggregation Aggregation) *MaxBucketAggregation
- type MgetResponse
- type MgetService
- func (b *MgetService) Add(items ...*MultiGetItem) *MgetService
- func (b *MgetService) Do() (*MgetResponse, error)
- func (b *MgetService) Preference(preference string) *MgetService
- func (s *MgetService) Pretty(pretty bool) *MgetService
- func (b *MgetService) Realtime(realtime bool) *MgetService
- func (b *MgetService) Refresh(refresh bool) *MgetService
- func (b *MgetService) Source() (interface{}, error)
- type MinAggregation
- func (a *MinAggregation) Field(field string) *MinAggregation
- func (a *MinAggregation) Format(format string) *MinAggregation
- func (a *MinAggregation) Meta(metaData map[string]interface{}) *MinAggregation
- func (a *MinAggregation) Script(script *Script) *MinAggregation
- func (a *MinAggregation) Source() (interface{}, error)
- func (a *MinAggregation) SubAggregation(name string, subAggregation Aggregation) *MinAggregation
- type MinBucketAggregation
- func (a *MinBucketAggregation) BucketsPath(bucketsPaths ...string) *MinBucketAggregation
- func (a *MinBucketAggregation) Format(format string) *MinBucketAggregation
- func (a *MinBucketAggregation) GapInsertZeros() *MinBucketAggregation
- func (a *MinBucketAggregation) GapPolicy(gapPolicy string) *MinBucketAggregation
- func (a *MinBucketAggregation) GapSkip() *MinBucketAggregation
- func (a *MinBucketAggregation) Meta(metaData map[string]interface{}) *MinBucketAggregation
- func (a *MinBucketAggregation) Source() (interface{}, error)
- func (a *MinBucketAggregation) SubAggregation(name string, subAggregation Aggregation) *MinBucketAggregation
- type MissingAggregation
- func (a *MissingAggregation) Field(field string) *MissingAggregation
- func (a *MissingAggregation) Meta(metaData map[string]interface{}) *MissingAggregation
- func (a *MissingAggregation) Source() (interface{}, error)
- func (a *MissingAggregation) SubAggregation(name string, subAggregation Aggregation) *MissingAggregation
- type MissingQuery
- type MoreLikeThisQuery
- func (q *MoreLikeThisQuery) Analyzer(analyzer string) *MoreLikeThisQuery
- func (q *MoreLikeThisQuery) Boost(boost float64) *MoreLikeThisQuery
- func (q *MoreLikeThisQuery) BoostTerms(boostTerms float64) *MoreLikeThisQuery
- func (q *MoreLikeThisQuery) FailOnUnsupportedField(fail bool) *MoreLikeThisQuery
- func (q *MoreLikeThisQuery) Field(fields ...string) *MoreLikeThisQuery
- func (q *MoreLikeThisQuery) Ids(ids ...string) *MoreLikeThisQuery
- func (q *MoreLikeThisQuery) IgnoreLikeItems(ignoreDocs ...*MoreLikeThisQueryItem) *MoreLikeThisQuery
- func (q *MoreLikeThisQuery) IgnoreLikeText(ignoreLikeText ...string) *MoreLikeThisQuery
- func (q *MoreLikeThisQuery) Include(include bool) *MoreLikeThisQuery
- func (q *MoreLikeThisQuery) LikeItems(docs ...*MoreLikeThisQueryItem) *MoreLikeThisQuery
- func (q *MoreLikeThisQuery) LikeText(likeTexts ...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) MinimumShouldMatch(minimumShouldMatch string) *MoreLikeThisQuery
- func (q *MoreLikeThisQuery) QueryName(queryName string) *MoreLikeThisQuery
- func (q *MoreLikeThisQuery) Source() (interface{}, error)
- func (q *MoreLikeThisQuery) StopWord(stopWords ...string) *MoreLikeThisQuery
- type MoreLikeThisQueryItem
- func (item *MoreLikeThisQueryItem) Doc(doc interface{}) *MoreLikeThisQueryItem
- func (item *MoreLikeThisQueryItem) FetchSourceContext(fsc *FetchSourceContext) *MoreLikeThisQueryItem
- func (item *MoreLikeThisQueryItem) Fields(fields ...string) *MoreLikeThisQueryItem
- func (item *MoreLikeThisQueryItem) Id(id string) *MoreLikeThisQueryItem
- func (item *MoreLikeThisQueryItem) Index(index string) *MoreLikeThisQueryItem
- func (item *MoreLikeThisQueryItem) LikeText(likeText string) *MoreLikeThisQueryItem
- func (item *MoreLikeThisQueryItem) Routing(routing string) *MoreLikeThisQueryItem
- func (item *MoreLikeThisQueryItem) Source() (interface{}, error)
- func (item *MoreLikeThisQueryItem) Type(typ string) *MoreLikeThisQueryItem
- func (item *MoreLikeThisQueryItem) Version(version int64) *MoreLikeThisQueryItem
- func (item *MoreLikeThisQueryItem) VersionType(versionType string) *MoreLikeThisQueryItem
- type MovAvgAggregation
- func (a *MovAvgAggregation) BucketsPath(bucketsPaths ...string) *MovAvgAggregation
- func (a *MovAvgAggregation) Format(format string) *MovAvgAggregation
- func (a *MovAvgAggregation) GapInsertZeros() *MovAvgAggregation
- func (a *MovAvgAggregation) GapPolicy(gapPolicy string) *MovAvgAggregation
- func (a *MovAvgAggregation) GapSkip() *MovAvgAggregation
- func (a *MovAvgAggregation) Meta(metaData map[string]interface{}) *MovAvgAggregation
- func (a *MovAvgAggregation) Minimize(minimize bool) *MovAvgAggregation
- func (a *MovAvgAggregation) Model(model MovAvgModel) *MovAvgAggregation
- func (a *MovAvgAggregation) Predict(numPredictions int) *MovAvgAggregation
- func (a *MovAvgAggregation) Source() (interface{}, error)
- func (a *MovAvgAggregation) SubAggregation(name string, subAggregation Aggregation) *MovAvgAggregation
- func (a *MovAvgAggregation) Window(window int) *MovAvgAggregation
- type MovAvgModel
- 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{}, error)
- func (item *MultiGetItem) Type(typ string) *MultiGetItem
- func (item *MultiGetItem) Version(version int64) *MultiGetItem
- func (item *MultiGetItem) VersionType(versionType string) *MultiGetItem
- type MultiMatchQuery
- func (q *MultiMatchQuery) Analyzer(analyzer string) *MultiMatchQuery
- func (q *MultiMatchQuery) Boost(boost float64) *MultiMatchQuery
- func (q *MultiMatchQuery) CutoffFrequency(cutoff float64) *MultiMatchQuery
- func (q *MultiMatchQuery) Field(field string) *MultiMatchQuery
- func (q *MultiMatchQuery) FieldWithBoost(field string, boost float64) *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{}, error)
- func (q *MultiMatchQuery) TieBreaker(tieBreaker float64) *MultiMatchQuery
- func (q *MultiMatchQuery) Type(typ string) *MultiMatchQuery
- func (q *MultiMatchQuery) ZeroTermsQuery(zeroTermsQuery string) *MultiMatchQuery
- type MultiSearchResult
- type MultiSearchService
- type NestedAggregation
- func (a *NestedAggregation) Meta(metaData map[string]interface{}) *NestedAggregation
- func (a *NestedAggregation) Path(path string) *NestedAggregation
- func (a *NestedAggregation) Source() (interface{}, error)
- func (a *NestedAggregation) SubAggregation(name string, subAggregation Aggregation) *NestedAggregation
- type NestedQuery
- type NodesInfoNode
- type NodesInfoNodeHTTP
- type NodesInfoNodeJVM
- type NodesInfoNodeNetwork
- type NodesInfoNodeOS
- type NodesInfoNodePlugin
- type NodesInfoNodeProcess
- type NodesInfoNodeThreadPool
- type NodesInfoNodeThreadPoolSection
- type NodesInfoNodeTransport
- type NodesInfoNodeTransportProfile
- type NodesInfoResponse
- type NodesInfoService
- func (s *NodesInfoService) Do() (*NodesInfoResponse, error)
- func (s *NodesInfoService) FlatSettings(flatSettings bool) *NodesInfoService
- func (s *NodesInfoService) Human(human bool) *NodesInfoService
- func (s *NodesInfoService) Metric(metric ...string) *NodesInfoService
- func (s *NodesInfoService) NodeId(nodeId ...string) *NodesInfoService
- func (s *NodesInfoService) Pretty(pretty bool) *NodesInfoService
- func (s *NodesInfoService) Validate() error
- type NotQuery
- type OptimizeResult
- type 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(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 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) Meta(metaData map[string]interface{}) *PercentileRanksAggregation
- func (a *PercentileRanksAggregation) Script(script *Script) *PercentileRanksAggregation
- func (a *PercentileRanksAggregation) Source() (interface{}, error)
- 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) Meta(metaData map[string]interface{}) *PercentilesAggregation
- func (a *PercentilesAggregation) Percentiles(percentiles ...float64) *PercentilesAggregation
- func (a *PercentilesAggregation) Script(script *Script) *PercentilesAggregation
- func (a *PercentilesAggregation) Source() (interface{}, error)
- func (a *PercentilesAggregation) SubAggregation(name string, subAggregation Aggregation) *PercentilesAggregation
- type PercolateMatch
- type PercolateResponse
- type PercolateService
- func (s *PercolateService) AllowNoIndices(allowNoIndices bool) *PercolateService
- func (s *PercolateService) BodyJson(body interface{}) *PercolateService
- func (s *PercolateService) BodyString(body string) *PercolateService
- func (s *PercolateService) Do() (*PercolateResponse, error)
- func (s *PercolateService) Doc(doc interface{}) *PercolateService
- func (s *PercolateService) ExpandWildcards(expandWildcards string) *PercolateService
- func (s *PercolateService) Id(id string) *PercolateService
- func (s *PercolateService) IgnoreUnavailable(ignoreUnavailable bool) *PercolateService
- func (s *PercolateService) Index(index string) *PercolateService
- func (s *PercolateService) PercolateFormat(percolateFormat string) *PercolateService
- func (s *PercolateService) PercolateIndex(percolateIndex string) *PercolateService
- func (s *PercolateService) PercolatePreference(percolatePreference string) *PercolateService
- func (s *PercolateService) PercolateRouting(percolateRouting string) *PercolateService
- func (s *PercolateService) PercolateType(percolateType string) *PercolateService
- func (s *PercolateService) Preference(preference string) *PercolateService
- func (s *PercolateService) Pretty(pretty bool) *PercolateService
- func (s *PercolateService) Routing(routing []string) *PercolateService
- func (s *PercolateService) Source(source string) *PercolateService
- func (s *PercolateService) Type(typ string) *PercolateService
- func (s *PercolateService) Validate() error
- func (s *PercolateService) Version(version interface{}) *PercolateService
- func (s *PercolateService) VersionType(versionType string) *PercolateService
- 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 float64) *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 float64) *PhraseSuggester
- func (q *PhraseSuggester) Name() string
- func (q *PhraseSuggester) RealWordErrorLikelihood(realWordErrorLikelihood float64) *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{}, error)
- func (q *PhraseSuggester) Text(text string) *PhraseSuggester
- func (q *PhraseSuggester) TokenLimit(tokenLimit int) *PhraseSuggester
- type PingResult
- type PingService
- type PrefixQuery
- type PutMappingResponse
- type PutMappingService
- func (s *PutMappingService) AllowNoIndices(allowNoIndices bool) *PutMappingService
- func (s *PutMappingService) BodyJson(mapping map[string]interface{}) *PutMappingService
- func (s *PutMappingService) BodyString(mapping string) *PutMappingService
- func (s *PutMappingService) Do() (*PutMappingResponse, error)
- func (s *PutMappingService) ExpandWildcards(expandWildcards string) *PutMappingService
- func (s *PutMappingService) IgnoreConflicts(ignoreConflicts bool) *PutMappingService
- func (s *PutMappingService) IgnoreUnavailable(ignoreUnavailable bool) *PutMappingService
- func (s *PutMappingService) Index(indices ...string) *PutMappingService
- func (s *PutMappingService) MasterTimeout(masterTimeout string) *PutMappingService
- func (s *PutMappingService) Pretty(pretty bool) *PutMappingService
- func (s *PutMappingService) Timeout(timeout string) *PutMappingService
- func (s *PutMappingService) Type(typ string) *PutMappingService
- func (s *PutMappingService) Validate() error
- 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 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{}, error)
- 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 float64) *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 float64) *QueryStringQuery
- func (q *QueryStringQuery) Fuzziness(fuzziness string) *QueryStringQuery
- func (q *QueryStringQuery) FuzzyMaxExpansions(fuzzyMaxExpansions int) *QueryStringQuery
- func (q *QueryStringQuery) FuzzyPrefixLength(fuzzyPrefixLength int) *QueryStringQuery
- func (q *QueryStringQuery) FuzzyRewrite(fuzzyRewrite string) *QueryStringQuery
- func (q *QueryStringQuery) Lenient(lenient bool) *QueryStringQuery
- func (q *QueryStringQuery) Locale(locale string) *QueryStringQuery
- func (q *QueryStringQuery) LowercaseExpandedTerms(lowercaseExpandedTerms bool) *QueryStringQuery
- func (q *QueryStringQuery) MaxDeterminizedState(maxDeterminizedStates int) *QueryStringQuery
- func (q *QueryStringQuery) MinimumShouldMatch(minimumShouldMatch string) *QueryStringQuery
- func (q *QueryStringQuery) PhraseSlop(phraseSlop int) *QueryStringQuery
- func (q *QueryStringQuery) QueryName(queryName string) *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{}, error)
- func (q *QueryStringQuery) TieBreaker(tieBreaker float64) *QueryStringQuery
- func (q *QueryStringQuery) TimeZone(timeZone string) *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) Lt(to interface{}) *RangeAggregation
- func (a *RangeAggregation) LtWithKey(key string, to interface{}) *RangeAggregation
- func (a *RangeAggregation) Meta(metaData map[string]interface{}) *RangeAggregation
- func (a *RangeAggregation) Script(script *Script) *RangeAggregation
- func (a *RangeAggregation) Source() (interface{}, error)
- func (a *RangeAggregation) SubAggregation(name string, subAggregation Aggregation) *RangeAggregation
- func (a *RangeAggregation) Unmapped(unmapped bool) *RangeAggregation
- type RangeQuery
- func (q *RangeQuery) Boost(boost float64) *RangeQuery
- func (q *RangeQuery) Format(format string) *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{}, error)
- func (q *RangeQuery) TimeZone(timeZone string) *RangeQuery
- func (q *RangeQuery) To(to interface{}) *RangeQuery
- type RefreshResult
- type RefreshService
- 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{}, error)
- type Reindexer
- func (ix *Reindexer) BulkSize(bulkSize int) *Reindexer
- func (ix *Reindexer) Do() (*ReindexerResponse, error)
- func (ix *Reindexer) Progress(f ReindexerProgressFunc) *Reindexer
- func (ix *Reindexer) Query(q Query) *Reindexer
- func (ix *Reindexer) ScanFields(scanFields ...string) *Reindexer
- func (ix *Reindexer) Scroll(timeout string) *Reindexer
- func (ix *Reindexer) Size(size int) *Reindexer
- func (ix *Reindexer) StatsOnly(statsOnly bool) *Reindexer
- func (ix *Reindexer) TargetClient(c *Client) *Reindexer
- type ReindexerFunc
- type ReindexerProgressFunc
- type ReindexerResponse
- type Request
- type Rescore
- type Rescorer
- type Response
- type RestoreSource
- type ScanCursor
- type ScanService
- func (s *ScanService) Do() (*ScanCursor, error)
- func (s *ScanService) FetchSource(fetchSource bool) *ScanService
- func (s *ScanService) FetchSourceContext(fetchSourceContext *FetchSourceContext) *ScanService
- func (s *ScanService) Fields(fields ...string) *ScanService
- func (s *ScanService) Index(indices ...string) *ScanService
- func (s *ScanService) KeepAlive(keepAlive string) *ScanService
- func (s *ScanService) PostFilter(postFilter Query) *ScanService
- func (s *ScanService) Preference(preference string) *ScanService
- func (s *ScanService) Pretty(pretty bool) *ScanService
- func (s *ScanService) Query(query Query) *ScanService
- func (s *ScanService) Routing(routings ...string) *ScanService
- func (s *ScanService) Scroll(keepAlive string) *ScanService
- func (s *ScanService) SearchSource(searchSource *SearchSource) *ScanService
- func (s *ScanService) Size(size int) *ScanService
- func (s *ScanService) Sort(field string, ascending bool) *ScanService
- func (s *ScanService) SortBy(sorter ...Sorter) *ScanService
- func (s *ScanService) SortWithInfo(info SortInfo) *ScanService
- func (s *ScanService) Type(types ...string) *ScanService
- func (s *ScanService) Version(version bool) *ScanService
- type ScoreFunction
- type ScoreSort
- type Script
- func (s *Script) Lang(lang string) *Script
- func (s *Script) Param(name string, value interface{}) *Script
- func (s *Script) Params(params map[string]interface{}) *Script
- func (s *Script) Script(script string) *Script
- func (s *Script) Source() (interface{}, error)
- func (s *Script) Type(typ string) *Script
- type ScriptField
- type ScriptFunction
- type ScriptQuery
- type ScriptSort
- func (s ScriptSort) Asc() ScriptSort
- func (s ScriptSort) Desc() ScriptSort
- func (s ScriptSort) NestedFilter(nestedFilter Query) ScriptSort
- func (s ScriptSort) NestedPath(nestedPath string) ScriptSort
- func (s ScriptSort) Order(ascending bool) ScriptSort
- func (s ScriptSort) SortMode(sortMode string) ScriptSort
- func (s ScriptSort) Source() (interface{}, error)
- func (s ScriptSort) Type(typ string) ScriptSort
- type ScrollService
- func (s *ScrollService) Do() (*SearchResult, error)
- func (s *ScrollService) GetFirstPage() (*SearchResult, error)
- func (s *ScrollService) GetNextPage() (*SearchResult, error)
- func (s *ScrollService) Index(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(types ...string) *ScrollService
- type SearchExplanation
- type SearchHit
- type SearchHitHighlight
- type SearchHitInnerHits
- type SearchHits
- type SearchRequest
- func (r *SearchRequest) HasIndices() bool
- func (r *SearchRequest) Index(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(types ...string) *SearchRequest
- type SearchResult
- type SearchService
- func (s *SearchService) Aggregation(name string, aggregation Aggregation) *SearchService
- func (s *SearchService) Do() (*SearchResult, error)
- func (s *SearchService) Explain(explain bool) *SearchService
- func (s *SearchService) FetchSource(fetchSource bool) *SearchService
- func (s *SearchService) FetchSourceContext(fetchSourceContext *FetchSourceContext) *SearchService
- func (s *SearchService) Field(fieldName string) *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(indices ...string) *SearchService
- func (s *SearchService) MinScore(minScore float64) *SearchService
- func (s *SearchService) NoFields() *SearchService
- func (s *SearchService) PostFilter(postFilter Query) *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) Routing(routings ...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(types ...string) *SearchService
- func (s *SearchService) Version(version bool) *SearchService
- type SearchSource
- func (s *SearchSource) Aggregation(name string, aggregation Aggregation) *SearchSource
- func (s *SearchSource) ClearRescorers() *SearchSource
- func (s *SearchSource) DefaultRescoreWindowSize(defaultRescoreWindowSize int) *SearchSource
- func (s *SearchSource) Explain(explain bool) *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) InnerHit(name string, innerHit *InnerHit) *SearchSource
- func (s *SearchSource) MinScore(minScore float64) *SearchSource
- func (s *SearchSource) NoFields() *SearchSource
- func (s *SearchSource) PostFilter(postFilter Query) *SearchSource
- func (s *SearchSource) Query(query Query) *SearchSource
- func (s *SearchSource) Rescorer(rescore *Rescore) *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{}, error)
- func (s *SearchSource) Stats(statsGroup ...string) *SearchSource
- func (s *SearchSource) Suggester(suggester Suggester) *SearchSource
- func (s *SearchSource) TerminateAfter(terminateAfter int) *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 SerialDiffAggregation
- func (a *SerialDiffAggregation) BucketsPath(bucketsPaths ...string) *SerialDiffAggregation
- func (a *SerialDiffAggregation) Format(format string) *SerialDiffAggregation
- func (a *SerialDiffAggregation) GapInsertZeros() *SerialDiffAggregation
- func (a *SerialDiffAggregation) GapPolicy(gapPolicy string) *SerialDiffAggregation
- func (a *SerialDiffAggregation) GapSkip() *SerialDiffAggregation
- func (a *SerialDiffAggregation) Lag(lag int) *SerialDiffAggregation
- func (a *SerialDiffAggregation) Meta(metaData map[string]interface{}) *SerialDiffAggregation
- func (a *SerialDiffAggregation) Source() (interface{}, error)
- func (a *SerialDiffAggregation) SubAggregation(name string, subAggregation Aggregation) *SerialDiffAggregation
- type SignificantTermsAggregation
- func (a *SignificantTermsAggregation) BackgroundFilter(filter Query) *SignificantTermsAggregation
- func (a *SignificantTermsAggregation) ExecutionHint(hint string) *SignificantTermsAggregation
- func (a *SignificantTermsAggregation) Field(field string) *SignificantTermsAggregation
- func (a *SignificantTermsAggregation) Meta(metaData map[string]interface{}) *SignificantTermsAggregation
- func (a *SignificantTermsAggregation) MinDocCount(minDocCount int) *SignificantTermsAggregation
- func (a *SignificantTermsAggregation) RequiredSize(requiredSize int) *SignificantTermsAggregation
- func (a *SignificantTermsAggregation) ShardMinDocCount(shardMinDocCount int) *SignificantTermsAggregation
- func (a *SignificantTermsAggregation) ShardSize(shardSize int) *SignificantTermsAggregation
- func (a *SignificantTermsAggregation) Source() (interface{}, error)
- func (a *SignificantTermsAggregation) SubAggregation(name string, subAggregation Aggregation) *SignificantTermsAggregation
- type SimpleMovAvgModel
- type SimpleQueryStringQuery
- func (q *SimpleQueryStringQuery) AnalyzeWildcard(analyzeWildcard bool) *SimpleQueryStringQuery
- func (q *SimpleQueryStringQuery) Analyzer(analyzer string) *SimpleQueryStringQuery
- func (q *SimpleQueryStringQuery) Boost(boost float64) *SimpleQueryStringQuery
- func (q *SimpleQueryStringQuery) DefaultOperator(defaultOperator string) *SimpleQueryStringQuery
- func (q *SimpleQueryStringQuery) Field(field string) *SimpleQueryStringQuery
- func (q *SimpleQueryStringQuery) FieldWithBoost(field string, boost float64) *SimpleQueryStringQuery
- func (q *SimpleQueryStringQuery) Flags(flags string) *SimpleQueryStringQuery
- func (q *SimpleQueryStringQuery) Lenient(lenient bool) *SimpleQueryStringQuery
- func (q *SimpleQueryStringQuery) Locale(locale string) *SimpleQueryStringQuery
- func (q *SimpleQueryStringQuery) LowercaseExpandedTerms(lowercaseExpandedTerms bool) *SimpleQueryStringQuery
- func (q *SimpleQueryStringQuery) MinimumShouldMatch(minimumShouldMatch string) *SimpleQueryStringQuery
- func (q *SimpleQueryStringQuery) QueryName(queryName string) *SimpleQueryStringQuery
- func (q *SimpleQueryStringQuery) Source() (interface{}, error)
- type SmoothingModel
- type SortInfo
- type Sorter
- type StatsAggregation
- func (a *StatsAggregation) Field(field string) *StatsAggregation
- func (a *StatsAggregation) Format(format string) *StatsAggregation
- func (a *StatsAggregation) Meta(metaData map[string]interface{}) *StatsAggregation
- func (a *StatsAggregation) Script(script *Script) *StatsAggregation
- func (a *StatsAggregation) Source() (interface{}, error)
- func (a *StatsAggregation) SubAggregation(name string, subAggregation Aggregation) *StatsAggregation
- type StupidBackoffSmoothingModel
- type SuggestField
- func (f *SuggestField) ContextQuery(queries ...SuggesterContextQuery) *SuggestField
- func (f *SuggestField) Input(input ...string) *SuggestField
- func (f *SuggestField) MarshalJSON() ([]byte, error)
- func (f *SuggestField) Output(output string) *SuggestField
- func (f *SuggestField) Payload(payload interface{}) *SuggestField
- func (f *SuggestField) Weight(weight int) *SuggestField
- type SuggestResult
- type SuggestService
- func (s *SuggestService) Do() (SuggestResult, error)
- func (s *SuggestService) Index(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{}, error)
- type SuggesterGeoQuery
- type Suggestion
- type SumAggregation
- func (a *SumAggregation) Field(field string) *SumAggregation
- func (a *SumAggregation) Format(format string) *SumAggregation
- func (a *SumAggregation) Meta(metaData map[string]interface{}) *SumAggregation
- func (a *SumAggregation) Script(script *Script) *SumAggregation
- func (a *SumAggregation) Source() (interface{}, error)
- func (a *SumAggregation) SubAggregation(name string, subAggregation Aggregation) *SumAggregation
- type SumBucketAggregation
- func (a *SumBucketAggregation) BucketsPath(bucketsPaths ...string) *SumBucketAggregation
- func (a *SumBucketAggregation) Format(format string) *SumBucketAggregation
- func (a *SumBucketAggregation) GapInsertZeros() *SumBucketAggregation
- func (a *SumBucketAggregation) GapPolicy(gapPolicy string) *SumBucketAggregation
- func (a *SumBucketAggregation) GapSkip() *SumBucketAggregation
- func (a *SumBucketAggregation) Meta(metaData map[string]interface{}) *SumBucketAggregation
- func (a *SumBucketAggregation) Source() (interface{}, error)
- func (a *SumBucketAggregation) SubAggregation(name string, subAggregation Aggregation) *SumBucketAggregation
- type TemplateQuery
- func (q *TemplateQuery) Source() (interface{}, error)
- 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 TermQuery
- type TermSuggester
- func (q *TermSuggester) Accuracy(accuracy float64) *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 float64) *TermSuggester
- func (q *TermSuggester) MinDocFreq(minDocFreq float64) *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{}, error)
- func (q *TermSuggester) StringDistance(stringDistance string) *TermSuggester
- func (q *TermSuggester) SuggestMode(suggestMode string) *TermSuggester
- func (q *TermSuggester) Text(text string) *TermSuggester
- type TermVectorsFieldInfo
- 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) Meta(metaData map[string]interface{}) *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) RequiredSize(requiredSize int) *TermsAggregation
- func (a *TermsAggregation) Script(script *Script) *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{}, error)
- func (a *TermsAggregation) SubAggregation(name string, subAggregation Aggregation) *TermsAggregation
- func (a *TermsAggregation) ValueType(valueType string) *TermsAggregation
- type TermsInfo
- type TermsQuery
- type TermvectorsFilterSettings
- func (fs *TermvectorsFilterSettings) MaxDocFreq(value int64) *TermvectorsFilterSettings
- func (fs *TermvectorsFilterSettings) MaxNumTerms(value int64) *TermvectorsFilterSettings
- func (fs *TermvectorsFilterSettings) MaxTermFreq(value int64) *TermvectorsFilterSettings
- func (fs *TermvectorsFilterSettings) MaxWordLength(value int64) *TermvectorsFilterSettings
- func (fs *TermvectorsFilterSettings) MinDocFreq(value int64) *TermvectorsFilterSettings
- func (fs *TermvectorsFilterSettings) MinTermFreq(value int64) *TermvectorsFilterSettings
- func (fs *TermvectorsFilterSettings) MinWordLength(value int64) *TermvectorsFilterSettings
- func (fs *TermvectorsFilterSettings) Source() (interface{}, error)
- type TermvectorsResponse
- type TermvectorsService
- func (s *TermvectorsService) BodyJson(body interface{}) *TermvectorsService
- func (s *TermvectorsService) BodyString(body string) *TermvectorsService
- func (s *TermvectorsService) Dfs(dfs bool) *TermvectorsService
- func (s *TermvectorsService) Do() (*TermvectorsResponse, error)
- func (s *TermvectorsService) Doc(doc interface{}) *TermvectorsService
- func (s *TermvectorsService) FieldStatistics(fieldStatistics bool) *TermvectorsService
- func (s *TermvectorsService) Fields(fields ...string) *TermvectorsService
- func (s *TermvectorsService) Filter(filter *TermvectorsFilterSettings) *TermvectorsService
- func (s *TermvectorsService) Id(id string) *TermvectorsService
- func (s *TermvectorsService) Index(index string) *TermvectorsService
- func (s *TermvectorsService) Offsets(offsets bool) *TermvectorsService
- func (s *TermvectorsService) Parent(parent string) *TermvectorsService
- func (s *TermvectorsService) Payloads(payloads bool) *TermvectorsService
- func (s *TermvectorsService) PerFieldAnalyzer(perFieldAnalyzer map[string]string) *TermvectorsService
- func (s *TermvectorsService) Positions(positions bool) *TermvectorsService
- func (s *TermvectorsService) Preference(preference string) *TermvectorsService
- func (s *TermvectorsService) Pretty(pretty bool) *TermvectorsService
- func (s *TermvectorsService) Realtime(realtime bool) *TermvectorsService
- func (s *TermvectorsService) Routing(routing string) *TermvectorsService
- func (s *TermvectorsService) TermStatistics(termStatistics bool) *TermvectorsService
- func (s *TermvectorsService) Type(typ string) *TermvectorsService
- func (s *TermvectorsService) Validate() error
- func (s *TermvectorsService) Version(version interface{}) *TermvectorsService
- func (s *TermvectorsService) VersionType(versionType string) *TermvectorsService
- type TokenInfo
- 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) 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{}, error)
- func (a *TopHitsAggregation) TrackScores(trackScores bool) *TopHitsAggregation
- func (a *TopHitsAggregation) Version(version bool) *TopHitsAggregation
- type TypeQuery
- type UpdateResponse
- type UpdateService
- func (b *UpdateService) ConsistencyLevel(consistencyLevel string) *UpdateService
- func (b *UpdateService) DetectNoop(detectNoop bool) *UpdateService
- func (b *UpdateService) Do() (*UpdateResponse, 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 *Script) *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) Meta(metaData map[string]interface{}) *ValueCountAggregation
- func (a *ValueCountAggregation) Script(script *Script) *ValueCountAggregation
- func (a *ValueCountAggregation) Source() (interface{}, error)
- func (a *ValueCountAggregation) SubAggregation(name string, subAggregation Aggregation) *ValueCountAggregation
- type WeightFactorFunction
- type WildcardQuery
Examples ¶
Constants ¶
const ( // Version is the current version of Elastic. Version = "3.0.10" // DefaultUrl is the default endpoint of Elasticsearch on the local machine. // It is used e.g. when initializing a new Client without a specific URL. DefaultURL = "http://127.0.0.1:9200" // DefaultScheme is the default protocol scheme to use when sniffing // the Elasticsearch cluster. DefaultScheme = "http" // DefaultHealthcheckEnabled specifies if healthchecks are enabled by default. DefaultHealthcheckEnabled = true // DefaultHealthcheckTimeoutStartup is the time the healthcheck waits // for a response from Elasticsearch on startup, i.e. when creating a // client. After the client is started, a shorter timeout is commonly used // (its default is specified in DefaultHealthcheckTimeout). DefaultHealthcheckTimeoutStartup = 5 * time.Second // DefaultHealthcheckTimeout specifies the time a running client waits for // a response from Elasticsearch. Notice that the healthcheck timeout // when a client is created is larger by default (see DefaultHealthcheckTimeoutStartup). DefaultHealthcheckTimeout = 1 * time.Second // DefaultHealthcheckInterval is the default interval between // two health checks of the nodes in the cluster. DefaultHealthcheckInterval = 60 * time.Second // DefaultSnifferEnabled specifies if the sniffer is enabled by default. DefaultSnifferEnabled = true // DefaultSnifferInterval is the interval between two sniffing procedures, // i.e. the lookup of all nodes in the cluster and their addition/removal // from the list of actual connections. DefaultSnifferInterval = 15 * time.Minute // DefaultSnifferTimeoutStartup is the default timeout for the sniffing // process that is initiated while creating a new client. For subsequent // sniffing processes, DefaultSnifferTimeout is used (by default). DefaultSnifferTimeoutStartup = 5 * time.Second // DefaultSnifferTimeout is the default timeout after which the // sniffing process times out. Notice that for the initial sniffing // process, DefaultSnifferTimeoutStartup is used. DefaultSnifferTimeout = 2 * time.Second // DefaultMaxRetries is the number of retries for a single request after // Elastic will give up and return an error. It is zero by default, so // retry is disabled by default. DefaultMaxRetries = 0 // DefaultSendGetBodyAs is the HTTP method to use when elastic is sending // a GET request with a body. DefaultSendGetBodyAs = "GET" // DefaultGzipEnabled specifies if gzip compression is enabled by default. DefaultGzipEnabled = false )
Variables ¶
var ( // ErrNoClient is raised when no Elasticsearch node is available. ErrNoClient = errors.New("no Elasticsearch node available") // ErrRetry is raised when a request cannot be executed after the configured // number of retries. ErrRetry = errors.New("cannot connect after several retries") // ErrTimeout is raised when a request timed out, e.g. when WaitForStatus // didn't return in time. ErrTimeout = errors.New("timeout") )
var ( // End of stream (or scan) EOS = errors.New("EOS") // No ScrollId ErrNoScrollId = errors.New("no scrollId") )
var ( // ErrPluginNotFound is returned when using a service that requires a plugin that is not available. ErrPluginNotFound = errors.New("elastic: plugin not found") )
Functions ¶
func IsNotFound ¶
func IsNotFound(err interface{}) bool
IsNotFound returns true if the given error indicates that Elasticsearch returned HTTP status 404. The err parameter can be of type *elastic.Error, elastic.Error, *http.Response or int (indicating the HTTP status code).
func IsTimeout ¶
func IsTimeout(err interface{}) bool
IsTimeout returns true if the given error indicates that Elasticsearch returned HTTP status 408. The err parameter can be of type *elastic.Error, elastic.Error, *http.Response or int (indicating the HTTP status code).
func SetDecoder ¶
SetDecoder sets the Decoder to use when decoding data from Elasticsearch. DefaultDecoder is used by default.
func SetErrorLog ¶
SetErrorLog sets the logger for critical messages like nodes joining or leaving the cluster or failing requests. It is nil by default.
func SetInfoLog ¶
SetInfoLog sets the logger for informational messages, e.g. requests and their response times. It is nil by default.
func SetMaxRetries ¶
SetMaxRetries sets the maximum number of retries before giving up when performing a HTTP request to Elasticsearch.
func SetSendGetBodyAs ¶
SendGetBodyAs specifies the HTTP method to use when sending a GET request with a body. It is GET by default.
Types ¶
type Aggregation ¶
type Aggregation interface { // Source returns a JSON-serializable aggregation that is a fragment // of the request sent to Elasticsearch. Source() (interface{}, error) }
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"` Meta map[string]interface{} // `json:"meta,omitempty"` }
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"` Meta map[string]interface{} // `json:"meta,omitempty"` }
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"` Meta map[string]interface{} // `json:"meta,omitempty"` }
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 AggregationBucketKeyedRangeItems ¶
type AggregationBucketKeyedRangeItems struct { Aggregations DocCountErrorUpperBound int64 //`json:"doc_count_error_upper_bound"` SumOfOtherDocCount int64 //`json:"sum_other_doc_count"` Buckets map[string]*AggregationBucketRangeItem //`json:"buckets"` Meta map[string]interface{} // `json:"meta,omitempty"` }
AggregationBucketKeyedRangeItems is a bucket aggregation that is e.g. returned with a keyed range aggregation.
func (*AggregationBucketKeyedRangeItems) UnmarshalJSON ¶
func (a *AggregationBucketKeyedRangeItems) UnmarshalJSON(data []byte) error
UnmarshalJSON decodes JSON data and initializes an AggregationBucketRangeItems 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"` Meta map[string]interface{} // `json:"meta,omitempty"` }
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"` Meta map[string]interface{} // `json:"meta,omitempty"` }
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"` Meta map[string]interface{} // `json:"meta,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"` Meta map[string]interface{} // `json:"meta,omitempty"` }
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"` Meta map[string]interface{} // `json:"meta,omitempty"` }
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 AggregationPipelineBucketMetricValue ¶
type AggregationPipelineBucketMetricValue struct { Aggregations Keys []interface{} // `json:"keys"` Value *float64 // `json:"value"` ValueAsString string // `json:"value_as_string"` Meta map[string]interface{} // `json:"meta,omitempty"` }
AggregationPipelineBucketMetricValue is a value returned e.g. by a MaxBucket aggregation.
func (*AggregationPipelineBucketMetricValue) UnmarshalJSON ¶
func (a *AggregationPipelineBucketMetricValue) UnmarshalJSON(data []byte) error
UnmarshalJSON decodes JSON data and initializes an AggregationPipelineBucketMetricValue structure.
type AggregationPipelineDerivative ¶
type AggregationPipelineDerivative struct { Aggregations Value *float64 // `json:"value"` ValueAsString string // `json:"value_as_string"` NormalizedValue *float64 // `json:"normalized_value"` NormalizedValueAsString string // `json:"normalized_value_as_string"` Meta map[string]interface{} // `json:"meta,omitempty"` }
AggregationPipelineDerivative is the value returned by a Derivative aggregation.
func (*AggregationPipelineDerivative) UnmarshalJSON ¶
func (a *AggregationPipelineDerivative) UnmarshalJSON(data []byte) error
UnmarshalJSON decodes JSON data and initializes an AggregationPipelineDerivative structure.
type AggregationPipelineSimpleValue ¶
type AggregationPipelineSimpleValue struct { Aggregations Value *float64 // `json:"value"` ValueAsString string // `json:"value_as_string"` Meta map[string]interface{} // `json:"meta,omitempty"` }
AggregationPipelineSimpleValue is a simple value, returned e.g. by a MovAvg aggregation.
func (*AggregationPipelineSimpleValue) UnmarshalJSON ¶
func (a *AggregationPipelineSimpleValue) UnmarshalJSON(data []byte) error
UnmarshalJSON decodes JSON data and initializes an AggregationPipelineSimpleValue structure.
type AggregationSingleBucket ¶
type AggregationSingleBucket struct { Aggregations DocCount int64 // `json:"doc_count"` Meta map[string]interface{} // `json:"meta,omitempty"` }
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"` Meta map[string]interface{} // `json:"meta,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"` Meta map[string]interface{} // `json:"meta,omitempty"` }
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"` Meta map[string]interface{} // `json:"meta,omitempty"` }
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 ¶
// Get a client to the local Elasticsearch instance. client, err := elastic.NewClient() 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 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) AvgBucket ¶
func (a Aggregations) AvgBucket(name string) (*AggregationPipelineSimpleValue, bool)
AvgBucket returns average bucket pipeline aggregation results. See https://www.elastic.co/guide/en/elasticsearch/reference/current/search-aggregations-pipeline-avg-bucket-aggregation.html
func (Aggregations) BucketScript ¶
func (a Aggregations) BucketScript(name string) (*AggregationPipelineSimpleValue, bool)
BucketScript returns bucket script pipeline aggregation results. See https://www.elastic.co/guide/en/elasticsearch/reference/current/search-aggregations-pipeline-bucket-script-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) CumulativeSum ¶
func (a Aggregations) CumulativeSum(name string) (*AggregationPipelineSimpleValue, bool)
CumulativeSum returns a cumulative sum pipeline aggregation results. See https://www.elastic.co/guide/en/elasticsearch/reference/current/search-aggregations-pipeline-cumulative-sum-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) Derivative ¶
func (a Aggregations) Derivative(name string) (*AggregationPipelineDerivative, bool)
Derivative returns derivative pipeline aggregation results. See https://www.elastic.co/guide/en/elasticsearch/reference/current/search-aggregations-pipeline-derivative-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) KeyedRange ¶
func (a Aggregations) KeyedRange(name string) (*AggregationBucketKeyedRangeItems, bool)
KeyedRange returns keyed range aggregation results. See http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/search-aggregations-bucket-range-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) MaxBucket ¶
func (a Aggregations) MaxBucket(name string) (*AggregationPipelineBucketMetricValue, bool)
MaxBucket returns maximum bucket pipeline aggregation results. See https://www.elastic.co/guide/en/elasticsearch/reference/current/search-aggregations-pipeline-max-bucket-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) MinBucket ¶
func (a Aggregations) MinBucket(name string) (*AggregationPipelineBucketMetricValue, bool)
MinBucket returns minimum bucket pipeline aggregation results. See https://www.elastic.co/guide/en/elasticsearch/reference/current/search-aggregations-pipeline-min-bucket-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) MovAvg ¶
func (a Aggregations) MovAvg(name string) (*AggregationPipelineSimpleValue, bool)
MovAvg returns moving average pipeline aggregation results. See https://www.elastic.co/guide/en/elasticsearch/reference/current/search-aggregations-pipeline-movavg-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) SerialDiff ¶
func (a Aggregations) SerialDiff(name string) (*AggregationPipelineSimpleValue, bool)
SerialDiff returns serial differencing pipeline aggregation results. See https://www.elastic.co/guide/en/elasticsearch/reference/current/search-aggregations-pipeline-serialdiff-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) SumBucket ¶
func (a Aggregations) SumBucket(name string) (*AggregationPipelineSimpleValue, bool)
SumBucket returns sum bucket pipeline aggregation results. See https://www.elastic.co/guide/en/elasticsearch/reference/current/search-aggregations-pipeline-sum-bucket-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 Query) *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) Do ¶
func (s *AliasesService) Do() (*AliasesResult, error)
func (*AliasesService) Index ¶
func (s *AliasesService) Index(indices ...string) *AliasesService
func (*AliasesService) Pretty ¶
func (s *AliasesService) Pretty(pretty bool) *AliasesService
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) Meta ¶
func (a *AvgAggregation) Meta(metaData map[string]interface{}) *AvgAggregation
Meta sets the meta data to be included in the aggregation response.
func (*AvgAggregation) Script ¶
func (a *AvgAggregation) Script(script *Script) *AvgAggregation
func (*AvgAggregation) Source ¶
func (a *AvgAggregation) Source() (interface{}, error)
func (*AvgAggregation) SubAggregation ¶
func (a *AvgAggregation) SubAggregation(name string, subAggregation Aggregation) *AvgAggregation
type AvgBucketAggregation ¶
type AvgBucketAggregation struct {
// contains filtered or unexported fields
}
AvgBucketAggregation is a sibling pipeline aggregation which calculates the (mean) average value of a specified metric in a sibling aggregation. The specified metric must be numeric and the sibling aggregation must be a multi-bucket aggregation.
For more details, see https://www.elastic.co/guide/en/elasticsearch/reference/current/search-aggregations-pipeline-avg-bucket-aggregation.html
func NewAvgBucketAggregation ¶
func NewAvgBucketAggregation() *AvgBucketAggregation
NewAvgBucketAggregation creates and initializes a new AvgBucketAggregation.
func (*AvgBucketAggregation) BucketsPath ¶
func (a *AvgBucketAggregation) BucketsPath(bucketsPaths ...string) *AvgBucketAggregation
BucketsPath sets the paths to the buckets to use for this pipeline aggregator.
func (*AvgBucketAggregation) Format ¶
func (a *AvgBucketAggregation) Format(format string) *AvgBucketAggregation
func (*AvgBucketAggregation) GapInsertZeros ¶
func (a *AvgBucketAggregation) GapInsertZeros() *AvgBucketAggregation
GapInsertZeros inserts zeros for gaps in the series.
func (*AvgBucketAggregation) GapPolicy ¶
func (a *AvgBucketAggregation) GapPolicy(gapPolicy string) *AvgBucketAggregation
GapPolicy defines what should be done when a gap in the series is discovered. Valid values include "insert_zeros" or "skip". Default is "insert_zeros".
func (*AvgBucketAggregation) GapSkip ¶
func (a *AvgBucketAggregation) GapSkip() *AvgBucketAggregation
GapSkip skips gaps in the series.
func (*AvgBucketAggregation) Meta ¶
func (a *AvgBucketAggregation) Meta(metaData map[string]interface{}) *AvgBucketAggregation
Meta sets the meta data to be included in the aggregation response.
func (*AvgBucketAggregation) Source ¶
func (a *AvgBucketAggregation) Source() (interface{}, error)
func (*AvgBucketAggregation) SubAggregation ¶
func (a *AvgBucketAggregation) SubAggregation(name string, subAggregation Aggregation) *AvgBucketAggregation
SubAggregation adds a sub-aggregation to this aggregation.
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) MinimumNumberShouldMatch ¶
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{}, error)
Creates the query source for the boosting query.
type BucketScriptAggregation ¶
type BucketScriptAggregation struct {
// contains filtered or unexported fields
}
BucketScriptAggregation is a parent pipeline aggregation which executes a script which can perform per bucket computations on specified metrics in the parent multi-bucket aggregation. The specified metric must be numeric and the script must return a numeric value.
For more details, see https://www.elastic.co/guide/en/elasticsearch/reference/current/search-aggregations-pipeline-bucket-script-aggregation.html
func NewBucketScriptAggregation ¶
func NewBucketScriptAggregation() *BucketScriptAggregation
NewBucketScriptAggregation creates and initializes a new BucketScriptAggregation.
func (*BucketScriptAggregation) AddBucketsPath ¶
func (a *BucketScriptAggregation) AddBucketsPath(name, path string) *BucketScriptAggregation
AddBucketsPath adds a bucket path to use for this pipeline aggregator.
func (*BucketScriptAggregation) BucketsPathsMap ¶
func (a *BucketScriptAggregation) BucketsPathsMap(bucketsPathsMap map[string]string) *BucketScriptAggregation
BucketsPathsMap sets the paths to the buckets to use for this pipeline aggregator.
func (*BucketScriptAggregation) Format ¶
func (a *BucketScriptAggregation) Format(format string) *BucketScriptAggregation
func (*BucketScriptAggregation) GapInsertZeros ¶
func (a *BucketScriptAggregation) GapInsertZeros() *BucketScriptAggregation
GapInsertZeros inserts zeros for gaps in the series.
func (*BucketScriptAggregation) GapPolicy ¶
func (a *BucketScriptAggregation) GapPolicy(gapPolicy string) *BucketScriptAggregation
GapPolicy defines what should be done when a gap in the series is discovered. Valid values include "insert_zeros" or "skip". Default is "insert_zeros".
func (*BucketScriptAggregation) GapSkip ¶
func (a *BucketScriptAggregation) GapSkip() *BucketScriptAggregation
GapSkip skips gaps in the series.
func (*BucketScriptAggregation) Meta ¶
func (a *BucketScriptAggregation) Meta(metaData map[string]interface{}) *BucketScriptAggregation
Meta sets the meta data to be included in the aggregation response.
func (*BucketScriptAggregation) Script ¶
func (a *BucketScriptAggregation) Script(script *Script) *BucketScriptAggregation
Script is the script to run.
func (*BucketScriptAggregation) Source ¶
func (a *BucketScriptAggregation) Source() (interface{}, error)
func (*BucketScriptAggregation) SubAggregation ¶
func (a *BucketScriptAggregation) SubAggregation(name string, subAggregation Aggregation) *BucketScriptAggregation
SubAggregation adds a sub-aggregation to this aggregation.
type BucketSelectorAggregation ¶
type BucketSelectorAggregation struct {
// contains filtered or unexported fields
}
BucketSelectorAggregation is a parent pipeline aggregation which determines whether the current bucket will be retained in the parent multi-bucket aggregation. The specific metric must be numeric and the script must return a boolean value. If the script language is expression then a numeric return value is permitted. In this case 0.0 will be evaluated as false and all other values will evaluate to true.
For more details, see https://www.elastic.co/guide/en/elasticsearch/reference/current/search-aggregations-pipeline-bucket-selector-aggregation.html
func NewBucketSelectorAggregation ¶
func NewBucketSelectorAggregation() *BucketSelectorAggregation
NewBucketSelectorAggregation creates and initializes a new BucketSelectorAggregation.
func (*BucketSelectorAggregation) AddBucketsPath ¶
func (a *BucketSelectorAggregation) AddBucketsPath(name, path string) *BucketSelectorAggregation
AddBucketsPath adds a bucket path to use for this pipeline aggregator.
func (*BucketSelectorAggregation) BucketsPathsMap ¶
func (a *BucketSelectorAggregation) BucketsPathsMap(bucketsPathsMap map[string]string) *BucketSelectorAggregation
BucketsPathsMap sets the paths to the buckets to use for this pipeline aggregator.
func (*BucketSelectorAggregation) Format ¶
func (a *BucketSelectorAggregation) Format(format string) *BucketSelectorAggregation
func (*BucketSelectorAggregation) GapInsertZeros ¶
func (a *BucketSelectorAggregation) GapInsertZeros() *BucketSelectorAggregation
GapInsertZeros inserts zeros for gaps in the series.
func (*BucketSelectorAggregation) GapPolicy ¶
func (a *BucketSelectorAggregation) GapPolicy(gapPolicy string) *BucketSelectorAggregation
GapPolicy defines what should be done when a gap in the series is discovered. Valid values include "insert_zeros" or "skip". Default is "insert_zeros".
func (*BucketSelectorAggregation) GapSkip ¶
func (a *BucketSelectorAggregation) GapSkip() *BucketSelectorAggregation
GapSkip skips gaps in the series.
func (*BucketSelectorAggregation) Meta ¶
func (a *BucketSelectorAggregation) Meta(metaData map[string]interface{}) *BucketSelectorAggregation
Meta sets the meta data to be included in the aggregation response.
func (*BucketSelectorAggregation) Script ¶
func (a *BucketSelectorAggregation) Script(script *Script) *BucketSelectorAggregation
Script is the script to run.
func (*BucketSelectorAggregation) Source ¶
func (a *BucketSelectorAggregation) Source() (interface{}, error)
func (*BucketSelectorAggregation) SubAggregation ¶
func (a *BucketSelectorAggregation) SubAggregation(name string, subAggregation Aggregation) *BucketSelectorAggregation
SubAggregation adds a sub-aggregation to this aggregation.
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) Succeeded ¶
func (r *BulkResponse) Succeeded() []*BulkResponseItem
Succeeded returns those items of a bulk response that have no errors, i.e. those have a status code between 200 and 299.
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 *ErrorDetails `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) 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 *Script) *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 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) Meta ¶
func (a *CardinalityAggregation) Meta(metaData map[string]interface{}) *CardinalityAggregation
Meta sets the meta data to be included in the aggregation response.
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 *Script) *CardinalityAggregation
func (*CardinalityAggregation) Source ¶
func (a *CardinalityAggregation) Source() (interface{}, error)
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) Meta ¶
func (a *ChildrenAggregation) Meta(metaData map[string]interface{}) *ChildrenAggregation
Meta sets the meta data to be included in the aggregation response.
func (*ChildrenAggregation) Source ¶
func (a *ChildrenAggregation) Source() (interface{}, error)
func (*ChildrenAggregation) SubAggregation ¶
func (a *ChildrenAggregation) SubAggregation(name string, subAggregation Aggregation) *ChildrenAggregation
func (*ChildrenAggregation) Type ¶
func (a *ChildrenAggregation) Type(typ string) *ChildrenAggregation
type ClearScrollResponse ¶
type ClearScrollResponse struct { }
ClearScrollResponse is the response of ClearScrollService.Do.
type ClearScrollService ¶
type ClearScrollService struct {
// contains filtered or unexported fields
}
ClearScrollService clears one or more scroll contexts by their ids.
See https://www.elastic.co/guide/en/elasticsearch/reference/current/search-request-scroll.html#_clear_scroll_api for details.
func NewClearScrollService ¶
func NewClearScrollService(client *Client) *ClearScrollService
NewClearScrollService creates a new ClearScrollService.
func (*ClearScrollService) Do ¶
func (s *ClearScrollService) Do() (*ClearScrollResponse, error)
Do executes the operation.
func (*ClearScrollService) Pretty ¶
func (s *ClearScrollService) Pretty(pretty bool) *ClearScrollService
Pretty indicates that the JSON response be indented and human readable.
func (*ClearScrollService) ScrollId ¶
func (s *ClearScrollService) ScrollId(scrollIds ...string) *ClearScrollService
ScrollId is a list of scroll IDs to clear. Use _all to clear all search contexts.
func (*ClearScrollService) Validate ¶
func (s *ClearScrollService) Validate() error
Validate checks if the operation is valid.
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client is an Elasticsearch client. Create one by calling NewClient.
func NewClient ¶
func NewClient(options ...ClientOptionFunc) (*Client, error)
NewClient creates a new client to work with Elasticsearch.
The caller can configure the new client by passing configuration options to the func.
Example:
client, err := elastic.NewClient( elastic.SetURL("http://127.0.0.1:9200", "http://127.0.0.1:9201"), elastic.SetMaxRetries(10), elastic.SetBasicAuth("user", "secret"))
If no URL is configured, Elastic uses DefaultURL by default.
If the sniffer is enabled (the default), the new client then sniffes the cluster via the Nodes Info API (see http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/cluster-nodes-info.html#cluster-nodes-info). It uses the URLs specified by the caller. The caller is responsible to only pass a list of URLs of nodes that belong to the same cluster. This sniffing process is run on startup and periodically. Use SnifferInterval to set the interval between two sniffs (default is 15 minutes). In other words: By default, the client will find new nodes in the cluster and remove those that are no longer available every 15 minutes. Disable the sniffer by passing SetSniff(false) to NewClient.
The list of nodes found in the sniffing process will be used to make connections to the REST API of Elasticsearch. These nodes are also periodically checked in a shorter time frame. This process is called a health check. By default, a health check is done every 60 seconds. You can set a shorter or longer interval by SetHealthcheckInterval. Disabling health checks is not recommended, but can be done by SetHealthcheck(false).
Connections are automatically marked as dead or healthy while making requests to Elasticsearch. When a request fails, Elastic will retry up to a maximum number of retries configured with SetMaxRetries. Retries are disabled by default.
If no HttpClient is configured, then http.DefaultClient is used. You can use your own http.Client with some http.Transport for advanced scenarios.
An error is also returned when some configuration option is invalid or the new client cannot sniff the cluster (if enabled).
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) ClearScroll ¶
func (c *Client) ClearScroll(scrollIds ...string) *ClearScrollService
ClearScroll can be used to clear search contexts manually.
func (*Client) CloseIndex ¶
func (c *Client) CloseIndex(name string) *IndicesCloseService
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) ClusterStats ¶
func (c *Client) ClusterStats() *ClusterStatsService
ClusterStats retrieves cluster statistics.
func (*Client) CreateIndex ¶
func (c *Client) CreateIndex(name string) *IndicesCreateService
CreateIndex returns a service to create a new index.
func (*Client) DeleteByQuery ¶
func (c *Client) DeleteByQuery(indices ...string) *DeleteByQueryService
DeleteByQuery deletes documents as found by a query.
func (*Client) DeleteIndex ¶
func (c *Client) DeleteIndex(indices ...string) *IndicesDeleteService
DeleteIndex returns a service to delete an index.
func (*Client) DeleteTemplate ¶
func (c *Client) DeleteTemplate() *DeleteTemplateService
DeleteTemplate deletes a search template. Use IndexXXXTemplate funcs to manage index templates.
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) Explain ¶
func (c *Client) Explain(index, typ, id string) *ExplainService
Explain computes a score explanation for a query and a specific document.
func (*Client) Flush ¶
func (c *Client) Flush(indices ...string) *IndicesFlushService
Flush asks Elasticsearch to free memory from the index and flush data to disk.
func (*Client) Forcemerge ¶
func (c *Client) Forcemerge(indices ...string) *IndicesForcemergeService
Forcemerge optimizes one or more indices. It replaces the deprecated Optimize API.
func (*Client) GetMapping ¶
func (c *Client) GetMapping() *GetMappingService
GetMapping gets a mapping.
func (*Client) GetTemplate ¶
func (c *Client) GetTemplate() *GetTemplateService
GetTemplate gets a search template. Use IndexXXXTemplate funcs to manage index templates.
func (*Client) IndexDeleteTemplate ¶
func (c *Client) IndexDeleteTemplate(name string) *IndicesDeleteTemplateService
IndexDeleteTemplate deletes an index template. Use XXXTemplate funcs to manage search templates.
func (*Client) IndexExists ¶
func (c *Client) IndexExists(indices ...string) *IndicesExistsService
IndexExists allows to check if an index exists.
func (*Client) IndexGet ¶
func (c *Client) IndexGet(indices ...string) *IndicesGetService
IndexGet retrieves information about one or more indices. IndexGet is only available for Elasticsearch 1.4 or later.
func (*Client) IndexGetSettings ¶
func (c *Client) IndexGetSettings(indices ...string) *IndicesGetSettingsService
IndexGetSettings retrieves settings about one or more indices.
func (*Client) IndexGetTemplate ¶
func (c *Client) IndexGetTemplate(names ...string) *IndicesGetTemplateService
IndexGetTemplate gets an index template. Use XXXTemplate funcs to manage search templates.
func (*Client) IndexNames ¶
IndexNames returns the names of all indices in the cluster.
func (*Client) IndexPutTemplate ¶
func (c *Client) IndexPutTemplate(name string) *IndicesPutTemplateService
IndexPutTemplate creates or updates an index template. Use XXXTemplate funcs to manage search templates.
func (*Client) IndexStats ¶
func (c *Client) IndexStats(indices ...string) *IndicesStatsService
IndexStats provides statistics on different operations happining in one or more indices.
func (*Client) IndexTemplateExists ¶
func (c *Client) IndexTemplateExists(name string) *IndicesExistsTemplateService
IndexTemplateExists gets check if an index template exists. Use XXXTemplate funcs to manage search templates.
func (*Client) IsRunning ¶
IsRunning returns true if the background processes of the client are running, false otherwise.
func (*Client) Mget ¶
func (c *Client) Mget() *MgetService
Mget retrieves multiple documents in one roundtrip.
func (*Client) MultiGet ¶
func (c *Client) MultiGet() *MgetService
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) NodesInfo ¶
func (c *Client) NodesInfo() *NodesInfoService
NodesInfo retrieves one or more or all of the cluster nodes information.
func (*Client) OpenIndex ¶
func (c *Client) OpenIndex(name string) *IndicesOpenService
OpenIndex opens an index.
func (*Client) Optimize ¶
func (c *Client) Optimize(indices ...string) *OptimizeService
Optimize asks Elasticsearch to optimize one or more indices. Optimize is deprecated as of Elasticsearch 2.1 and replaced by Forcemerge.
func (*Client) Percolate ¶
func (c *Client) Percolate() *PercolateService
Percolate allows to send a document and return matching queries. See http://www.elastic.co/guide/en/elasticsearch/reference/current/search-percolate.html.
func (*Client) PerformRequest ¶
func (c *Client) PerformRequest(method, path string, params url.Values, body interface{}, ignoreErrors ...int) (*Response, error)
PerformRequest does a HTTP request to Elasticsearch. It returns a response and an error on failure.
Optionally, a list of HTTP error codes to ignore can be passed. This is necessary for services that expect e.g. HTTP status 404 as a valid outcome (Exists, IndicesExists, IndicesTypeExists).
func (*Client) Ping ¶
func (c *Client) Ping(url string) *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.
Notice that you need to specify a URL here explicitly.
func (*Client) PutMapping ¶
func (c *Client) PutMapping() *PutMappingService
PutMapping registers a mapping.
func (*Client) PutTemplate ¶
func (c *Client) PutTemplate() *PutTemplateService
PutTemplate creates or updates a search template. Use IndexXXXTemplate funcs to manage index templates.
func (*Client) Refresh ¶
func (c *Client) Refresh(indices ...string) *RefreshService
Refresh asks Elasticsearch to refresh one or more indices.
func (*Client) Reindex ¶
Reindex returns a service that will reindex documents from a source index into a target index. See http://www.elastic.co/guide/en/elasticsearch/guide/current/reindex.html for more information about reindexing.
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) Start ¶
func (c *Client) Start()
Start starts the background processes like sniffing the cluster and periodic health checks. You don't need to run Start when creating a client with NewClient; the background processes are run by default.
If the background processes are already running, this is a no-op.
func (*Client) Stop ¶
func (c *Client) Stop()
Stop stops the background processes that the client is running, i.e. sniffing the cluster periodically and running health checks on the nodes.
If the background processes are not running, this is a no-op.
func (*Client) Suggest ¶
func (c *Client) Suggest(indices ...string) *SuggestService
Suggest returns a service to return suggestions.
func (*Client) TermVectors ¶
func (c *Client) TermVectors(index, typ string) *TermvectorsService
TermVectors returns information and statistics on terms in the fields of a particular document.
func (*Client) TypeExists ¶
func (c *Client) TypeExists() *IndicesExistsTypeService
TypeExists allows to check if one or more types exist in one or more indices.
func (*Client) WaitForGreenStatus ¶
WaitForGreenStatus waits for the cluster to have the "green" status. See WaitForStatus for more details.
func (*Client) WaitForStatus ¶
WaitForStatus waits for the cluster to have the given status. This is a shortcut method for the ClusterHealth service.
WaitForStatus waits for the specified timeout, e.g. "10s". If the cluster will have the given state within the timeout, nil is returned. If the request timed out, ErrTimeout is returned.
func (*Client) WaitForYellowStatus ¶
WaitForYellowStatus waits for the cluster to have the "yellow" status. See WaitForStatus for more details.
type ClientOptionFunc ¶
ClientOptionFunc is a function that configures a Client. It is used in NewClient.
func SetBasicAuth ¶
func SetBasicAuth(username, password string) ClientOptionFunc
SetBasicAuth can be used to specify the HTTP Basic Auth credentials to use when making HTTP requests to Elasticsearch.
func SetGzip ¶
func SetGzip(enabled bool) ClientOptionFunc
SetGzip enables or disables gzip compression (disabled by default).
func SetHealthcheck ¶
func SetHealthcheck(enabled bool) ClientOptionFunc
SetHealthcheck enables or disables healthchecks (enabled by default).
func SetHealthcheckInterval ¶
func SetHealthcheckInterval(interval time.Duration) ClientOptionFunc
SetHealthcheckInterval sets the interval between two health checks. The default interval is 60 seconds.
func SetHealthcheckTimeout ¶
func SetHealthcheckTimeout(timeout time.Duration) ClientOptionFunc
SetHealthcheckTimeout sets the timeout for periodic health checks. The default timeout is 1 second (see DefaultHealthcheckTimeout). Notice that a different (usually larger) timeout is used for the initial healthcheck, which is initiated while creating a new client. The startup timeout can be modified with SetHealthcheckTimeoutStartup.
func SetHealthcheckTimeoutStartup ¶
func SetHealthcheckTimeoutStartup(timeout time.Duration) ClientOptionFunc
SetHealthcheckTimeoutStartup sets the timeout for the initial health check. The default timeout is 5 seconds (see DefaultHealthcheckTimeoutStartup). Notice that timeouts for subsequent health checks can be modified with SetHealthcheckTimeout.
func SetHttpClient ¶
func SetHttpClient(httpClient *http.Client) ClientOptionFunc
SetHttpClient can be used to specify the http.Client to use when making HTTP requests to Elasticsearch.
func SetRequiredPlugins ¶
func SetRequiredPlugins(plugins ...string) ClientOptionFunc
SetRequiredPlugins can be used to indicate that some plugins are required before a Client will be created.
func SetScheme ¶
func SetScheme(scheme string) ClientOptionFunc
SetScheme sets the HTTP scheme to look for when sniffing (http or https). This is http by default.
func SetSniff ¶
func SetSniff(enabled bool) ClientOptionFunc
SetSniff enables or disables the sniffer (enabled by default).
func SetSnifferInterval ¶
func SetSnifferInterval(interval time.Duration) ClientOptionFunc
SetSnifferInterval sets the interval between two sniffing processes. The default interval is 15 minutes.
func SetSnifferTimeout ¶
func SetSnifferTimeout(timeout time.Duration) ClientOptionFunc
SetSnifferTimeout sets the timeout for the sniffer that finds the nodes in a cluster. The default is 2 seconds. Notice that the timeout used when creating a new client on startup is usually greater and can be set with SetSnifferTimeoutStartup.
func SetSnifferTimeoutStartup ¶
func SetSnifferTimeoutStartup(timeout time.Duration) ClientOptionFunc
SetSnifferTimeoutStartup sets the timeout for the sniffer that is used when creating a new client. The default is 5 seconds. Notice that the timeout being used for subsequent sniffing processes is set with SetSnifferTimeout.
func SetURL ¶
func SetURL(urls ...string) ClientOptionFunc
SetURL defines the URL endpoints of the Elasticsearch nodes. Notice that when sniffing is enabled, these URLs are used to initially sniff the cluster on startup.
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"` InitializingShards int `json:"initializing_shards"` UnassignedShards int `json:"unassigned_shards"` DelayedUnassignedShards int `json:"delayed_unassigned_shards"` NumberOfPendingTasks int `json:"number_of_pending_tasks"` NumberOfInFlightFetch int `json:"number_of_in_flight_fetch"` TaskMaxWaitTimeInQueueInMillis int `json:"task_max_waiting_in_queue_millis"` ActiveShardsPercentAsNumber float64 `json:"active_shards_percent_as_number"` // Validation failures -> index name -> array of validation failures ValidationFailures []map[string][]string `json:"validation_failures"` // Index name -> index health Indices map[string]*ClusterIndexHealth `json:"indices"` }
ClusterHealthResponse is the response of ClusterHealthService.Do.
type ClusterHealthService ¶
type ClusterHealthService struct {
// contains filtered or unexported fields
}
ClusterHealthService allows to get a very simple status on the health of the cluster.
See http://www.elastic.co/guide/en/elasticsearch/reference/current/cluster-health.html for details.
Example ¶
client, err := elastic.NewClient() 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(indices ...string) *ClusterHealthService
Index 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
MasterTimeout specifies an explicit operation timeout for connection to master node.
func (*ClusterHealthService) Pretty ¶
func (s *ClusterHealthService) Pretty(pretty bool) *ClusterHealthService
Pretty indicates that the JSON response be indented and human readable.
func (*ClusterHealthService) Timeout ¶
func (s *ClusterHealthService) Timeout(timeout string) *ClusterHealthService
Timeout specifies an explicit operation timeout.
func (*ClusterHealthService) Validate ¶
func (s *ClusterHealthService) Validate() error
Validate checks if the operation is valid.
func (*ClusterHealthService) WaitForActiveShards ¶
func (s *ClusterHealthService) WaitForActiveShards(waitForActiveShards int) *ClusterHealthService
WaitForActiveShards can be used to wait until the specified number of shards are active.
func (*ClusterHealthService) WaitForGreenStatus ¶
func (s *ClusterHealthService) WaitForGreenStatus() *ClusterHealthService
WaitForGreenStatus will wait for the "green" state.
func (*ClusterHealthService) WaitForNodes ¶
func (s *ClusterHealthService) WaitForNodes(waitForNodes string) *ClusterHealthService
WaitForNodes can be used to wait until the specified number of nodes are available. Example: "12" to wait for exact values, ">12" and "<12" for ranges.
func (*ClusterHealthService) WaitForRelocatingShards ¶
func (s *ClusterHealthService) WaitForRelocatingShards(waitForRelocatingShards int) *ClusterHealthService
WaitForRelocatingShards can be used to wait until the specified number of relocating shards is finished.
func (*ClusterHealthService) WaitForStatus ¶
func (s *ClusterHealthService) WaitForStatus(waitForStatus string) *ClusterHealthService
WaitForStatus can be used to wait until the cluster is in a specific state. Valid values are: green, yellow, or red.
func (*ClusterHealthService) WaitForYellowStatus ¶
func (s *ClusterHealthService) WaitForYellowStatus() *ClusterHealthService
WaitForYellowStatus will wait for the "yellow" state.
type ClusterIndexHealth ¶
type ClusterIndexHealth struct { Status string `json:"status"` NumberOfShards int `json:"number_of_shards"` NumberOfReplicas int `json:"number_of_replicas"` ActivePrimaryShards int `json:"active_primary_shards"` ActiveShards int `json:"active_shards"` RelocatingShards int `json:"relocating_shards"` InitializingShards int `json:"initializing_shards"` UnassignedShards int `json:"unassigned_shards"` // Validation failures ValidationFailures []string `json:"validation_failures"` // Shards by id, e.g. "0" or "1" Shards map[string]*ClusterShardHealth `json:"shards"` }
ClusterIndexHealth will be returned as part of ClusterHealthResponse.
type ClusterShardHealth ¶
type ClusterShardHealth struct { Status string `json:"status"` PrimaryActive bool `json:"primary_active"` ActiveShards int `json:"active_shards"` RelocatingShards int `json:"relocating_shards"` InitializingShards int `json:"initializing_shards"` UnassignedShards int `json:"unassigned_shards"` }
ClusterShardHealth will be returned as part of ClusterHealthResponse.
type ClusterStateResponse ¶
type ClusterStateResponse struct { ClusterName string `json:"cluster_name"` Version int64 `json:"version"` StateUUID string `json:"state_uuid"` MasterNode string `json:"master_node"` Blocks map[string]*clusterBlocks `json:"blocks"` Nodes map[string]*discoveryNode `json:"nodes"` Metadata *clusterStateMetadata `json:"metadata"` RoutingTable map[string]*clusterStateRoutingTable `json:"routing_table"` RoutingNodes *clusterStateRoutingNode `json:"routing_nodes"` Customs map[string]interface{} `json:"customs"` }
ClusterStateResponse is the response of ClusterStateService.Do.
type ClusterStateService ¶
type ClusterStateService struct {
// contains filtered or unexported fields
}
ClusterStateService allows to get a comprehensive state information of the whole cluster.
See https://www.elastic.co/guide/en/elasticsearch/reference/current/cluster-state.html for details.
Example ¶
client, err := elastic.NewClient() if err != nil { panic(err) } // Get cluster state res, err := client.ClusterState().Metric("version").Do() if err != nil { panic(err) } fmt.Printf("Cluster %q has version %d", res.ClusterName, res.Version)
Output:
func NewClusterStateService ¶
func NewClusterStateService(client *Client) *ClusterStateService
NewClusterStateService creates a new ClusterStateService.
func (*ClusterStateService) AllowNoIndices ¶
func (s *ClusterStateService) AllowNoIndices(allowNoIndices bool) *ClusterStateService
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 (*ClusterStateService) Do ¶
func (s *ClusterStateService) Do() (*ClusterStateResponse, error)
Do executes the operation.
func (*ClusterStateService) ExpandWildcards ¶
func (s *ClusterStateService) ExpandWildcards(expandWildcards string) *ClusterStateService
ExpandWildcards indicates whether to expand wildcard expression to concrete indices that are open, closed or both..
func (*ClusterStateService) FlatSettings ¶
func (s *ClusterStateService) FlatSettings(flatSettings bool) *ClusterStateService
FlatSettings, when set, returns settings in flat format (default: false).
func (*ClusterStateService) IgnoreUnavailable ¶
func (s *ClusterStateService) IgnoreUnavailable(ignoreUnavailable bool) *ClusterStateService
IgnoreUnavailable indicates whether specified concrete indices should be ignored when unavailable (missing or closed).
func (*ClusterStateService) Index ¶
func (s *ClusterStateService) Index(indices ...string) *ClusterStateService
Index is a list of index names. Use _all or an empty string to perform the operation on all indices.
func (*ClusterStateService) Local ¶
func (s *ClusterStateService) Local(local bool) *ClusterStateService
Local indicates whether to return local information. When set, it does not retrieve the state from master node (default: false).
func (*ClusterStateService) MasterTimeout ¶
func (s *ClusterStateService) MasterTimeout(masterTimeout string) *ClusterStateService
MasterTimeout specifies timeout for connection to master.
func (*ClusterStateService) Metric ¶
func (s *ClusterStateService) Metric(metrics ...string) *ClusterStateService
Metric limits the information returned to the specified metric. It can be one of: version, master_node, nodes, routing_table, metadata, blocks, or customs.
func (*ClusterStateService) Pretty ¶
func (s *ClusterStateService) Pretty(pretty bool) *ClusterStateService
Pretty indicates that the JSON response be indented and human readable.
func (*ClusterStateService) Validate ¶
func (s *ClusterStateService) Validate() error
Validate checks if the operation is valid.
type ClusterStatsIndices ¶
type ClusterStatsIndices struct { Count int `json:"count"` Shards *ClusterStatsIndicesShards `json:"shards"` Docs *ClusterStatsIndicesDocs `json:"docs"` Store *ClusterStatsIndicesStore `json:"store"` FieldData *ClusterStatsIndicesFieldData `json:"fielddata"` FilterCache *ClusterStatsIndicesFilterCache `json:"filter_cache"` IdCache *ClusterStatsIndicesIdCache `json:"id_cache"` Completion *ClusterStatsIndicesCompletion `json:"completion"` Segments *ClusterStatsIndicesSegments `json:"segments"` Percolate *ClusterStatsIndicesPercolate `json:"percolate"` }
type ClusterStatsIndicesDocs ¶
type ClusterStatsIndicesFieldData ¶
type ClusterStatsIndicesFieldData struct { MemorySize string `json:"memory_size"` // e.g. "61.3kb" MemorySizeInBytes int64 `json:"memory_size_in_bytes"` Evictions int64 `json:"evictions"` Fields map[string]struct { MemorySize string `json:"memory_size"` // e.g. "61.3kb" MemorySizeInBytes int64 `json:"memory_size_in_bytes"` } `json:"fields"` }
type ClusterStatsIndicesPercolate ¶
type ClusterStatsIndicesPercolate struct { Total int64 `json:"total"` // TODO(oe) The JSON tag here is wrong as of ES 1.5.2 it seems Time string `json:"get_time"` // e.g. "1s" TimeInBytes int64 `json:"time_in_millis"` Current int64 `json:"current"` MemorySize string `json:"memory_size"` // e.g. "61.3kb" MemorySizeInBytes int64 `json:"memory_sitze_in_bytes"` Queries int64 `json:"queries"` }
type ClusterStatsIndicesSegments ¶
type ClusterStatsIndicesSegments struct { Count int64 `json:"count"` Memory string `json:"memory"` // e.g. "61.3kb" MemoryInBytes int64 `json:"memory_in_bytes"` IndexWriterMemory string `json:"index_writer_memory"` // e.g. "61.3kb" IndexWriterMemoryInBytes int64 `json:"index_writer_memory_in_bytes"` IndexWriterMaxMemory string `json:"index_writer_max_memory"` // e.g. "61.3kb" IndexWriterMaxMemoryInBytes int64 `json:"index_writer_max_memory_in_bytes"` VersionMapMemory string `json:"version_map_memory"` // e.g. "61.3kb" VersionMapMemoryInBytes int64 `json:"version_map_memory_in_bytes"` FixedBitSet string `json:"fixed_bit_set"` // e.g. "61.3kb" FixedBitSetInBytes int64 `json:"fixed_bit_set_memory_in_bytes"` }
type ClusterStatsIndicesShards ¶
type ClusterStatsIndicesShards struct { Total int `json:"total"` Primaries int `json:"primaries"` Replication float64 `json:"replication"` Index *ClusterStatsIndicesShardsIndex `json:"index"` }
type ClusterStatsIndicesShardsIndex ¶
type ClusterStatsIndicesShardsIndex struct { Shards *ClusterStatsIndicesShardsIndexIntMinMax `json:"shards"` Primaries *ClusterStatsIndicesShardsIndexIntMinMax `json:"primaries"` Replication *ClusterStatsIndicesShardsIndexFloat64MinMax `json:"replication"` }
type ClusterStatsNodes ¶
type ClusterStatsNodes struct { Count *ClusterStatsNodesCounts `json:"counts"` Versions []string `json:"versions"` OS *ClusterStatsNodesOsStats `json:"os"` Process *ClusterStatsNodesProcessStats `json:"process"` JVM *ClusterStatsNodesJvmStats `json:"jvm"` FS *ClusterStatsNodesFsStats `json:"fs"` Plugins []*ClusterStatsNodesPlugin `json:"plugins"` }
type ClusterStatsNodesCounts ¶
type ClusterStatsNodesFsStats ¶
type ClusterStatsNodesFsStats struct { Path string `json:"path"` Mount string `json:"mount"` Dev string `json:"dev"` Total string `json:"total"` // e.g. "930.7gb"` TotalInBytes int64 `json:"total_in_bytes"` Free string `json:"free"` // e.g. "930.7gb"` FreeInBytes int64 `json:"free_in_bytes"` Available string `json:"available"` // e.g. "930.7gb"` AvailableInBytes int64 `json:"available_in_bytes"` DiskReads int64 `json:"disk_reads"` DiskWrites int64 `json:"disk_writes"` DiskIOOp int64 `json:"disk_io_op"` DiskReadSize string `json:"disk_read_size"` // e.g. "0b"` DiskReadSizeInBytes int64 `json:"disk_read_size_in_bytes"` DiskWriteSize string `json:"disk_write_size"` // e.g. "0b"` DiskWriteSizeInBytes int64 `json:"disk_write_size_in_bytes"` DiskIOSize string `json:"disk_io_size"` // e.g. "0b"` DiskIOSizeInBytes int64 `json:"disk_io_size_in_bytes"` DiskQueue string `json:"disk_queue"` DiskServiceTime string `json:"disk_service_time"` }
type ClusterStatsNodesJvmStats ¶
type ClusterStatsNodesJvmStats struct { MaxUptime string `json:"max_uptime"` // e.g. "5h" MaxUptimeInMillis int64 `json:"max_uptime_in_millis"` Versions []*ClusterStatsNodesJvmStatsVersion `json:"versions"` Mem *ClusterStatsNodesJvmStatsMem `json:"mem"` Threads int64 `json:"threads"` }
type ClusterStatsNodesJvmStatsVersion ¶
type ClusterStatsNodesJvmStatsVersion struct { Version string `json:"version"` // e.g. "1.8.0_45" VMName string `json:"vm_name"` // e.g. "Java HotSpot(TM) 64-Bit Server VM" VMVersion string `json:"vm_version"` // e.g. "25.45-b02" VMVendor string `json:"vm_vendor"` // e.g. "Oracle Corporation" Count int `json:"count"` }
type ClusterStatsNodesOsStats ¶
type ClusterStatsNodesOsStats struct { AvailableProcessors int `json:"available_processors"` Mem *ClusterStatsNodesOsStatsMem `json:"mem"` CPU []*ClusterStatsNodesOsStatsCPU `json:"cpu"` }
type ClusterStatsNodesOsStatsCPU ¶
type ClusterStatsNodesOsStatsCPU struct { Vendor string `json:"vendor"` Model string `json:"model"` MHz int `json:"mhz"` TotalCores int `json:"total_cores"` TotalSockets int `json:"total_sockets"` CoresPerSocket int `json:"cores_per_socket"` CacheSize string `json:"cache_size"` // e.g. "256b" CacheSizeInBytes int64 `json:"cache_size_in_bytes"` Count int `json:"count"` }
type ClusterStatsNodesPlugin ¶
type ClusterStatsNodesProcessStats ¶
type ClusterStatsNodesProcessStats struct { CPU *ClusterStatsNodesProcessStatsCPU `json:"cpu"` OpenFileDescriptors *ClusterStatsNodesProcessStatsOpenFileDescriptors `json:"open_file_descriptors"` }
type ClusterStatsNodesProcessStatsCPU ¶
type ClusterStatsNodesProcessStatsCPU struct {
Percent float64 `json:"percent"`
}
type ClusterStatsResponse ¶
type ClusterStatsResponse struct { Timestamp int64 `json:"timestamp"` ClusterName string `json:"cluster_name"` ClusterUUID string `json:"uuid"` Status string `json:"status"` Indices *ClusterStatsIndices `json:"indices"` Nodes *ClusterStatsNodes `json:"nodes"` }
ClusterStatsResponse is the response of ClusterStatsService.Do.
type ClusterStatsService ¶
type ClusterStatsService struct {
// contains filtered or unexported fields
}
ClusterStatsService is documented at http://www.elasticsearch.org/guide/en/elasticsearch/reference/1.4/cluster-stats.html.
func NewClusterStatsService ¶
func NewClusterStatsService(client *Client) *ClusterStatsService
NewClusterStatsService creates a new ClusterStatsService.
func (*ClusterStatsService) Do ¶
func (s *ClusterStatsService) Do() (*ClusterStatsResponse, error)
Do executes the operation.
func (*ClusterStatsService) FlatSettings ¶
func (s *ClusterStatsService) FlatSettings(flatSettings bool) *ClusterStatsService
FlatSettings is documented as: Return settings in flat format (default: false).
func (*ClusterStatsService) Human ¶
func (s *ClusterStatsService) Human(human bool) *ClusterStatsService
Human is documented as: Whether to return time and byte values in human-readable format..
func (*ClusterStatsService) NodeId ¶
func (s *ClusterStatsService) NodeId(nodeId []string) *ClusterStatsService
NodeId is documented as: A comma-separated list of node IDs or names to limit the returned information; use `_local` to return information from the node you're connecting to, leave empty to get information from all nodes.
func (*ClusterStatsService) Pretty ¶
func (s *ClusterStatsService) Pretty(pretty bool) *ClusterStatsService
Pretty indicates that the JSON response be indented and human readable.
func (*ClusterStatsService) Validate ¶
func (s *ClusterStatsService) Validate() error
Validate checks if the operation is valid.
type CommonTermsQuery ¶
type CommonTermsQuery struct { Query // contains filtered or unexported fields }
CommonTermsQuery is a modern alternative to stopwords which improves the precision and recall of search results (by taking stopwords into account), without sacrificing performance. For more details, see: https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-common-terms-query.html
func NewCommonTermsQuery ¶
func NewCommonTermsQuery(name string, text interface{}) *CommonTermsQuery
NewCommonTermsQuery creates and initializes a new common terms query.
func (*CommonTermsQuery) Analyzer ¶
func (q *CommonTermsQuery) Analyzer(analyzer string) *CommonTermsQuery
func (*CommonTermsQuery) Boost ¶
func (q *CommonTermsQuery) Boost(boost float64) *CommonTermsQuery
func (*CommonTermsQuery) CutoffFrequency ¶
func (q *CommonTermsQuery) CutoffFrequency(f float64) *CommonTermsQuery
func (*CommonTermsQuery) DisableCoord ¶
func (q *CommonTermsQuery) DisableCoord(disableCoord bool) *CommonTermsQuery
func (*CommonTermsQuery) HighFreq ¶
func (q *CommonTermsQuery) HighFreq(f float64) *CommonTermsQuery
func (*CommonTermsQuery) HighFreqMinimumShouldMatch ¶
func (q *CommonTermsQuery) HighFreqMinimumShouldMatch(minShouldMatch string) *CommonTermsQuery
func (*CommonTermsQuery) HighFreqOperator ¶
func (q *CommonTermsQuery) HighFreqOperator(op string) *CommonTermsQuery
func (*CommonTermsQuery) LowFreq ¶
func (q *CommonTermsQuery) LowFreq(f float64) *CommonTermsQuery
func (*CommonTermsQuery) LowFreqMinimumShouldMatch ¶
func (q *CommonTermsQuery) LowFreqMinimumShouldMatch(minShouldMatch string) *CommonTermsQuery
func (*CommonTermsQuery) LowFreqOperator ¶
func (q *CommonTermsQuery) LowFreqOperator(op string) *CommonTermsQuery
func (*CommonTermsQuery) QueryName ¶
func (q *CommonTermsQuery) QueryName(queryName string) *CommonTermsQuery
func (*CommonTermsQuery) Source ¶
func (q *CommonTermsQuery) Source() (interface{}, error)
Creates the query source for the common query.
type CompletionSuggester ¶
type CompletionSuggester struct { Suggester // contains filtered or unexported fields }
CompletionSuggester is a fast suggester for e.g. type-ahead completion. See http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/search-suggesters-completion.html for more details.
func NewCompletionSuggester ¶
func NewCompletionSuggester(name string) *CompletionSuggester
Creates a new completion suggester.
func (*CompletionSuggester) Analyzer ¶
func (q *CompletionSuggester) Analyzer(analyzer string) *CompletionSuggester
func (*CompletionSuggester) ContextQueries ¶
func (q *CompletionSuggester) ContextQueries(queries ...SuggesterContextQuery) *CompletionSuggester
func (*CompletionSuggester) ContextQuery ¶
func (q *CompletionSuggester) ContextQuery(query SuggesterContextQuery) *CompletionSuggester
func (*CompletionSuggester) Field ¶
func (q *CompletionSuggester) Field(field string) *CompletionSuggester
func (*CompletionSuggester) Name ¶
func (q *CompletionSuggester) Name() string
func (*CompletionSuggester) ShardSize ¶
func (q *CompletionSuggester) ShardSize(shardSize int) *CompletionSuggester
func (*CompletionSuggester) Size ¶
func (q *CompletionSuggester) Size(size int) *CompletionSuggester
func (*CompletionSuggester) Source ¶
func (q *CompletionSuggester) Source(includeName bool) (interface{}, error)
Creates the source for the completion suggester.
func (*CompletionSuggester) Text ¶
func (q *CompletionSuggester) Text(text string) *CompletionSuggester
type ConstantScoreQuery ¶
type ConstantScoreQuery struct {
// contains filtered or unexported fields
}
ConstantScoreQuery is a query that wraps a filter and simply returns a constant score equal to the query boost for every document in the filter.
For more details, see: https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-constant-score-query.html
func NewConstantScoreQuery ¶
func NewConstantScoreQuery(filter Query) *ConstantScoreQuery
ConstantScoreQuery creates and initializes a new constant score query.
func (*ConstantScoreQuery) Boost ¶
func (q *ConstantScoreQuery) Boost(boost float64) *ConstantScoreQuery
Boost sets the boost for this query. Documents matching this query will (in addition to the normal weightings) have their score multiplied by the boost provided.
func (*ConstantScoreQuery) Source ¶
func (q *ConstantScoreQuery) Source() (interface{}, error)
Source returns the query source.
type CountResponse ¶
type CountResponse struct { Count int64 `json:"count"` Shards shardsInfo `json:"_shards,omitempty"` }
CountResponse is the response of using the Count API.
type CountService ¶
type CountService struct {
// contains filtered or unexported fields
}
CountService is a convenient service for determining the number of documents in an index. Use SearchService with a SearchType of count for counting with queries etc.
func NewCountService ¶
func NewCountService(client *Client) *CountService
NewCountService creates a new CountService.
func (*CountService) AllowNoIndices ¶
func (s *CountService) AllowNoIndices(allowNoIndices bool) *CountService
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 (*CountService) AnalyzeWildcard ¶
func (s *CountService) AnalyzeWildcard(analyzeWildcard bool) *CountService
AnalyzeWildcard specifies whether wildcard and prefix queries should be analyzed (default: false).
func (*CountService) Analyzer ¶
func (s *CountService) Analyzer(analyzer string) *CountService
Analyzer specifies the analyzer to use for the query string.
func (*CountService) BodyJson ¶
func (s *CountService) BodyJson(body interface{}) *CountService
BodyJson specifies the query to restrict the results specified with the Query DSL (optional). The interface{} will be serialized to a JSON document, so use a map[string]interface{}.
func (*CountService) BodyString ¶
func (s *CountService) BodyString(body string) *CountService
Body specifies a query to restrict the results specified with the Query DSL (optional).
func (*CountService) DefaultOperator ¶
func (s *CountService) DefaultOperator(defaultOperator string) *CountService
DefaultOperator specifies the default operator for query string query (AND or OR).
func (*CountService) Df ¶
func (s *CountService) Df(df string) *CountService
Df specifies the field to use as default where no field prefix is given in the query string.
func (*CountService) ExpandWildcards ¶
func (s *CountService) ExpandWildcards(expandWildcards string) *CountService
ExpandWildcards indicates whether to expand wildcard expression to concrete indices that are open, closed or both.
func (*CountService) IgnoreUnavailable ¶
func (s *CountService) IgnoreUnavailable(ignoreUnavailable bool) *CountService
IgnoreUnavailable indicates whether specified concrete indices should be ignored when unavailable (missing or closed).
func (*CountService) Index ¶
func (s *CountService) Index(index ...string) *CountService
Index sets the names of the indices to restrict the results.
func (*CountService) Lenient ¶
func (s *CountService) Lenient(lenient bool) *CountService
Lenient specifies whether format-based query failures (such as providing text to a numeric field) should be ignored.
func (*CountService) LowercaseExpandedTerms ¶
func (s *CountService) LowercaseExpandedTerms(lowercaseExpandedTerms bool) *CountService
LowercaseExpandedTerms specifies whether query terms should be lowercased.
func (*CountService) MinScore ¶
func (s *CountService) MinScore(minScore interface{}) *CountService
MinScore indicates to include only documents with a specific `_score` value in the result.
func (*CountService) Preference ¶
func (s *CountService) Preference(preference string) *CountService
Preference specifies the node or shard the operation should be performed on (default: random).
func (*CountService) Pretty ¶
func (s *CountService) Pretty(pretty bool) *CountService
Pretty indicates that the JSON response be indented and human readable.
func (*CountService) Q ¶
func (s *CountService) Q(q string) *CountService
Q in the Lucene query string syntax. You can also use Query to pass a Query struct.
func (*CountService) Query ¶
func (s *CountService) Query(query Query) *CountService
Query specifies the query to pass. You can also pass a query string with Q.
func (*CountService) Routing ¶
func (s *CountService) Routing(routing string) *CountService
Routing specifies the routing value.
func (*CountService) Type ¶
func (s *CountService) Type(typ ...string) *CountService
Type sets the types to use to restrict the results.
func (*CountService) Validate ¶
func (s *CountService) Validate() error
Validate checks if the operation is valid.
type CumulativeSumAggregation ¶
type CumulativeSumAggregation struct {
// contains filtered or unexported fields
}
CumulativeSumAggregation is a parent pipeline aggregation which calculates the cumulative sum of a specified metric in a parent histogram (or date_histogram) aggregation. The specified metric must be numeric and the enclosing histogram must have min_doc_count set to 0 (default for histogram aggregations).
For more details, see https://www.elastic.co/guide/en/elasticsearch/reference/current/search-aggregations-pipeline-cumulative-sum-aggregation.html
func NewCumulativeSumAggregation ¶
func NewCumulativeSumAggregation() *CumulativeSumAggregation
NewCumulativeSumAggregation creates and initializes a new CumulativeSumAggregation.
func (*CumulativeSumAggregation) BucketsPath ¶
func (a *CumulativeSumAggregation) BucketsPath(bucketsPaths ...string) *CumulativeSumAggregation
BucketsPath sets the paths to the buckets to use for this pipeline aggregator.
func (*CumulativeSumAggregation) Format ¶
func (a *CumulativeSumAggregation) Format(format string) *CumulativeSumAggregation
func (*CumulativeSumAggregation) Meta ¶
func (a *CumulativeSumAggregation) Meta(metaData map[string]interface{}) *CumulativeSumAggregation
Meta sets the meta data to be included in the aggregation response.
func (*CumulativeSumAggregation) Source ¶
func (a *CumulativeSumAggregation) Source() (interface{}, error)
func (*CumulativeSumAggregation) SubAggregation ¶
func (a *CumulativeSumAggregation) SubAggregation(name string, subAggregation Aggregation) *CumulativeSumAggregation
SubAggregation adds a sub-aggregation to this aggregation.
type DateHistogramAggregation ¶
type DateHistogramAggregation struct {
// contains filtered or unexported fields
}
DateHistogramAggregation is a multi-bucket aggregation similar to the histogram except it can only be applied on date values. See: http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/search-aggregations-bucket-datehistogram-aggregation.html
func NewDateHistogramAggregation ¶
func NewDateHistogramAggregation() *DateHistogramAggregation
func (*DateHistogramAggregation) ExtendedBoundsMax ¶
func (a *DateHistogramAggregation) ExtendedBoundsMax(max interface{}) *DateHistogramAggregation
ExtendedBoundsMax accepts int, int64, string, or time.Time values.
func (*DateHistogramAggregation) ExtendedBoundsMin ¶
func (a *DateHistogramAggregation) ExtendedBoundsMin(min interface{}) *DateHistogramAggregation
ExtendedBoundsMin accepts int, int64, string, or time.Time values.
func (*DateHistogramAggregation) Factor ¶
func (a *DateHistogramAggregation) Factor(factor float64) *DateHistogramAggregation
func (*DateHistogramAggregation) Field ¶
func (a *DateHistogramAggregation) Field(field string) *DateHistogramAggregation
func (*DateHistogramAggregation) Format ¶
func (a *DateHistogramAggregation) Format(format string) *DateHistogramAggregation
func (*DateHistogramAggregation) Interval ¶
func (a *DateHistogramAggregation) Interval(interval string) *DateHistogramAggregation
Allowed values are: "year", "quarter", "month", "week", "day", "hour", "minute". It also supports time settings like "1.5h" (up to "w" for weeks).
func (*DateHistogramAggregation) Meta ¶
func (a *DateHistogramAggregation) Meta(metaData map[string]interface{}) *DateHistogramAggregation
Meta sets the meta data to be included in the aggregation response.
func (*DateHistogramAggregation) MinDocCount ¶
func (a *DateHistogramAggregation) MinDocCount(minDocCount int64) *DateHistogramAggregation
func (*DateHistogramAggregation) Order ¶
func (a *DateHistogramAggregation) Order(order string, asc bool) *DateHistogramAggregation
Order specifies the sort order. Valid values for order are: "_key", "_count", a sub-aggregation name, or a sub-aggregation name with a metric.
func (*DateHistogramAggregation) OrderByAggregation ¶
func (a *DateHistogramAggregation) OrderByAggregation(aggName string, asc bool) *DateHistogramAggregation
OrderByAggregation creates a bucket ordering strategy which sorts buckets based on a single-valued calc get.
func (*DateHistogramAggregation) OrderByAggregationAndMetric ¶
func (a *DateHistogramAggregation) OrderByAggregationAndMetric(aggName, metric string, asc bool) *DateHistogramAggregation
OrderByAggregationAndMetric creates a bucket ordering strategy which sorts buckets based on a multi-valued calc get.
func (*DateHistogramAggregation) OrderByCount ¶
func (a *DateHistogramAggregation) OrderByCount(asc bool) *DateHistogramAggregation
func (*DateHistogramAggregation) OrderByCountAsc ¶
func (a *DateHistogramAggregation) OrderByCountAsc() *DateHistogramAggregation
func (*DateHistogramAggregation) OrderByCountDesc ¶
func (a *DateHistogramAggregation) OrderByCountDesc() *DateHistogramAggregation
func (*DateHistogramAggregation) OrderByKey ¶
func (a *DateHistogramAggregation) OrderByKey(asc bool) *DateHistogramAggregation
func (*DateHistogramAggregation) OrderByKeyAsc ¶
func (a *DateHistogramAggregation) OrderByKeyAsc() *DateHistogramAggregation
func (*DateHistogramAggregation) OrderByKeyDesc ¶
func (a *DateHistogramAggregation) OrderByKeyDesc() *DateHistogramAggregation
func (*DateHistogramAggregation) PostOffset ¶
func (a *DateHistogramAggregation) PostOffset(postOffset int64) *DateHistogramAggregation
func (*DateHistogramAggregation) PostZone ¶
func (a *DateHistogramAggregation) PostZone(postZone string) *DateHistogramAggregation
func (*DateHistogramAggregation) PreOffset ¶
func (a *DateHistogramAggregation) PreOffset(preOffset int64) *DateHistogramAggregation
func (*DateHistogramAggregation) PreZone ¶
func (a *DateHistogramAggregation) PreZone(preZone string) *DateHistogramAggregation
func (*DateHistogramAggregation) PreZoneAdjustLargeInterval ¶
func (a *DateHistogramAggregation) PreZoneAdjustLargeInterval(preZoneAdjustLargeInterval bool) *DateHistogramAggregation
func (*DateHistogramAggregation) Script ¶
func (a *DateHistogramAggregation) Script(script *Script) *DateHistogramAggregation
func (*DateHistogramAggregation) Source ¶
func (a *DateHistogramAggregation) Source() (interface{}, error)
func (*DateHistogramAggregation) SubAggregation ¶
func (a *DateHistogramAggregation) SubAggregation(name string, subAggregation Aggregation) *DateHistogramAggregation
type DateRangeAggregation ¶
type DateRangeAggregation struct {
// contains filtered or unexported fields
}
DateRangeAggregation is a range aggregation that is dedicated for date values. The main difference between this aggregation and the normal range aggregation is that the from and to values can be expressed in Date Math expressions, and it is also possible to specify a date format by which the from and to response fields will be returned. Note that this aggregration includes the from value and excludes the to value for each range. See: http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/search-aggregations-bucket-daterange-aggregation.html
func NewDateRangeAggregation ¶
func NewDateRangeAggregation() *DateRangeAggregation
func (*DateRangeAggregation) AddRange ¶
func (a *DateRangeAggregation) AddRange(from, to interface{}) *DateRangeAggregation
func (*DateRangeAggregation) AddRangeWithKey ¶
func (a *DateRangeAggregation) AddRangeWithKey(key string, from, to interface{}) *DateRangeAggregation
func (*DateRangeAggregation) AddUnboundedFrom ¶
func (a *DateRangeAggregation) AddUnboundedFrom(to interface{}) *DateRangeAggregation
func (*DateRangeAggregation) AddUnboundedFromWithKey ¶
func (a *DateRangeAggregation) AddUnboundedFromWithKey(key string, to interface{}) *DateRangeAggregation
func (*DateRangeAggregation) AddUnboundedTo ¶
func (a *DateRangeAggregation) AddUnboundedTo(from interface{}) *DateRangeAggregation
func (*DateRangeAggregation) AddUnboundedToWithKey ¶
func (a *DateRangeAggregation) AddUnboundedToWithKey(key string, from interface{}) *DateRangeAggregation
func (*DateRangeAggregation) Between ¶
func (a *DateRangeAggregation) Between(from, to interface{}) *DateRangeAggregation
func (*DateRangeAggregation) BetweenWithKey ¶
func (a *DateRangeAggregation) BetweenWithKey(key string, from, to interface{}) *DateRangeAggregation
func (*DateRangeAggregation) Field ¶
func (a *DateRangeAggregation) Field(field string) *DateRangeAggregation
func (*DateRangeAggregation) Format ¶
func (a *DateRangeAggregation) Format(format string) *DateRangeAggregation
func (*DateRangeAggregation) Gt ¶
func (a *DateRangeAggregation) Gt(from interface{}) *DateRangeAggregation
func (*DateRangeAggregation) GtWithKey ¶
func (a *DateRangeAggregation) GtWithKey(key string, from interface{}) *DateRangeAggregation
func (*DateRangeAggregation) Keyed ¶
func (a *DateRangeAggregation) Keyed(keyed bool) *DateRangeAggregation
func (*DateRangeAggregation) Lt ¶
func (a *DateRangeAggregation) Lt(to interface{}) *DateRangeAggregation
func (*DateRangeAggregation) LtWithKey ¶
func (a *DateRangeAggregation) LtWithKey(key string, to interface{}) *DateRangeAggregation
func (*DateRangeAggregation) Meta ¶
func (a *DateRangeAggregation) Meta(metaData map[string]interface{}) *DateRangeAggregation
Meta sets the meta data to be included in the aggregation response.
func (*DateRangeAggregation) Script ¶
func (a *DateRangeAggregation) Script(script *Script) *DateRangeAggregation
func (*DateRangeAggregation) Source ¶
func (a *DateRangeAggregation) Source() (interface{}, error)
func (*DateRangeAggregation) SubAggregation ¶
func (a *DateRangeAggregation) SubAggregation(name string, subAggregation Aggregation) *DateRangeAggregation
func (*DateRangeAggregation) Unmapped ¶
func (a *DateRangeAggregation) Unmapped(unmapped bool) *DateRangeAggregation
type DateRangeAggregationEntry ¶
type DateRangeAggregationEntry struct { Key string From interface{} To interface{} }
type Decoder ¶
Decoder is used to decode responses from Elasticsearch. Users of elastic can implement their own marshaler for advanced purposes and set them per Client (see SetDecoder). If none is specified, DefaultDecoder is used.
type DefaultDecoder ¶
type DefaultDecoder struct{}
DefaultDecoder uses json.Unmarshal from the Go standard library to decode JSON data.
func (*DefaultDecoder) Decode ¶
func (u *DefaultDecoder) Decode(data []byte, v interface{}) error
Decode decodes with json.Unmarshal from the Go standard library.
type DeleteByQueryResult ¶
type DeleteByQueryResult struct {
Indices map[string]IndexDeleteByQueryResult `json:"_indices"`
}
DeleteByQueryResult is the outcome of executing Do with DeleteByQueryService.
type DeleteByQueryService ¶
type DeleteByQueryService struct {
// contains filtered or unexported fields
}
DeleteByQueryService deletes documents that match a query. See http://www.elasticsearch.org/guide/en/elasticsearch/reference/master/docs-delete-by-query.html.
func NewDeleteByQueryService ¶
func NewDeleteByQueryService(client *Client) *DeleteByQueryService
NewDeleteByQueryService creates a new DeleteByQueryService. You typically use the client's DeleteByQuery to get a reference to the service.
func (*DeleteByQueryService) AllowNoIndices ¶
func (s *DeleteByQueryService) AllowNoIndices(allow bool) *DeleteByQueryService
AllowNoIndices indicates whether to ignore if a wildcard indices expression resolves into no concrete indices (including the _all string or when no indices have been specified).
func (*DeleteByQueryService) Analyzer ¶
func (s *DeleteByQueryService) Analyzer(analyzer string) *DeleteByQueryService
Analyzer to use for the query string.
func (*DeleteByQueryService) Consistency ¶
func (s *DeleteByQueryService) Consistency(consistency string) *DeleteByQueryService
Consistency represents the specific write consistency setting for the operation. It can be one, quorum, or all.
func (*DeleteByQueryService) DF ¶
func (s *DeleteByQueryService) DF(defaultField string) *DeleteByQueryService
DF is the field to use as default where no field prefix is given in the query string.
func (*DeleteByQueryService) DefaultField ¶
func (s *DeleteByQueryService) DefaultField(defaultField string) *DeleteByQueryService
DefaultField is the field to use as default where no field prefix is given in the query string. It is an alias to the DF func.
func (*DeleteByQueryService) DefaultOperator ¶
func (s *DeleteByQueryService) DefaultOperator(defaultOperator string) *DeleteByQueryService
DefaultOperator for query string query (AND or OR).
func (*DeleteByQueryService) Do ¶
func (s *DeleteByQueryService) Do() (*DeleteByQueryResult, error)
Do executes the delete-by-query operation.
func (*DeleteByQueryService) ExpandWildcards ¶
func (s *DeleteByQueryService) ExpandWildcards(expand string) *DeleteByQueryService
ExpandWildcards indicates whether to expand wildcard expression to concrete indices that are open, closed or both. It can be "open" or "closed".
func (*DeleteByQueryService) IgnoreUnavailable ¶
func (s *DeleteByQueryService) IgnoreUnavailable(ignore bool) *DeleteByQueryService
IgnoreUnavailable indicates whether specified concrete indices should be ignored when unavailable (missing or closed).
func (*DeleteByQueryService) Index ¶
func (s *DeleteByQueryService) Index(indices ...string) *DeleteByQueryService
Index sets the indices on which to perform the delete operation.
func (*DeleteByQueryService) Pretty ¶
func (s *DeleteByQueryService) Pretty(pretty bool) *DeleteByQueryService
Pretty indents the JSON output from Elasticsearch.
func (*DeleteByQueryService) Q ¶
func (s *DeleteByQueryService) Q(query string) *DeleteByQueryService
Q specifies the query in Lucene query string syntax. You can also use Query to programmatically specify the query.
func (*DeleteByQueryService) Query ¶
func (s *DeleteByQueryService) Query(query Query) *DeleteByQueryService
Query sets the query programmatically.
func (*DeleteByQueryService) QueryString ¶
func (s *DeleteByQueryService) QueryString(query string) *DeleteByQueryService
QueryString is an alias to Q. Notice that you can also use Query to programmatically set the query.
func (*DeleteByQueryService) Replication ¶
func (s *DeleteByQueryService) Replication(replication string) *DeleteByQueryService
Replication sets a specific replication type (sync or async).
func (*DeleteByQueryService) Routing ¶
func (s *DeleteByQueryService) Routing(routing string) *DeleteByQueryService
Routing sets a specific routing value.
func (*DeleteByQueryService) Timeout ¶
func (s *DeleteByQueryService) Timeout(timeout string) *DeleteByQueryService
Timeout sets an explicit operation timeout, e.g. "1s" or "10000ms".
func (*DeleteByQueryService) Type ¶
func (s *DeleteByQueryService) Type(types ...string) *DeleteByQueryService
Type limits the delete operation to the given types.
type DeleteResponse ¶
type DeleteResponse struct { // TODO _shards { total, failed, successful } Found bool `json:"found"` Index string `json:"_index"` Type string `json:"_type"` Id string `json:"_id"` Version int64 `json:"_version"` }
DeleteResponse is the outcome of running DeleteService.Do.
type DeleteService ¶
type DeleteService struct {
// contains filtered or unexported fields
}
DeleteService allows to delete a typed JSON document from a specified index based on its id.
See https://www.elastic.co/guide/en/elasticsearch/reference/current/docs-delete.html for details.
func NewDeleteService ¶
func NewDeleteService(client *Client) *DeleteService
NewDeleteService creates a new DeleteService.
func (*DeleteService) Consistency ¶
func (s *DeleteService) Consistency(consistency string) *DeleteService
Consistency defines a specific write consistency setting for the operation.
func (*DeleteService) Do ¶
func (s *DeleteService) Do() (*DeleteResponse, error)
Do executes the operation.
func (*DeleteService) Id ¶
func (s *DeleteService) Id(id string) *DeleteService
Id is the document ID.
func (*DeleteService) Index ¶
func (s *DeleteService) Index(index string) *DeleteService
Index is the name of the index.
func (*DeleteService) Parent ¶
func (s *DeleteService) Parent(parent string) *DeleteService
Parent is the ID of parent document.
func (*DeleteService) Pretty ¶
func (s *DeleteService) Pretty(pretty bool) *DeleteService
Pretty indicates that the JSON response be indented and human readable.
func (*DeleteService) Refresh ¶
func (s *DeleteService) Refresh(refresh bool) *DeleteService
Refresh the index after performing the operation.
func (*DeleteService) Replication ¶
func (s *DeleteService) Replication(replication string) *DeleteService
Replication specifies a replication type.
func (*DeleteService) Routing ¶
func (s *DeleteService) Routing(routing string) *DeleteService
Routing is a specific routing value.
func (*DeleteService) Timeout ¶
func (s *DeleteService) Timeout(timeout string) *DeleteService
Timeout is an explicit operation timeout.
func (*DeleteService) Type ¶
func (s *DeleteService) Type(typ string) *DeleteService
Type is the type of the document.
func (*DeleteService) Validate ¶
func (s *DeleteService) Validate() error
Validate checks if the operation is valid.
func (*DeleteService) Version ¶
func (s *DeleteService) Version(version interface{}) *DeleteService
Version is an explicit version number for concurrency control.
func (*DeleteService) VersionType ¶
func (s *DeleteService) VersionType(versionType string) *DeleteService
VersionType is a specific version type.
type DeleteTemplateResponse ¶
type DeleteTemplateResponse struct { Found bool `json:"found"` Index string `json:"_index"` Type string `json:"_type"` Id string `json:"_id"` Version int `json:"_version"` }
DeleteTemplateResponse is the response of DeleteTemplateService.Do.
type DeleteTemplateService ¶
type DeleteTemplateService struct {
// contains filtered or unexported fields
}
DeleteTemplateService deletes a search template. More information can be found at http://www.elasticsearch.org/guide/en/elasticsearch/reference/master/search-template.html.
Example ¶
client, err := elastic.NewClient() if err != nil { panic(err) } // Delete template resp, err := client.DeleteTemplate().Id("my-search-template").Do() if err != nil { panic(err) } if resp != nil && resp.Found { fmt.Println("template deleted") }
Output:
func NewDeleteTemplateService ¶
func NewDeleteTemplateService(client *Client) *DeleteTemplateService
NewDeleteTemplateService creates a new DeleteTemplateService.
func (*DeleteTemplateService) Do ¶
func (s *DeleteTemplateService) Do() (*DeleteTemplateResponse, error)
Do executes the operation.
func (*DeleteTemplateService) Id ¶
func (s *DeleteTemplateService) Id(id string) *DeleteTemplateService
Id is the template ID.
func (*DeleteTemplateService) Validate ¶
func (s *DeleteTemplateService) Validate() error
Validate checks if the operation is valid.
func (*DeleteTemplateService) Version ¶
func (s *DeleteTemplateService) Version(version int) *DeleteTemplateService
Version an explicit version number for concurrency control.
func (*DeleteTemplateService) VersionType ¶
func (s *DeleteTemplateService) VersionType(versionType string) *DeleteTemplateService
VersionType specifies a version type.
type DerivativeAggregation ¶
type DerivativeAggregation struct {
// contains filtered or unexported fields
}
DerivativeAggregation is a parent pipeline aggregation which calculates the derivative of a specified metric in a parent histogram (or date_histogram) aggregation. The specified metric must be numeric and the enclosing histogram must have min_doc_count set to 0 (default for histogram aggregations).
For more details, see https://www.elastic.co/guide/en/elasticsearch/reference/current/search-aggregations-pipeline-derivative-aggregation.html
func NewDerivativeAggregation ¶
func NewDerivativeAggregation() *DerivativeAggregation
NewDerivativeAggregation creates and initializes a new DerivativeAggregation.
func (*DerivativeAggregation) BucketsPath ¶
func (a *DerivativeAggregation) BucketsPath(bucketsPaths ...string) *DerivativeAggregation
BucketsPath sets the paths to the buckets to use for this pipeline aggregator.
func (*DerivativeAggregation) Format ¶
func (a *DerivativeAggregation) Format(format string) *DerivativeAggregation
func (*DerivativeAggregation) GapInsertZeros ¶
func (a *DerivativeAggregation) GapInsertZeros() *DerivativeAggregation
GapInsertZeros inserts zeros for gaps in the series.
func (*DerivativeAggregation) GapPolicy ¶
func (a *DerivativeAggregation) GapPolicy(gapPolicy string) *DerivativeAggregation
GapPolicy defines what should be done when a gap in the series is discovered. Valid values include "insert_zeros" or "skip". Default is "insert_zeros".
func (*DerivativeAggregation) GapSkip ¶
func (a *DerivativeAggregation) GapSkip() *DerivativeAggregation
GapSkip skips gaps in the series.
func (*DerivativeAggregation) Meta ¶
func (a *DerivativeAggregation) Meta(metaData map[string]interface{}) *DerivativeAggregation
Meta sets the meta data to be included in the aggregation response.
func (*DerivativeAggregation) Source ¶
func (a *DerivativeAggregation) Source() (interface{}, error)
func (*DerivativeAggregation) SubAggregation ¶
func (a *DerivativeAggregation) SubAggregation(name string, subAggregation Aggregation) *DerivativeAggregation
SubAggregation adds a sub-aggregation to this aggregation.
func (*DerivativeAggregation) Unit ¶
func (a *DerivativeAggregation) Unit(unit string) *DerivativeAggregation
Unit sets the unit provided, e.g. "1d" or "1y". It is only useful when calculating the derivative using a date_histogram.
type DirectCandidateGenerator ¶
type DirectCandidateGenerator struct {
// contains filtered or unexported fields
}
DirectCandidateGenerator implements a direct candidate generator. See http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/search-suggesters-phrase.html#_smoothing_models for details about smoothing models.
func NewDirectCandidateGenerator ¶
func NewDirectCandidateGenerator(field string) *DirectCandidateGenerator
func (*DirectCandidateGenerator) Accuracy ¶
func (g *DirectCandidateGenerator) Accuracy(accuracy float64) *DirectCandidateGenerator
func (*DirectCandidateGenerator) Field ¶
func (g *DirectCandidateGenerator) Field(field string) *DirectCandidateGenerator
func (*DirectCandidateGenerator) MaxEdits ¶
func (g *DirectCandidateGenerator) MaxEdits(maxEdits int) *DirectCandidateGenerator
func (*DirectCandidateGenerator) MaxInspections ¶
func (g *DirectCandidateGenerator) MaxInspections(maxInspections int) *DirectCandidateGenerator
func (*DirectCandidateGenerator) MaxTermFreq ¶
func (g *DirectCandidateGenerator) MaxTermFreq(maxTermFreq float64) *DirectCandidateGenerator
func (*DirectCandidateGenerator) MinDocFreq ¶
func (g *DirectCandidateGenerator) MinDocFreq(minDocFreq float64) *DirectCandidateGenerator
func (*DirectCandidateGenerator) MinWordLength ¶
func (g *DirectCandidateGenerator) MinWordLength(minWordLength int) *DirectCandidateGenerator
func (*DirectCandidateGenerator) PostFilter ¶
func (g *DirectCandidateGenerator) PostFilter(postFilter string) *DirectCandidateGenerator
func (*DirectCandidateGenerator) PreFilter ¶
func (g *DirectCandidateGenerator) PreFilter(preFilter string) *DirectCandidateGenerator
func (*DirectCandidateGenerator) PrefixLength ¶
func (g *DirectCandidateGenerator) PrefixLength(prefixLength int) *DirectCandidateGenerator
func (*DirectCandidateGenerator) Size ¶
func (g *DirectCandidateGenerator) Size(size int) *DirectCandidateGenerator
func (*DirectCandidateGenerator) Sort ¶
func (g *DirectCandidateGenerator) Sort(sort string) *DirectCandidateGenerator
func (*DirectCandidateGenerator) Source ¶
func (g *DirectCandidateGenerator) Source() (interface{}, error)
func (*DirectCandidateGenerator) StringDistance ¶
func (g *DirectCandidateGenerator) StringDistance(stringDistance string) *DirectCandidateGenerator
func (*DirectCandidateGenerator) SuggestMode ¶
func (g *DirectCandidateGenerator) SuggestMode(suggestMode string) *DirectCandidateGenerator
func (*DirectCandidateGenerator) Type ¶
func (g *DirectCandidateGenerator) Type() string
type DisMaxQuery ¶
type DisMaxQuery struct {
// contains filtered or unexported fields
}
DisMaxQuery is a query that generates the union of documents produced by its subqueries, and that scores each document with the maximum score for that document as produced by any subquery, plus a tie breaking increment for any additional matching subqueries.
For more details, see: https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-dis-max-query.html
func NewDisMaxQuery ¶
func NewDisMaxQuery() *DisMaxQuery
NewDisMaxQuery creates and initializes a new dis max query.
func (*DisMaxQuery) Boost ¶
func (q *DisMaxQuery) Boost(boost float64) *DisMaxQuery
Boost sets the boost for this query. Documents matching this query will (in addition to the normal weightings) have their score multiplied by the boost provided.
func (*DisMaxQuery) Query ¶
func (q *DisMaxQuery) Query(queries ...Query) *DisMaxQuery
Query adds one or more queries to the dis max query.
func (*DisMaxQuery) QueryName ¶
func (q *DisMaxQuery) QueryName(queryName string) *DisMaxQuery
QueryName sets the query name for the filter that can be used when searching for matched filters per hit.
func (*DisMaxQuery) Source ¶
func (q *DisMaxQuery) Source() (interface{}, error)
Source returns the JSON serializable content for this query.
func (*DisMaxQuery) TieBreaker ¶
func (q *DisMaxQuery) TieBreaker(tieBreaker float64) *DisMaxQuery
TieBreaker is the factor by which the score of each non-maximum disjunct for a document is multiplied with and added into the final score.
If non-zero, the value should be small, on the order of 0.1, which says that 10 occurrences of word in a lower-scored field that is also in a higher scored field is just as good as a unique word in the lower scored field (i.e., one that is not in any higher scored field).
type EWMAMovAvgModel ¶
type EWMAMovAvgModel struct {
// contains filtered or unexported fields
}
EWMAMovAvgModel calculates an exponentially weighted moving average.
For more details, see https://www.elastic.co/guide/en/elasticsearch/reference/current/search-aggregations-pipeline-movavg-aggregation.html#_ewma_exponentially_weighted
func NewEWMAMovAvgModel ¶
func NewEWMAMovAvgModel() *EWMAMovAvgModel
NewEWMAMovAvgModel creates and initializes a new EWMAMovAvgModel.
func (*EWMAMovAvgModel) Alpha ¶
func (m *EWMAMovAvgModel) Alpha(alpha float64) *EWMAMovAvgModel
Alpha controls the smoothing of the data. Alpha = 1 retains no memory of past values (e.g. a random walk), while alpha = 0 retains infinite memory of past values (e.g. the series mean). Useful values are somewhere in between. Defaults to 0.5.
func (*EWMAMovAvgModel) Settings ¶
func (m *EWMAMovAvgModel) Settings() map[string]interface{}
Settings of the model.
type Error ¶
type Error struct { Status int `json:"status"` Details *ErrorDetails `json:"error,omitempty"` }
Error encapsulates error details as returned from Elasticsearch.
type ErrorDetails ¶
type ErrorDetails struct { Type string `json:"type"` Reason string `json:"reason"` ResourceType string `json:"resource.type,omitempty"` ResourceId string `json:"resource.id,omitempty"` Index string `json:"index,omitempty"` Phase string `json:"phase,omitempty"` Grouped bool `json:"grouped,omitempty"` CausedBy map[string]interface{} `json:"caused_by,omitempty"` RootCause []*ErrorDetails `json:"root_cause,omitempty"` FailedShards []map[string]interface{} `json:"failed_shards,omitempty"` }
ErrorDetails encapsulate error details from Elasticsearch. It is used in e.g. elastic.Error and elastic.BulkResponseItem.
type ExistsQuery ¶
type ExistsQuery struct {
// contains filtered or unexported fields
}
ExistsQuery is a query that only matches on documents that the field has a value in them.
For more details, see: https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-exists-query.html
func NewExistsQuery ¶
func NewExistsQuery(name string) *ExistsQuery
NewExistsQuery creates and initializes a new dis max query.
func (*ExistsQuery) QueryName ¶
func (q *ExistsQuery) QueryName(queryName string) *ExistsQuery
QueryName sets the query name for the filter that can be used when searching for matched queries per hit.
func (*ExistsQuery) Source ¶
func (q *ExistsQuery) Source() (interface{}, error)
Source returns the JSON serializable content for this query.
type ExistsService ¶
type ExistsService struct {
// contains filtered or unexported fields
}
ExistsService checks for the existence of a document using HEAD.
See https://www.elastic.co/guide/en/elasticsearch/reference/current/docs-get.html for details.
func NewExistsService ¶
func NewExistsService(client *Client) *ExistsService
NewExistsService creates a new ExistsService.
func (*ExistsService) Id ¶
func (s *ExistsService) Id(id string) *ExistsService
Id is the document ID.
func (*ExistsService) Index ¶
func (s *ExistsService) Index(index string) *ExistsService
Index is the name of the index.
func (*ExistsService) Parent ¶
func (s *ExistsService) Parent(parent string) *ExistsService
Parent is the ID of the parent document.
func (*ExistsService) Preference ¶
func (s *ExistsService) Preference(preference string) *ExistsService
Preference specifies the node or shard the operation should be performed on (default: random).
func (*ExistsService) Pretty ¶
func (s *ExistsService) Pretty(pretty bool) *ExistsService
Pretty indicates that the JSON response be indented and human readable.
func (*ExistsService) Realtime ¶
func (s *ExistsService) Realtime(realtime bool) *ExistsService
Realtime specifies whether to perform the operation in realtime or search mode.
func (*ExistsService) Refresh ¶
func (s *ExistsService) Refresh(refresh bool) *ExistsService
Refresh the shard containing the document before performing the operation.
func (*ExistsService) Routing ¶
func (s *ExistsService) Routing(routing string) *ExistsService
Routing is a specific routing value.
func (*ExistsService) Type ¶
func (s *ExistsService) Type(typ string) *ExistsService
Type is the type of the document (use `_all` to fetch the first document matching the ID across all types).
func (*ExistsService) Validate ¶
func (s *ExistsService) Validate() error
Validate checks if the operation is valid.
type ExplainResponse ¶
type ExplainResponse struct { Index string `json:"_index"` Type string `json:"_type"` Id string `json:"_id"` Matched bool `json:"matched"` Explanation map[string]interface{} `json:"explanation"` }
ExplainResponse is the response of ExplainService.Do.
type ExplainService ¶
type ExplainService struct {
// contains filtered or unexported fields
}
ExplainService computes a score explanation for a query and a specific document. See http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/search-explain.html.
func NewExplainService ¶
func NewExplainService(client *Client) *ExplainService
NewExplainService creates a new ExplainService.
func (*ExplainService) AnalyzeWildcard ¶
func (s *ExplainService) AnalyzeWildcard(analyzeWildcard bool) *ExplainService
AnalyzeWildcard specifies whether wildcards and prefix queries in the query string query should be analyzed (default: false).
func (*ExplainService) Analyzer ¶
func (s *ExplainService) Analyzer(analyzer string) *ExplainService
Analyzer is the analyzer for the query string query.
func (*ExplainService) BodyJson ¶
func (s *ExplainService) BodyJson(body interface{}) *ExplainService
BodyJson sets the query definition using the Query DSL.
func (*ExplainService) BodyString ¶
func (s *ExplainService) BodyString(body string) *ExplainService
BodyString sets the query definition using the Query DSL as a string.
func (*ExplainService) DefaultOperator ¶
func (s *ExplainService) DefaultOperator(defaultOperator string) *ExplainService
DefaultOperator is the default operator for query string query (AND or OR).
func (*ExplainService) Df ¶
func (s *ExplainService) Df(df string) *ExplainService
Df is the default field for query string query (default: _all).
func (*ExplainService) Do ¶
func (s *ExplainService) Do() (*ExplainResponse, error)
Do executes the operation.
func (*ExplainService) Fields ¶
func (s *ExplainService) Fields(fields ...string) *ExplainService
Fields is a list of fields to return in the response.
func (*ExplainService) Id ¶
func (s *ExplainService) Id(id string) *ExplainService
Id is the document ID.
func (*ExplainService) Index ¶
func (s *ExplainService) Index(index string) *ExplainService
Index is the name of the index.
func (*ExplainService) Lenient ¶
func (s *ExplainService) Lenient(lenient bool) *ExplainService
Lenient specifies whether format-based query failures (such as providing text to a numeric field) should be ignored.
func (*ExplainService) LowercaseExpandedTerms ¶
func (s *ExplainService) LowercaseExpandedTerms(lowercaseExpandedTerms bool) *ExplainService
LowercaseExpandedTerms specifies whether query terms should be lowercased.
func (*ExplainService) Parent ¶
func (s *ExplainService) Parent(parent string) *ExplainService
Parent is the ID of the parent document.
func (*ExplainService) Preference ¶
func (s *ExplainService) Preference(preference string) *ExplainService
Preference specifies the node or shard the operation should be performed on (default: random).
func (*ExplainService) Pretty ¶
func (s *ExplainService) Pretty(pretty bool) *ExplainService
Pretty indicates that the JSON response be indented and human readable.
func (*ExplainService) Q ¶
func (s *ExplainService) Q(q string) *ExplainService
Query in the Lucene query string syntax.
func (*ExplainService) Query ¶
func (s *ExplainService) Query(query Query) *ExplainService
Query sets a query definition using the Query DSL.
func (*ExplainService) Routing ¶
func (s *ExplainService) Routing(routing string) *ExplainService
Routing sets a specific routing value.
func (*ExplainService) Source ¶
func (s *ExplainService) Source(source string) *ExplainService
Source is the URL-encoded query definition (instead of using the request body).
func (*ExplainService) Type ¶
func (s *ExplainService) Type(typ string) *ExplainService
Type is the type of the document.
func (*ExplainService) Validate ¶
func (s *ExplainService) Validate() error
Validate checks if the operation is valid.
func (*ExplainService) XSource ¶
func (s *ExplainService) XSource(xSource ...string) *ExplainService
XSource is true or false to return the _source field or not, or a list of fields to return.
func (*ExplainService) XSourceExclude ¶
func (s *ExplainService) XSourceExclude(xSourceExclude ...string) *ExplainService
XSourceExclude is a list of fields to exclude from the returned _source field.
func (*ExplainService) XSourceInclude ¶
func (s *ExplainService) XSourceInclude(xSourceInclude ...string) *ExplainService
XSourceInclude is a list of fields to extract and return from the _source field.
type ExponentialDecayFunction ¶
type ExponentialDecayFunction struct {
// contains filtered or unexported fields
}
ExponentialDecayFunction builds an exponential decay score function. See https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-function-score-query.html for details.
func NewExponentialDecayFunction ¶
func NewExponentialDecayFunction() *ExponentialDecayFunction
NewExponentialDecayFunction creates a new ExponentialDecayFunction.
func (*ExponentialDecayFunction) Decay ¶
func (fn *ExponentialDecayFunction) Decay(decay float64) *ExponentialDecayFunction
Decay defines how documents are scored at the distance given a Scale. If no decay is defined, documents at the distance Scale will be scored 0.5.
func (*ExponentialDecayFunction) FieldName ¶
func (fn *ExponentialDecayFunction) FieldName(fieldName string) *ExponentialDecayFunction
FieldName specifies the name of the field to which this decay function is applied to.
func (*ExponentialDecayFunction) GetWeight ¶
func (fn *ExponentialDecayFunction) GetWeight() *float64
GetWeight returns the adjusted score. It is part of the ScoreFunction interface. Returns nil if weight is not specified.
func (*ExponentialDecayFunction) MultiValueMode ¶
func (fn *ExponentialDecayFunction) MultiValueMode(mode string) *ExponentialDecayFunction
MultiValueMode specifies how the decay function should be calculated on a field that has multiple values. Valid modes are: min, max, avg, and sum.
func (*ExponentialDecayFunction) Name ¶
func (fn *ExponentialDecayFunction) Name() string
Name represents the JSON field name under which the output of Source needs to be serialized by FunctionScoreQuery (see FunctionScoreQuery.Source).
func (*ExponentialDecayFunction) Offset ¶
func (fn *ExponentialDecayFunction) Offset(offset interface{}) *ExponentialDecayFunction
Offset, if defined, computes the decay function only for a distance greater than the defined offset.
func (*ExponentialDecayFunction) Origin ¶
func (fn *ExponentialDecayFunction) Origin(origin interface{}) *ExponentialDecayFunction
Origin defines the "central point" by which the decay function calculates "distance".
func (*ExponentialDecayFunction) Scale ¶
func (fn *ExponentialDecayFunction) Scale(scale interface{}) *ExponentialDecayFunction
Scale defines the scale to be used with Decay.
func (*ExponentialDecayFunction) Source ¶
func (fn *ExponentialDecayFunction) Source() (interface{}, error)
Source returns the serializable JSON data of this score function.
func (*ExponentialDecayFunction) Weight ¶
func (fn *ExponentialDecayFunction) Weight(weight float64) *ExponentialDecayFunction
Weight adjusts the score of the score function. See https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-function-score-query.html#_using_function_score for details.
type ExtendedStatsAggregation ¶
type ExtendedStatsAggregation struct {
// contains filtered or unexported fields
}
ExtendedExtendedStatsAggregation is a multi-value metrics aggregation that computes stats over numeric values extracted from the aggregated documents. These values can be extracted either from specific numeric fields in the documents, or be generated by a provided script. See: http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/search-aggregations-metrics-extendedstats-aggregation.html
func NewExtendedStatsAggregation ¶
func NewExtendedStatsAggregation() *ExtendedStatsAggregation
func (*ExtendedStatsAggregation) Field ¶
func (a *ExtendedStatsAggregation) Field(field string) *ExtendedStatsAggregation
func (*ExtendedStatsAggregation) Format ¶
func (a *ExtendedStatsAggregation) Format(format string) *ExtendedStatsAggregation
func (*ExtendedStatsAggregation) Meta ¶
func (a *ExtendedStatsAggregation) Meta(metaData map[string]interface{}) *ExtendedStatsAggregation
Meta sets the meta data to be included in the aggregation response.
func (*ExtendedStatsAggregation) Script ¶
func (a *ExtendedStatsAggregation) Script(script *Script) *ExtendedStatsAggregation
func (*ExtendedStatsAggregation) Source ¶
func (a *ExtendedStatsAggregation) Source() (interface{}, error)
func (*ExtendedStatsAggregation) SubAggregation ¶
func (a *ExtendedStatsAggregation) SubAggregation(name string, subAggregation Aggregation) *ExtendedStatsAggregation
type FetchSourceContext ¶
type FetchSourceContext struct {
// contains filtered or unexported fields
}
func NewFetchSourceContext ¶
func NewFetchSourceContext(fetchSource bool) *FetchSourceContext
func (*FetchSourceContext) Exclude ¶
func (fsc *FetchSourceContext) Exclude(excludes ...string) *FetchSourceContext
func (*FetchSourceContext) FetchSource ¶
func (fsc *FetchSourceContext) FetchSource() bool
func (*FetchSourceContext) Include ¶
func (fsc *FetchSourceContext) Include(includes ...string) *FetchSourceContext
func (*FetchSourceContext) Query ¶
func (fsc *FetchSourceContext) Query() url.Values
Query returns the parameters in a form suitable for a URL query string.
func (*FetchSourceContext) SetFetchSource ¶
func (fsc *FetchSourceContext) SetFetchSource(fetchSource bool)
func (*FetchSourceContext) Source ¶
func (fsc *FetchSourceContext) Source() (interface{}, error)
func (*FetchSourceContext) TransformSource ¶
func (fsc *FetchSourceContext) TransformSource(transformSource bool) *FetchSourceContext
type FieldSort ¶
type FieldSort struct { Sorter // contains filtered or unexported fields }
FieldSort sorts by a given field.
func NewFieldSort ¶
NewFieldSort creates a new FieldSort.
func (FieldSort) IgnoreUnmapped ¶
IgnoreUnmapped specifies what happens if the field does not exist in the index. Set it to true to ignore, or set it to false to not ignore (default).
func (FieldSort) Missing ¶
Missing sets the value to be used when a field is missing in a document. You can also use "_last" or "_first" to sort missing last or first respectively.
func (FieldSort) NestedFilter ¶
NestedFilter sets a filter that nested objects should match with in order to be taken into account for sorting.
func (FieldSort) NestedPath ¶
NestedPath is used if sorting occurs on a field that is inside a nested object.
func (FieldSort) SortMode ¶
SortMode specifies what values to pick in case a document contains multiple values for the targeted sort field. Possible values are: min, max, sum, and avg.
func (FieldSort) UnmappedType ¶
UnmappedType sets the type to use when the current field is not mapped in an index.
type FieldStatistics ¶
type FieldValueFactorFunction ¶
type FieldValueFactorFunction struct {
// contains filtered or unexported fields
}
FieldValueFactorFunction is a function score function that allows you to use a field from a document to influence the score. See http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/query-dsl-function-score-query.html#_field_value_factor.
func NewFieldValueFactorFunction ¶
func NewFieldValueFactorFunction() *FieldValueFactorFunction
NewFieldValueFactorFunction initializes and returns a new FieldValueFactorFunction.
func (*FieldValueFactorFunction) Factor ¶
func (fn *FieldValueFactorFunction) Factor(factor float64) *FieldValueFactorFunction
Factor is the (optional) factor to multiply the field with. If you do not specify a factor, the default is 1.
func (*FieldValueFactorFunction) Field ¶
func (fn *FieldValueFactorFunction) Field(field string) *FieldValueFactorFunction
Field is the field to be extracted from the document.
func (*FieldValueFactorFunction) GetWeight ¶
func (fn *FieldValueFactorFunction) GetWeight() *float64
GetWeight returns the adjusted score. It is part of the ScoreFunction interface. Returns nil if weight is not specified.
func (*FieldValueFactorFunction) Missing ¶
func (fn *FieldValueFactorFunction) Missing(missing float64) *FieldValueFactorFunction
Missing is used if a document does not have that field.
func (*FieldValueFactorFunction) Modifier ¶
func (fn *FieldValueFactorFunction) Modifier(modifier string) *FieldValueFactorFunction
Modifier to apply to the field value. It can be one of: none, log, log1p, log2p, ln, ln1p, ln2p, square, sqrt, or reciprocal. Defaults to: none.
func (*FieldValueFactorFunction) Name ¶
func (fn *FieldValueFactorFunction) Name() string
Name represents the JSON field name under which the output of Source needs to be serialized by FunctionScoreQuery (see FunctionScoreQuery.Source).
func (*FieldValueFactorFunction) Source ¶
func (fn *FieldValueFactorFunction) Source() (interface{}, error)
Source returns the serializable JSON data of this score function.
func (*FieldValueFactorFunction) Weight ¶
func (fn *FieldValueFactorFunction) Weight(weight float64) *FieldValueFactorFunction
Weight adjusts the score of the score function. See https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-function-score-query.html#_using_function_score for details.
type FilterAggregation ¶
type FilterAggregation struct {
// contains filtered or unexported fields
}
FilterAggregation defines a single bucket of all the documents in the current document set context that match a specified filter. Often this will be used to narrow down the current aggregation context to a specific set of documents. See: http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/search-aggregations-bucket-filter-aggregation.html
func NewFilterAggregation ¶
func NewFilterAggregation() *FilterAggregation
func (*FilterAggregation) Filter ¶
func (a *FilterAggregation) Filter(filter Query) *FilterAggregation
func (*FilterAggregation) Meta ¶
func (a *FilterAggregation) Meta(metaData map[string]interface{}) *FilterAggregation
Meta sets the meta data to be included in the aggregation response.
func (*FilterAggregation) Source ¶
func (a *FilterAggregation) Source() (interface{}, error)
func (*FilterAggregation) SubAggregation ¶
func (a *FilterAggregation) SubAggregation(name string, subAggregation Aggregation) *FilterAggregation
type FiltersAggregation ¶
type FiltersAggregation struct {
// contains filtered or unexported fields
}
FiltersAggregation defines a multi bucket aggregations where each bucket is associated with a filter. Each bucket will collect all documents that match its associated filter. See: http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/search-aggregations-bucket-filters-aggregation.html
func NewFiltersAggregation ¶
func NewFiltersAggregation() *FiltersAggregation
func (*FiltersAggregation) Filter ¶
func (a *FiltersAggregation) Filter(filter Query) *FiltersAggregation
func (*FiltersAggregation) Filters ¶
func (a *FiltersAggregation) Filters(filters ...Query) *FiltersAggregation
func (*FiltersAggregation) Meta ¶
func (a *FiltersAggregation) Meta(metaData map[string]interface{}) *FiltersAggregation
Meta sets the meta data to be included in the aggregation response.
func (*FiltersAggregation) Source ¶
func (a *FiltersAggregation) Source() (interface{}, error)
func (*FiltersAggregation) SubAggregation ¶
func (a *FiltersAggregation) SubAggregation(name string, subAggregation Aggregation) *FiltersAggregation
type FunctionScoreQuery ¶
type FunctionScoreQuery struct {
// contains filtered or unexported fields
}
FunctionScoreQuery allows you to modify the score of documents that are retrieved by a query. This can be useful if, for example, a score function is computationally expensive and it is sufficient to compute the score on a filtered set of documents.
For more details, see https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-function-score-query.html
func NewFunctionScoreQuery ¶
func NewFunctionScoreQuery() *FunctionScoreQuery
NewFunctionScoreQuery creates and initializes a new function score query.
func (*FunctionScoreQuery) Add ¶
func (q *FunctionScoreQuery) Add(filter Query, scoreFunc ScoreFunction) *FunctionScoreQuery
Add adds a score function that will execute on all the documents matching the filter.
func (*FunctionScoreQuery) AddScoreFunc ¶
func (q *FunctionScoreQuery) AddScoreFunc(scoreFunc ScoreFunction) *FunctionScoreQuery
AddScoreFunc adds a score function that will execute the function on all documents.
func (*FunctionScoreQuery) Boost ¶
func (q *FunctionScoreQuery) Boost(boost float64) *FunctionScoreQuery
Boost sets the boost for this query. Documents matching this query will (in addition to the normal weightings) have their score multiplied by the boost provided.
func (*FunctionScoreQuery) BoostMode ¶
func (q *FunctionScoreQuery) BoostMode(boostMode string) *FunctionScoreQuery
BoostMode defines how the combined result of score functions will influence the final score together with the sub query score.
func (*FunctionScoreQuery) Filter ¶
func (q *FunctionScoreQuery) Filter(filter Query) *FunctionScoreQuery
Filter sets the filter for the function score query.
func (*FunctionScoreQuery) MaxBoost ¶
func (q *FunctionScoreQuery) MaxBoost(maxBoost float64) *FunctionScoreQuery
MaxBoost is the maximum boost that will be applied by function score.
func (*FunctionScoreQuery) MinScore ¶
func (q *FunctionScoreQuery) MinScore(minScore float64) *FunctionScoreQuery
MinScore sets the minimum score.
func (*FunctionScoreQuery) Query ¶
func (q *FunctionScoreQuery) Query(query Query) *FunctionScoreQuery
Query sets the query for the function score query.
func (*FunctionScoreQuery) ScoreMode ¶
func (q *FunctionScoreQuery) ScoreMode(scoreMode string) *FunctionScoreQuery
ScoreMode defines how results of individual score functions will be aggregated. Can be first, avg, max, sum, min, or multiply.
func (*FunctionScoreQuery) Source ¶
func (q *FunctionScoreQuery) Source() (interface{}, error)
Source returns JSON for the function score query.
type Fuzziness ¶
type Fuzziness struct { }
Fuzziness defines the fuzziness which is used in FuzzyCompletionSuggester.
type FuzzyCompletionSuggester ¶
type FuzzyCompletionSuggester struct { Suggester // contains filtered or unexported fields }
FuzzyFuzzyCompletionSuggester is a FuzzyCompletionSuggester that allows fuzzy completion. See http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/search-suggesters-completion.html for details, and http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/search-suggesters-completion.html#fuzzy for details about the fuzzy completion suggester.
func NewFuzzyCompletionSuggester ¶
func NewFuzzyCompletionSuggester(name string) *FuzzyCompletionSuggester
Creates a new completion suggester.
func (*FuzzyCompletionSuggester) Analyzer ¶
func (q *FuzzyCompletionSuggester) Analyzer(analyzer string) *FuzzyCompletionSuggester
func (*FuzzyCompletionSuggester) ContextQueries ¶
func (q *FuzzyCompletionSuggester) ContextQueries(queries ...SuggesterContextQuery) *FuzzyCompletionSuggester
func (*FuzzyCompletionSuggester) ContextQuery ¶
func (q *FuzzyCompletionSuggester) ContextQuery(query SuggesterContextQuery) *FuzzyCompletionSuggester
func (*FuzzyCompletionSuggester) Field ¶
func (q *FuzzyCompletionSuggester) Field(field string) *FuzzyCompletionSuggester
func (*FuzzyCompletionSuggester) Fuzziness ¶
func (q *FuzzyCompletionSuggester) Fuzziness(fuzziness interface{}) *FuzzyCompletionSuggester
Fuzziness defines the strategy used to describe what "fuzzy" actually means for the suggester, e.g. 1, 2, "0", "1..2", ">4", or "AUTO". See http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/common-options.html#fuzziness for a detailed description.
func (*FuzzyCompletionSuggester) FuzzyMinLength ¶
func (q *FuzzyCompletionSuggester) FuzzyMinLength(minLength int) *FuzzyCompletionSuggester
func (*FuzzyCompletionSuggester) FuzzyPrefixLength ¶
func (q *FuzzyCompletionSuggester) FuzzyPrefixLength(prefixLength int) *FuzzyCompletionSuggester
func (*FuzzyCompletionSuggester) FuzzyTranspositions ¶
func (q *FuzzyCompletionSuggester) FuzzyTranspositions(fuzzyTranspositions bool) *FuzzyCompletionSuggester
func (*FuzzyCompletionSuggester) Name ¶
func (q *FuzzyCompletionSuggester) Name() string
func (*FuzzyCompletionSuggester) ShardSize ¶
func (q *FuzzyCompletionSuggester) ShardSize(shardSize int) *FuzzyCompletionSuggester
func (*FuzzyCompletionSuggester) Size ¶
func (q *FuzzyCompletionSuggester) Size(size int) *FuzzyCompletionSuggester
func (*FuzzyCompletionSuggester) Source ¶
func (q *FuzzyCompletionSuggester) Source(includeName bool) (interface{}, error)
Creates the source for the completion suggester.
func (*FuzzyCompletionSuggester) Text ¶
func (q *FuzzyCompletionSuggester) Text(text string) *FuzzyCompletionSuggester
func (*FuzzyCompletionSuggester) UnicodeAware ¶
func (q *FuzzyCompletionSuggester) UnicodeAware(unicodeAware bool) *FuzzyCompletionSuggester
type FuzzyQuery ¶
type FuzzyQuery struct {
// contains filtered or unexported fields
}
FuzzyQuery uses similarity based on Levenshtein edit distance for string fields, and a +/- margin on numeric and date fields.
For more details, see https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-fuzzy-query.html
func NewFuzzyQuery ¶
func NewFuzzyQuery(name string, value interface{}) *FuzzyQuery
NewFuzzyQuery creates a new fuzzy query.
func (*FuzzyQuery) Boost ¶
func (q *FuzzyQuery) Boost(boost float64) *FuzzyQuery
Boost sets the boost for this query. Documents matching this query will (in addition to the normal weightings) have their score multiplied by the boost provided.
func (*FuzzyQuery) Fuzziness ¶
func (q *FuzzyQuery) Fuzziness(fuzziness interface{}) *FuzzyQuery
Fuzziness can be an integer/long like 0, 1 or 2 as well as strings like "auto", "0..1", "1..4" or "0.0..1.0".
func (*FuzzyQuery) MaxExpansions ¶
func (q *FuzzyQuery) MaxExpansions(maxExpansions int) *FuzzyQuery
func (*FuzzyQuery) PrefixLength ¶
func (q *FuzzyQuery) PrefixLength(prefixLength int) *FuzzyQuery
func (*FuzzyQuery) QueryName ¶
func (q *FuzzyQuery) QueryName(queryName string) *FuzzyQuery
QueryName sets the query name for the filter that can be used when searching for matched filters per hit.
func (*FuzzyQuery) Rewrite ¶
func (q *FuzzyQuery) Rewrite(rewrite string) *FuzzyQuery
func (*FuzzyQuery) Source ¶
func (q *FuzzyQuery) Source() (interface{}, error)
Source returns JSON for the function score query.
func (*FuzzyQuery) Transpositions ¶
func (q *FuzzyQuery) Transpositions(transpositions bool) *FuzzyQuery
type GaussDecayFunction ¶
type GaussDecayFunction struct {
// contains filtered or unexported fields
}
GaussDecayFunction builds a gauss decay score function. See https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-function-score-query.html for details.
func NewGaussDecayFunction ¶
func NewGaussDecayFunction() *GaussDecayFunction
NewGaussDecayFunction returns a new GaussDecayFunction.
func (*GaussDecayFunction) Decay ¶
func (fn *GaussDecayFunction) Decay(decay float64) *GaussDecayFunction
Decay defines how documents are scored at the distance given a Scale. If no decay is defined, documents at the distance Scale will be scored 0.5.
func (*GaussDecayFunction) FieldName ¶
func (fn *GaussDecayFunction) FieldName(fieldName string) *GaussDecayFunction
FieldName specifies the name of the field to which this decay function is applied to.
func (*GaussDecayFunction) GetWeight ¶
func (fn *GaussDecayFunction) GetWeight() *float64
GetWeight returns the adjusted score. It is part of the ScoreFunction interface. Returns nil if weight is not specified.
func (*GaussDecayFunction) MultiValueMode ¶
func (fn *GaussDecayFunction) MultiValueMode(mode string) *GaussDecayFunction
MultiValueMode specifies how the decay function should be calculated on a field that has multiple values. Valid modes are: min, max, avg, and sum.
func (*GaussDecayFunction) Name ¶
func (fn *GaussDecayFunction) Name() string
Name represents the JSON field name under which the output of Source needs to be serialized by FunctionScoreQuery (see FunctionScoreQuery.Source).
func (*GaussDecayFunction) Offset ¶
func (fn *GaussDecayFunction) Offset(offset interface{}) *GaussDecayFunction
Offset, if defined, computes the decay function only for a distance greater than the defined offset.
func (*GaussDecayFunction) Origin ¶
func (fn *GaussDecayFunction) Origin(origin interface{}) *GaussDecayFunction
Origin defines the "central point" by which the decay function calculates "distance".
func (*GaussDecayFunction) Scale ¶
func (fn *GaussDecayFunction) Scale(scale interface{}) *GaussDecayFunction
Scale defines the scale to be used with Decay.
func (*GaussDecayFunction) Source ¶
func (fn *GaussDecayFunction) Source() (interface{}, error)
Source returns the serializable JSON data of this score function.
func (*GaussDecayFunction) Weight ¶
func (fn *GaussDecayFunction) Weight(weight float64) *GaussDecayFunction
Weight adjusts the score of the score function. See https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-function-score-query.html#_using_function_score for details.
type GeoBoundingBoxQuery ¶
type GeoBoundingBoxQuery struct {
// contains filtered or unexported fields
}
GeoBoundingBoxQuery allows to filter hits based on a point location using a bounding box.
For more details, see: https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-geo-bounding-box-query.html
func NewGeoBoundingBoxQuery ¶
func NewGeoBoundingBoxQuery(name string) *GeoBoundingBoxQuery
NewGeoBoundingBoxQuery creates and initializes a new GeoBoundingBoxQuery.
func (*GeoBoundingBoxQuery) BottomLeft ¶
func (q *GeoBoundingBoxQuery) BottomLeft(bottom, left float64) *GeoBoundingBoxQuery
func (*GeoBoundingBoxQuery) BottomLeftFromGeoPoint ¶
func (q *GeoBoundingBoxQuery) BottomLeftFromGeoPoint(point *GeoPoint) *GeoBoundingBoxQuery
func (*GeoBoundingBoxQuery) BottomRight ¶
func (q *GeoBoundingBoxQuery) BottomRight(bottom, right float64) *GeoBoundingBoxQuery
func (*GeoBoundingBoxQuery) BottomRightFromGeoPoint ¶
func (q *GeoBoundingBoxQuery) BottomRightFromGeoPoint(point *GeoPoint) *GeoBoundingBoxQuery
func (*GeoBoundingBoxQuery) QueryName ¶
func (q *GeoBoundingBoxQuery) QueryName(queryName string) *GeoBoundingBoxQuery
func (*GeoBoundingBoxQuery) Source ¶
func (q *GeoBoundingBoxQuery) Source() (interface{}, error)
Source returns JSON for the function score query.
func (*GeoBoundingBoxQuery) TopLeft ¶
func (q *GeoBoundingBoxQuery) TopLeft(top, left float64) *GeoBoundingBoxQuery
func (*GeoBoundingBoxQuery) TopLeftFromGeoPoint ¶
func (q *GeoBoundingBoxQuery) TopLeftFromGeoPoint(point *GeoPoint) *GeoBoundingBoxQuery
func (*GeoBoundingBoxQuery) TopRight ¶
func (q *GeoBoundingBoxQuery) TopRight(top, right float64) *GeoBoundingBoxQuery
func (*GeoBoundingBoxQuery) TopRightFromGeoPoint ¶
func (q *GeoBoundingBoxQuery) TopRightFromGeoPoint(point *GeoPoint) *GeoBoundingBoxQuery
func (*GeoBoundingBoxQuery) Type ¶
func (q *GeoBoundingBoxQuery) Type(typ string) *GeoBoundingBoxQuery
Type sets the type of executing the geo bounding box. It can be either memory or indexed. It defaults to memory.
type GeoBoundsAggregation ¶
type GeoBoundsAggregation struct {
// contains filtered or unexported fields
}
GeoBoundsAggregation is a metric aggregation that computes the bounding box containing all geo_point values for a field. See: http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/search-aggregations-metrics-geobounds-aggregation.html
func NewGeoBoundsAggregation ¶
func NewGeoBoundsAggregation() *GeoBoundsAggregation
func (*GeoBoundsAggregation) Field ¶
func (a *GeoBoundsAggregation) Field(field string) *GeoBoundsAggregation
func (*GeoBoundsAggregation) Meta ¶
func (a *GeoBoundsAggregation) Meta(metaData map[string]interface{}) *GeoBoundsAggregation
Meta sets the meta data to be included in the aggregation response.
func (*GeoBoundsAggregation) Script ¶
func (a *GeoBoundsAggregation) Script(script *Script) *GeoBoundsAggregation
func (*GeoBoundsAggregation) Source ¶
func (a *GeoBoundsAggregation) Source() (interface{}, error)
func (*GeoBoundsAggregation) SubAggregation ¶
func (a *GeoBoundsAggregation) SubAggregation(name string, subAggregation Aggregation) *GeoBoundsAggregation
func (*GeoBoundsAggregation) WrapLongitude ¶
func (a *GeoBoundsAggregation) WrapLongitude(wrapLongitude bool) *GeoBoundsAggregation
type GeoDistanceAggregation ¶
type GeoDistanceAggregation struct {
// contains filtered or unexported fields
}
GeoDistanceAggregation is a multi-bucket aggregation that works on geo_point fields and conceptually works very similar to the range aggregation. The user can define a point of origin and a set of distance range buckets. The aggregation evaluate the distance of each document value from the origin point and determines the buckets it belongs to based on the ranges (a document belongs to a bucket if the distance between the document and the origin falls within the distance range of the bucket). See: http://www.elasticsearch.org/guide/en/elasticsearch/reference/master/search-aggregations-bucket-geodistance-aggregation.html
func NewGeoDistanceAggregation ¶
func NewGeoDistanceAggregation() *GeoDistanceAggregation
func (*GeoDistanceAggregation) AddRange ¶
func (a *GeoDistanceAggregation) AddRange(from, to interface{}) *GeoDistanceAggregation
func (*GeoDistanceAggregation) AddRangeWithKey ¶
func (a *GeoDistanceAggregation) AddRangeWithKey(key string, from, to interface{}) *GeoDistanceAggregation
func (*GeoDistanceAggregation) AddUnboundedFrom ¶
func (a *GeoDistanceAggregation) AddUnboundedFrom(to float64) *GeoDistanceAggregation
func (*GeoDistanceAggregation) AddUnboundedFromWithKey ¶
func (a *GeoDistanceAggregation) AddUnboundedFromWithKey(key string, to float64) *GeoDistanceAggregation
func (*GeoDistanceAggregation) AddUnboundedTo ¶
func (a *GeoDistanceAggregation) AddUnboundedTo(from float64) *GeoDistanceAggregation
func (*GeoDistanceAggregation) AddUnboundedToWithKey ¶
func (a *GeoDistanceAggregation) AddUnboundedToWithKey(key string, from float64) *GeoDistanceAggregation
func (*GeoDistanceAggregation) Between ¶
func (a *GeoDistanceAggregation) Between(from, to interface{}) *GeoDistanceAggregation
func (*GeoDistanceAggregation) BetweenWithKey ¶
func (a *GeoDistanceAggregation) BetweenWithKey(key string, from, to interface{}) *GeoDistanceAggregation
func (*GeoDistanceAggregation) DistanceType ¶
func (a *GeoDistanceAggregation) DistanceType(distanceType string) *GeoDistanceAggregation
func (*GeoDistanceAggregation) Field ¶
func (a *GeoDistanceAggregation) Field(field string) *GeoDistanceAggregation
func (*GeoDistanceAggregation) Meta ¶
func (a *GeoDistanceAggregation) Meta(metaData map[string]interface{}) *GeoDistanceAggregation
Meta sets the meta data to be included in the aggregation response.
func (*GeoDistanceAggregation) Point ¶
func (a *GeoDistanceAggregation) Point(latLon string) *GeoDistanceAggregation
func (*GeoDistanceAggregation) Source ¶
func (a *GeoDistanceAggregation) Source() (interface{}, error)
func (*GeoDistanceAggregation) SubAggregation ¶
func (a *GeoDistanceAggregation) SubAggregation(name string, subAggregation Aggregation) *GeoDistanceAggregation
func (*GeoDistanceAggregation) Unit ¶
func (a *GeoDistanceAggregation) Unit(unit string) *GeoDistanceAggregation
type GeoDistanceQuery ¶
type GeoDistanceQuery struct {
// contains filtered or unexported fields
}
GeoDistanceQuery filters documents that include only hits that exists within a specific distance from a geo point.
For more details, see: https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-geo-distance-query.html
func NewGeoDistanceQuery ¶
func NewGeoDistanceQuery(name string) *GeoDistanceQuery
NewGeoDistanceQuery creates and initializes a new GeoDistanceQuery.
func (*GeoDistanceQuery) Distance ¶
func (q *GeoDistanceQuery) Distance(distance string) *GeoDistanceQuery
func (*GeoDistanceQuery) DistanceType ¶
func (q *GeoDistanceQuery) DistanceType(distanceType string) *GeoDistanceQuery
func (*GeoDistanceQuery) GeoHash ¶
func (q *GeoDistanceQuery) GeoHash(geohash string) *GeoDistanceQuery
func (*GeoDistanceQuery) GeoPoint ¶
func (q *GeoDistanceQuery) GeoPoint(point *GeoPoint) *GeoDistanceQuery
func (*GeoDistanceQuery) Lat ¶
func (q *GeoDistanceQuery) Lat(lat float64) *GeoDistanceQuery
func (*GeoDistanceQuery) Lon ¶
func (q *GeoDistanceQuery) Lon(lon float64) *GeoDistanceQuery
func (*GeoDistanceQuery) OptimizeBbox ¶
func (q *GeoDistanceQuery) OptimizeBbox(optimizeBbox string) *GeoDistanceQuery
func (*GeoDistanceQuery) Point ¶
func (q *GeoDistanceQuery) Point(lat, lon float64) *GeoDistanceQuery
func (*GeoDistanceQuery) QueryName ¶
func (q *GeoDistanceQuery) QueryName(queryName string) *GeoDistanceQuery
func (*GeoDistanceQuery) Source ¶
func (q *GeoDistanceQuery) Source() (interface{}, error)
Source returns JSON for the function score query.
type GeoDistanceSort ¶
type GeoDistanceSort struct { Sorter // contains filtered or unexported fields }
GeoDistanceSort allows for sorting by geographic distance. See http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/search-request-sort.html#_geo_distance_sorting.
func NewGeoDistanceSort ¶
func NewGeoDistanceSort(fieldName string) GeoDistanceSort
NewGeoDistanceSort creates a new sorter for geo distances.
func (GeoDistanceSort) Asc ¶
func (s GeoDistanceSort) Asc() GeoDistanceSort
Asc sets ascending sort order.
func (GeoDistanceSort) Desc ¶
func (s GeoDistanceSort) Desc() GeoDistanceSort
Desc sets descending sort order.
func (GeoDistanceSort) FieldName ¶
func (s GeoDistanceSort) FieldName(fieldName string) GeoDistanceSort
FieldName specifies the name of the (geo) field to use for sorting.
func (GeoDistanceSort) GeoDistance ¶
func (s GeoDistanceSort) GeoDistance(geoDistance string) GeoDistanceSort
GeoDistance represents how to compute the distance. It can be sloppy_arc (default), arc, or plane. See http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/search-request-sort.html#_geo_distance_sorting.
func (GeoDistanceSort) GeoHashes ¶
func (s GeoDistanceSort) GeoHashes(geohashes ...string) GeoDistanceSort
GeoHashes specifies the geo point to create the range distance aggregations from.
func (GeoDistanceSort) NestedFilter ¶
func (s GeoDistanceSort) NestedFilter(nestedFilter Query) GeoDistanceSort
NestedFilter sets a filter that nested objects should match with in order to be taken into account for sorting.
func (GeoDistanceSort) NestedPath ¶
func (s GeoDistanceSort) NestedPath(nestedPath string) GeoDistanceSort
NestedPath is used if sorting occurs on a field that is inside a nested object.
func (GeoDistanceSort) Order ¶
func (s GeoDistanceSort) Order(ascending bool) GeoDistanceSort
Order defines whether sorting ascending (default) or descending.
func (GeoDistanceSort) Point ¶
func (s GeoDistanceSort) Point(lat, lon float64) GeoDistanceSort
Point specifies a point to create the range distance aggregations from.
func (GeoDistanceSort) Points ¶
func (s GeoDistanceSort) Points(points ...*GeoPoint) GeoDistanceSort
Points specifies the geo point(s) to create the range distance aggregations from.
func (GeoDistanceSort) SortMode ¶
func (s GeoDistanceSort) SortMode(sortMode string) GeoDistanceSort
SortMode specifies what values to pick in case a document contains multiple values for the targeted sort field. Possible values are: min, max, sum, and avg.
func (GeoDistanceSort) Source ¶
func (s GeoDistanceSort) Source() (interface{}, error)
Source returns the JSON-serializable data.
func (GeoDistanceSort) Unit ¶
func (s GeoDistanceSort) Unit(unit string) GeoDistanceSort
Unit specifies the distance unit to use. It defaults to km. See http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/common-options.html#distance-units for details.
type GeoPoint ¶
type GeoPoint struct {
Lat, Lon float64
}
GeoPoint is a geographic position described via latitude and longitude.
func GeoPointFromLatLon ¶
GeoPointFromLatLon initializes a new GeoPoint by latitude and longitude.
func GeoPointFromString ¶
GeoPointFromString initializes a new GeoPoint by a string that is formatted as "{latitude},{longitude}", e.g. "40.10210,-70.12091".
type GeoPolygonQuery ¶
type GeoPolygonQuery struct {
// contains filtered or unexported fields
}
GeoPolygonQuery allows to include hits that only fall within a polygon of points.
For more details, see: https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-geo-polygon-query.html
func NewGeoPolygonQuery ¶
func NewGeoPolygonQuery(name string) *GeoPolygonQuery
NewGeoPolygonQuery creates and initializes a new GeoPolygonQuery.
func (*GeoPolygonQuery) AddGeoPoint ¶
func (q *GeoPolygonQuery) AddGeoPoint(point *GeoPoint) *GeoPolygonQuery
AddGeoPoint adds a GeoPoint.
func (*GeoPolygonQuery) AddPoint ¶
func (q *GeoPolygonQuery) AddPoint(lat, lon float64) *GeoPolygonQuery
AddPoint adds a point from latitude and longitude.
func (*GeoPolygonQuery) QueryName ¶
func (q *GeoPolygonQuery) QueryName(queryName string) *GeoPolygonQuery
func (*GeoPolygonQuery) Source ¶
func (q *GeoPolygonQuery) Source() (interface{}, error)
Source returns JSON for the function score query.
type GetMappingService ¶
type GetMappingService struct {
// contains filtered or unexported fields
}
GetMappingService retrieves the mapping definitions for an index or index/type. See at http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/indices-get-mapping.html.
func NewGetMappingService ¶
func NewGetMappingService(client *Client) *GetMappingService
NewGetMappingService creates a new GetMappingService.
func (*GetMappingService) AllowNoIndices ¶
func (s *GetMappingService) AllowNoIndices(allowNoIndices bool) *GetMappingService
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 (*GetMappingService) Do ¶
func (s *GetMappingService) Do() (map[string]interface{}, error)
Do executes the operation. When successful, it returns a json.RawMessage. If you specify an index, Elasticsearch returns HTTP status 404. if you specify a type that does not exist, Elasticsearch returns an empty map.
func (*GetMappingService) ExpandWildcards ¶
func (s *GetMappingService) ExpandWildcards(expandWildcards string) *GetMappingService
ExpandWildcards indicates whether to expand wildcard expression to concrete indices that are open, closed or both..
func (*GetMappingService) IgnoreUnavailable ¶
func (s *GetMappingService) IgnoreUnavailable(ignoreUnavailable bool) *GetMappingService
IgnoreUnavailable indicates whether specified concrete indices should be ignored when unavailable (missing or closed).
func (*GetMappingService) Index ¶
func (s *GetMappingService) Index(indices ...string) *GetMappingService
Index is a list of index names.
func (*GetMappingService) Local ¶
func (s *GetMappingService) Local(local bool) *GetMappingService
Local indicates whether to return local information, do not retrieve the state from master node (default: false).
func (*GetMappingService) Pretty ¶
func (s *GetMappingService) Pretty(pretty bool) *GetMappingService
Pretty indicates that the JSON response be indented and human readable.
func (*GetMappingService) Type ¶
func (s *GetMappingService) Type(types ...string) *GetMappingService
Type is a list of document types.
func (*GetMappingService) Validate ¶
func (s *GetMappingService) Validate() error
Validate checks if the operation is valid.
type GetResult ¶
type GetResult struct { Index string `json:"_index"` // index meta field Type string `json:"_type"` // type meta field Id string `json:"_id"` // id meta field Uid string `json:"_uid"` // uid meta field (see MapperService.java for all meta fields) Timestamp int64 `json:"_timestamp"` // timestamp meta field TTL int64 `json:"_ttl"` // ttl meta field Routing string `json:"_routing"` // routing meta field Parent string `json:"_parent"` // parent meta field Version *int64 `json:"_version"` // version number, when Version is set to true in SearchService Source *json.RawMessage `json:"_source,omitempty"` Found bool `json:"found,omitempty"` Fields map[string]interface{} `json:"fields,omitempty"` //Error string `json:"error,omitempty"` // used only in MultiGet // TODO double-check that MultiGet now returns details error information Error *ErrorDetails `json:"error,omitempty"` // only used in MultiGet }
GetResult is the outcome of GetService.Do.
type GetService ¶
type GetService struct {
// contains filtered or unexported fields
}
GetService allows to get a typed JSON document from the index based on its id.
See https://www.elastic.co/guide/en/elasticsearch/reference/current/docs-get.html for details.
func NewGetService ¶
func NewGetService(client *Client) *GetService
NewGetService creates a new GetService.
func (*GetService) FetchSource ¶
func (s *GetService) FetchSource(fetchSource bool) *GetService
func (*GetService) FetchSourceContext ¶
func (s *GetService) FetchSourceContext(fetchSourceContext *FetchSourceContext) *GetService
func (*GetService) Fields ¶
func (s *GetService) Fields(fields ...string) *GetService
Fields is a list of fields to return in the response.
func (*GetService) IgnoreErrorsOnGeneratedFields ¶
func (s *GetService) IgnoreErrorsOnGeneratedFields(ignore bool) *GetService
IgnoreErrorsOnGeneratedFields indicates whether to ignore fields that are generated if the transaction log is accessed.
func (*GetService) Index ¶
func (s *GetService) Index(index string) *GetService
Index is the name of the index.
func (*GetService) Parent ¶
func (s *GetService) Parent(parent string) *GetService
Parent is the ID of the parent document.
func (*GetService) Preference ¶
func (s *GetService) Preference(preference string) *GetService
Preference specifies the node or shard the operation should be performed on (default: random).
func (*GetService) Pretty ¶
func (s *GetService) Pretty(pretty bool) *GetService
Pretty indicates that the JSON response be indented and human readable.
func (*GetService) Realtime ¶
func (s *GetService) Realtime(realtime bool) *GetService
Realtime specifies whether to perform the operation in realtime or search mode.
func (*GetService) Refresh ¶
func (s *GetService) Refresh(refresh bool) *GetService
Refresh the shard containing the document before performing the operation.
func (*GetService) Routing ¶
func (s *GetService) Routing(routing string) *GetService
Routing is the specific routing value.
func (*GetService) Type ¶
func (s *GetService) Type(typ string) *GetService
Type is the type of the document (use `_all` to fetch the first document matching the ID across all types).
func (*GetService) Validate ¶
func (s *GetService) Validate() error
Validate checks if the operation is valid.
func (*GetService) Version ¶
func (s *GetService) Version(version interface{}) *GetService
Version is an explicit version number for concurrency control.
func (*GetService) VersionType ¶
func (s *GetService) VersionType(versionType string) *GetService
VersionType is the specific version type.
type GetTemplateResponse ¶
type GetTemplateResponse struct {
Template string `json:"template"`
}
type GetTemplateService ¶
type GetTemplateService struct {
// contains filtered or unexported fields
}
GetTemplateService reads a search template. It is documented at http://www.elasticsearch.org/guide/en/elasticsearch/reference/master/search-template.html.
Example ¶
client, err := elastic.NewClient() if err != nil { panic(err) } // Get template stored under "my-search-template" resp, err := client.GetTemplate().Id("my-search-template").Do() if err != nil { panic(err) } fmt.Printf("search template is: %q\n", resp.Template)
Output:
func NewGetTemplateService ¶
func NewGetTemplateService(client *Client) *GetTemplateService
NewGetTemplateService creates a new GetTemplateService.
func (*GetTemplateService) Do ¶
func (s *GetTemplateService) Do() (*GetTemplateResponse, error)
Do executes the operation and returns the template.
func (*GetTemplateService) Id ¶
func (s *GetTemplateService) Id(id string) *GetTemplateService
Id is the template ID.
func (*GetTemplateService) Validate ¶
func (s *GetTemplateService) Validate() error
Validate checks if the operation is valid.
func (*GetTemplateService) Version ¶
func (s *GetTemplateService) Version(version interface{}) *GetTemplateService
Version is an explicit version number for concurrency control.
func (*GetTemplateService) VersionType ¶
func (s *GetTemplateService) VersionType(versionType string) *GetTemplateService
VersionType is a specific version type.
type GlobalAggregation ¶
type GlobalAggregation struct {
// contains filtered or unexported fields
}
GlobalAggregation defines a single bucket of all the documents within the search execution context. This context is defined by the indices and the document types you’re searching on, but is not influenced by the search query itself. See: http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/search-aggregations-bucket-global-aggregation.html
func NewGlobalAggregation ¶
func NewGlobalAggregation() *GlobalAggregation
func (*GlobalAggregation) Meta ¶
func (a *GlobalAggregation) Meta(metaData map[string]interface{}) *GlobalAggregation
Meta sets the meta data to be included in the aggregation response.
func (*GlobalAggregation) Source ¶
func (a *GlobalAggregation) Source() (interface{}, error)
func (*GlobalAggregation) SubAggregation ¶
func (a *GlobalAggregation) SubAggregation(name string, subAggregation Aggregation) *GlobalAggregation
type HasChildQuery ¶
type HasChildQuery struct {
// contains filtered or unexported fields
}
HasChildQuery accepts a query and the child type to run against, and results in parent documents that have child docs matching the query.
For more details, see https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-has-child-query.html
func NewHasChildQuery ¶
func NewHasChildQuery(childType string, query Query) *HasChildQuery
NewHasChildQuery creates and initializes a new has_child query.
func (*HasChildQuery) Boost ¶
func (q *HasChildQuery) Boost(boost float64) *HasChildQuery
Boost sets the boost for this query.
func (*HasChildQuery) InnerHit ¶
func (q *HasChildQuery) InnerHit(innerHit *InnerHit) *HasChildQuery
InnerHit sets the inner hit definition in the scope of this query and reusing the defined type and query.
func (*HasChildQuery) MaxChildren ¶
func (q *HasChildQuery) MaxChildren(maxChildren int) *HasChildQuery
MaxChildren defines the maximum number of children that are required to match for the parent to be considered a match.
func (*HasChildQuery) MinChildren ¶
func (q *HasChildQuery) MinChildren(minChildren int) *HasChildQuery
MinChildren defines the minimum number of children that are required to match for the parent to be considered a match.
func (*HasChildQuery) QueryName ¶
func (q *HasChildQuery) QueryName(queryName string) *HasChildQuery
QueryName specifies the query name for the filter that can be used when searching for matched filters per hit.
func (*HasChildQuery) ScoreType ¶
func (q *HasChildQuery) ScoreType(scoreType string) *HasChildQuery
ScoreType defines how the scores from the matching child documents are mapped into the parent document.
func (*HasChildQuery) ShortCircuitCutoff ¶
func (q *HasChildQuery) ShortCircuitCutoff(shortCircuitCutoff int) *HasChildQuery
ShortCircuitCutoff configures what cut off point only to evaluate parent documents that contain the matching parent id terms instead of evaluating all parent docs.
func (*HasChildQuery) Source ¶
func (q *HasChildQuery) Source() (interface{}, error)
Source returns JSON for the function score query.
type HasParentQuery ¶
type HasParentQuery struct {
// contains filtered or unexported fields
}
HasParentQuery accepts a query and a parent type. The query is executed in the parent document space which is specified by the parent type. This query returns child documents which associated parents have matched. For the rest has_parent query has the same options and works in the same manner as has_child query.
For more details, see https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-has-parent-query.html
func NewHasParentQuery ¶
func NewHasParentQuery(parentType string, query Query) *HasParentQuery
NewHasParentQuery creates and initializes a new has_parent query.
func (*HasParentQuery) Boost ¶
func (q *HasParentQuery) Boost(boost float64) *HasParentQuery
Boost sets the boost for this query.
func (*HasParentQuery) InnerHit ¶
func (q *HasParentQuery) InnerHit(innerHit *InnerHit) *HasParentQuery
InnerHit sets the inner hit definition in the scope of this query and reusing the defined type and query.
func (*HasParentQuery) QueryName ¶
func (q *HasParentQuery) QueryName(queryName string) *HasParentQuery
QueryName specifies the query name for the filter that can be used when searching for matched filters per hit.
func (*HasParentQuery) ScoreType ¶
func (q *HasParentQuery) ScoreType(scoreType string) *HasParentQuery
ScoreType defines how the parent score is mapped into the child documents.
func (*HasParentQuery) Source ¶
func (q *HasParentQuery) Source() (interface{}, error)
Source returns JSON for the function score query.
type Highlight ¶
type Highlight struct {
// contains filtered or unexported fields
}
Highlight allows highlighting search results on one or more fields. For details, see: http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/search-request-highlighting.html
func NewHighlight ¶
func NewHighlight() *Highlight
func (*Highlight) BoundaryChars ¶
func (*Highlight) BoundaryMaxScan ¶
func (*Highlight) Fields ¶
func (hl *Highlight) Fields(fields ...*HighlighterField) *Highlight
func (*Highlight) ForceSource ¶
func (*Highlight) FragmentSize ¶
func (*Highlight) Fragmenter ¶
func (*Highlight) HighlighQuery ¶
func (*Highlight) HighlightFilter ¶
func (*Highlight) HighlighterType ¶
func (*Highlight) NoMatchSize ¶
func (*Highlight) NumOfFragments ¶
func (*Highlight) RequireFieldMatch ¶
func (*Highlight) TagsSchema ¶
func (*Highlight) UseExplicitFieldOrder ¶
type HighlighterField ¶
type HighlighterField struct { Name string // contains filtered or unexported fields }
HighlighterField specifies a highlighted field.
func NewHighlighterField ¶
func NewHighlighterField(name string) *HighlighterField
func (*HighlighterField) BoundaryChars ¶
func (f *HighlighterField) BoundaryChars(boundaryChars ...rune) *HighlighterField
func (*HighlighterField) BoundaryMaxScan ¶
func (f *HighlighterField) BoundaryMaxScan(boundaryMaxScan int) *HighlighterField
func (*HighlighterField) ForceSource ¶
func (f *HighlighterField) ForceSource(forceSource bool) *HighlighterField
func (*HighlighterField) FragmentOffset ¶
func (f *HighlighterField) FragmentOffset(fragmentOffset int) *HighlighterField
func (*HighlighterField) FragmentSize ¶
func (f *HighlighterField) FragmentSize(fragmentSize int) *HighlighterField
func (*HighlighterField) Fragmenter ¶
func (f *HighlighterField) Fragmenter(fragmenter string) *HighlighterField
func (*HighlighterField) HighlightFilter ¶
func (f *HighlighterField) HighlightFilter(highlightFilter bool) *HighlighterField
func (*HighlighterField) HighlightQuery ¶
func (f *HighlighterField) HighlightQuery(highlightQuery Query) *HighlighterField
func (*HighlighterField) HighlighterType ¶
func (f *HighlighterField) HighlighterType(highlighterType string) *HighlighterField
func (*HighlighterField) MatchedFields ¶
func (f *HighlighterField) MatchedFields(matchedFields ...string) *HighlighterField
func (*HighlighterField) NoMatchSize ¶
func (f *HighlighterField) NoMatchSize(noMatchSize int) *HighlighterField
func (*HighlighterField) NumOfFragments ¶
func (f *HighlighterField) NumOfFragments(numOfFragments int) *HighlighterField
func (*HighlighterField) Options ¶
func (f *HighlighterField) Options(options map[string]interface{}) *HighlighterField
func (*HighlighterField) Order ¶
func (f *HighlighterField) Order(order string) *HighlighterField
func (*HighlighterField) PhraseLimit ¶
func (f *HighlighterField) PhraseLimit(phraseLimit int) *HighlighterField
func (*HighlighterField) PostTags ¶
func (f *HighlighterField) PostTags(postTags ...string) *HighlighterField
func (*HighlighterField) PreTags ¶
func (f *HighlighterField) PreTags(preTags ...string) *HighlighterField
func (*HighlighterField) RequireFieldMatch ¶
func (f *HighlighterField) RequireFieldMatch(requireFieldMatch bool) *HighlighterField
func (*HighlighterField) Source ¶
func (f *HighlighterField) Source() (interface{}, error)
type HistogramAggregation ¶
type HistogramAggregation struct {
// contains filtered or unexported fields
}
HistogramAggregation is a multi-bucket values source based aggregation that can be applied on numeric values extracted from the documents. It dynamically builds fixed size (a.k.a. interval) buckets over the values. See: http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/search-aggregations-bucket-histogram-aggregation.html
func NewHistogramAggregation ¶
func NewHistogramAggregation() *HistogramAggregation
func (*HistogramAggregation) ExtendedBounds ¶
func (a *HistogramAggregation) ExtendedBounds(min, max int64) *HistogramAggregation
func (*HistogramAggregation) ExtendedBoundsMax ¶
func (a *HistogramAggregation) ExtendedBoundsMax(max int64) *HistogramAggregation
func (*HistogramAggregation) ExtendedBoundsMin ¶
func (a *HistogramAggregation) ExtendedBoundsMin(min int64) *HistogramAggregation
func (*HistogramAggregation) Field ¶
func (a *HistogramAggregation) Field(field string) *HistogramAggregation
func (*HistogramAggregation) Interval ¶
func (a *HistogramAggregation) Interval(interval int64) *HistogramAggregation
func (*HistogramAggregation) Meta ¶
func (a *HistogramAggregation) Meta(metaData map[string]interface{}) *HistogramAggregation
Meta sets the meta data to be included in the aggregation response.
func (*HistogramAggregation) MinDocCount ¶
func (a *HistogramAggregation) MinDocCount(minDocCount int64) *HistogramAggregation
func (*HistogramAggregation) Offset ¶
func (a *HistogramAggregation) Offset(offset int64) *HistogramAggregation
func (*HistogramAggregation) Order ¶
func (a *HistogramAggregation) Order(order string, asc bool) *HistogramAggregation
Order specifies the sort order. Valid values for order are: "_key", "_count", a sub-aggregation name, or a sub-aggregation name with a metric.
func (*HistogramAggregation) OrderByAggregation ¶
func (a *HistogramAggregation) OrderByAggregation(aggName string, asc bool) *HistogramAggregation
OrderByAggregation creates a bucket ordering strategy which sorts buckets based on a single-valued calc get.
func (*HistogramAggregation) OrderByAggregationAndMetric ¶
func (a *HistogramAggregation) OrderByAggregationAndMetric(aggName, metric string, asc bool) *HistogramAggregation
OrderByAggregationAndMetric creates a bucket ordering strategy which sorts buckets based on a multi-valued calc get.
func (*HistogramAggregation) OrderByCount ¶
func (a *HistogramAggregation) OrderByCount(asc bool) *HistogramAggregation
func (*HistogramAggregation) OrderByCountAsc ¶
func (a *HistogramAggregation) OrderByCountAsc() *HistogramAggregation
func (*HistogramAggregation) OrderByCountDesc ¶
func (a *HistogramAggregation) OrderByCountDesc() *HistogramAggregation
func (*HistogramAggregation) OrderByKey ¶
func (a *HistogramAggregation) OrderByKey(asc bool) *HistogramAggregation
func (*HistogramAggregation) OrderByKeyAsc ¶
func (a *HistogramAggregation) OrderByKeyAsc() *HistogramAggregation
func (*HistogramAggregation) OrderByKeyDesc ¶
func (a *HistogramAggregation) OrderByKeyDesc() *HistogramAggregation
func (*HistogramAggregation) Script ¶
func (a *HistogramAggregation) Script(script *Script) *HistogramAggregation
func (*HistogramAggregation) Source ¶
func (a *HistogramAggregation) Source() (interface{}, error)
func (*HistogramAggregation) SubAggregation ¶
func (a *HistogramAggregation) SubAggregation(name string, subAggregation Aggregation) *HistogramAggregation
type HoltLinearMovAvgModel ¶
type HoltLinearMovAvgModel struct {
// contains filtered or unexported fields
}
HoltLinearMovAvgModel calculates a doubly exponential weighted moving average.
For more details, see https://www.elastic.co/guide/en/elasticsearch/reference/current/search-aggregations-pipeline-movavg-aggregation.html#_holt_linear
func NewHoltLinearMovAvgModel ¶
func NewHoltLinearMovAvgModel() *HoltLinearMovAvgModel
NewHoltLinearMovAvgModel creates and initializes a new HoltLinearMovAvgModel.
func (*HoltLinearMovAvgModel) Alpha ¶
func (m *HoltLinearMovAvgModel) Alpha(alpha float64) *HoltLinearMovAvgModel
Alpha controls the smoothing of the data. Alpha = 1 retains no memory of past values (e.g. a random walk), while alpha = 0 retains infinite memory of past values (e.g. the series mean). Useful values are somewhere in between. Defaults to 0.5.
func (*HoltLinearMovAvgModel) Beta ¶
func (m *HoltLinearMovAvgModel) Beta(beta float64) *HoltLinearMovAvgModel
Beta is equivalent to Alpha but controls the smoothing of the trend instead of the data.
func (*HoltLinearMovAvgModel) Name ¶
func (m *HoltLinearMovAvgModel) Name() string
Name of the model.
func (*HoltLinearMovAvgModel) Settings ¶
func (m *HoltLinearMovAvgModel) Settings() map[string]interface{}
Settings of the model.
type HoltWintersMovAvgModel ¶
type HoltWintersMovAvgModel struct {
// contains filtered or unexported fields
}
HoltWintersMovAvgModel calculates a triple exponential weighted moving average.
For more details, see https://www.elastic.co/guide/en/elasticsearch/reference/current/search-aggregations-pipeline-movavg-aggregation.html#_holt_winters
func NewHoltWintersMovAvgModel ¶
func NewHoltWintersMovAvgModel() *HoltWintersMovAvgModel
NewHoltWintersMovAvgModel creates and initializes a new HoltWintersMovAvgModel.
func (*HoltWintersMovAvgModel) Alpha ¶
func (m *HoltWintersMovAvgModel) Alpha(alpha float64) *HoltWintersMovAvgModel
Alpha controls the smoothing of the data. Alpha = 1 retains no memory of past values (e.g. a random walk), while alpha = 0 retains infinite memory of past values (e.g. the series mean). Useful values are somewhere in between. Defaults to 0.5.
func (*HoltWintersMovAvgModel) Beta ¶
func (m *HoltWintersMovAvgModel) Beta(beta float64) *HoltWintersMovAvgModel
Beta is equivalent to Alpha but controls the smoothing of the trend instead of the data.
func (*HoltWintersMovAvgModel) Gamma ¶
func (m *HoltWintersMovAvgModel) Gamma(gamma float64) *HoltWintersMovAvgModel
func (*HoltWintersMovAvgModel) Name ¶
func (m *HoltWintersMovAvgModel) Name() string
Name of the model.
func (*HoltWintersMovAvgModel) Pad ¶
func (m *HoltWintersMovAvgModel) Pad(pad bool) *HoltWintersMovAvgModel
func (*HoltWintersMovAvgModel) Period ¶
func (m *HoltWintersMovAvgModel) Period(period int) *HoltWintersMovAvgModel
func (*HoltWintersMovAvgModel) SeasonalityType ¶
func (m *HoltWintersMovAvgModel) SeasonalityType(typ string) *HoltWintersMovAvgModel
func (*HoltWintersMovAvgModel) Settings ¶
func (m *HoltWintersMovAvgModel) Settings() map[string]interface{}
Settings of the model.
type IdsQuery ¶
type IdsQuery struct {
// contains filtered or unexported fields
}
IdsQuery filters documents that only have the provided ids. Note, this query uses the _uid field.
For more details, see https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-ids-query.html
func NewIdsQuery ¶
NewIdsQuery creates and initializes a new ids query.
type IndexDeleteByQueryResult ¶
type IndexDeleteByQueryResult struct {
Shards shardsInfo `json:"_shards"`
}
IndexDeleteByQueryResult is the result of a delete-by-query for a specific index.
type IndexResponse ¶
type IndexResponse struct { // TODO _shards { total, failed, successful } Index string `json:"_index"` Type string `json:"_type"` Id string `json:"_id"` Version int `json:"_version"` Created bool `json:"created"` }
IndexResponse is the result of indexing a document in Elasticsearch.
type IndexService ¶
type IndexService struct {
// contains filtered or unexported fields
}
IndexService adds or updates a typed JSON document in a specified index, making it searchable.
See https://www.elastic.co/guide/en/elasticsearch/reference/current/docs-index_.html for details.
func NewIndexService ¶
func NewIndexService(client *Client) *IndexService
NewIndexService creates a new IndexService.
func (*IndexService) BodyJson ¶
func (s *IndexService) BodyJson(body interface{}) *IndexService
BodyJson is the document as a serializable JSON interface.
func (*IndexService) BodyString ¶
func (s *IndexService) BodyString(body string) *IndexService
BodyString is the document encoded as a string.
func (*IndexService) Consistency ¶
func (s *IndexService) Consistency(consistency string) *IndexService
Consistency is an explicit write consistency setting for the operation.
func (*IndexService) Do ¶
func (s *IndexService) Do() (*IndexResponse, error)
Do executes the operation.
func (*IndexService) Index ¶
func (s *IndexService) Index(index string) *IndexService
Index is the name of the index.
func (*IndexService) OpType ¶
func (s *IndexService) OpType(opType string) *IndexService
OpType is an explicit operation type, i.e. "create" or "index" (default).
func (*IndexService) Parent ¶
func (s *IndexService) Parent(parent string) *IndexService
Parent is the ID of the parent document.
func (*IndexService) Pretty ¶
func (s *IndexService) Pretty(pretty bool) *IndexService
Pretty indicates that the JSON response be indented and human readable.
func (*IndexService) Refresh ¶
func (s *IndexService) Refresh(refresh bool) *IndexService
Refresh the index after performing the operation.
func (*IndexService) Replication ¶
func (s *IndexService) Replication(replication string) *IndexService
Replication is a specific replication type.
func (*IndexService) Routing ¶
func (s *IndexService) Routing(routing string) *IndexService
Routing is a specific routing value.
func (*IndexService) TTL ¶
func (s *IndexService) TTL(ttl string) *IndexService
TTL is an expiration time for the document (alias for Ttl).
func (*IndexService) Timeout ¶
func (s *IndexService) Timeout(timeout string) *IndexService
Timeout is an explicit operation timeout.
func (*IndexService) Timestamp ¶
func (s *IndexService) Timestamp(timestamp string) *IndexService
Timestamp is an explicit timestamp for the document.
func (*IndexService) Ttl ¶
func (s *IndexService) Ttl(ttl string) *IndexService
Ttl is an expiration time for the document.
func (*IndexService) Type ¶
func (s *IndexService) Type(typ string) *IndexService
Type is the type of the document.
func (*IndexService) Validate ¶
func (s *IndexService) Validate() error
Validate checks if the operation is valid.
func (*IndexService) Version ¶
func (s *IndexService) Version(version interface{}) *IndexService
Version is an explicit version number for concurrency control.
func (*IndexService) VersionType ¶
func (s *IndexService) VersionType(versionType string) *IndexService
VersionType is a specific version type.
type IndexStats ¶
type IndexStats struct { Primaries *IndexStatsDetails `json:"primaries,omitempty"` Total *IndexStatsDetails `json:"total,omitempty"` }
IndexStats is index stats for a specific index.
type IndexStatsCompletion ¶
type IndexStatsDetails ¶
type IndexStatsDetails struct { Docs *IndexStatsDocs `json:"docs,omitempty"` Store *IndexStatsStore `json:"store,omitempty"` Indexing *IndexStatsIndexing `json:"indexing,omitempty"` Get *IndexStatsGet `json:"get,omitempty"` Search *IndexStatsSearch `json:"search,omitempty"` Merges *IndexStatsMerges `json:"merges,omitempty"` Refresh *IndexStatsRefresh `json:"refresh,omitempty"` Flush *IndexStatsFlush `json:"flush,omitempty"` Warmer *IndexStatsWarmer `json:"warmer,omitempty"` FilterCache *IndexStatsFilterCache `json:"filter_cache,omitempty"` IdCache *IndexStatsIdCache `json:"id_cache,omitempty"` Fielddata *IndexStatsFielddata `json:"fielddata,omitempty"` Percolate *IndexStatsPercolate `json:"percolate,omitempty"` Completion *IndexStatsCompletion `json:"completion,omitempty"` Segments *IndexStatsSegments `json:"segments,omitempty"` Translog *IndexStatsTranslog `json:"translog,omitempty"` Suggest *IndexStatsSuggest `json:"suggest,omitempty"` QueryCache *IndexStatsQueryCache `json:"query_cache,omitempty"` }
type IndexStatsDocs ¶
type IndexStatsFielddata ¶
type IndexStatsFilterCache ¶
type IndexStatsFlush ¶
type IndexStatsGet ¶
type IndexStatsGet struct { Total int64 `json:"total,omitempty"` GetTime string `json:"get_time,omitempty"` TimeInMillis int64 `json:"time_in_millis,omitempty"` ExistsTotal int64 `json:"exists_total,omitempty"` ExistsTime string `json:"exists_time,omitempty"` ExistsTimeInMillis int64 `json:"exists_time_in_millis,omitempty"` MissingTotal int64 `json:"missing_total,omitempty"` MissingTime string `json:"missing_time,omitempty"` MissingTimeInMillis int64 `json:"missing_time_in_millis,omitempty"` Current int64 `json:"current,omitempty"` }
type IndexStatsIdCache ¶
type IndexStatsIndexing ¶
type IndexStatsIndexing struct { IndexTotal int64 `json:"index_total,omitempty"` IndexTime string `json:"index_time,omitempty"` IndexTimeInMillis int64 `json:"index_time_in_millis,omitempty"` IndexCurrent int64 `json:"index_current,omitempty"` DeleteTotal int64 `json:"delete_total,omitempty"` DeleteTime string `json:"delete_time,omitempty"` DeleteTimeInMillis int64 `json:"delete_time_in_millis,omitempty"` DeleteCurrent int64 `json:"delete_current,omitempty"` NoopUpdateTotal int64 `json:"noop_update_total,omitempty"` IsThrottled bool `json:"is_throttled,omitempty"` ThrottleTime string `json:"throttle_time,omitempty"` ThrottleTimeInMillis int64 `json:"throttle_time_in_millis,omitempty"` }
type IndexStatsMerges ¶
type IndexStatsMerges struct { Current int64 `json:"current,omitempty"` CurrentDocs int64 `json:"current_docs,omitempty"` CurrentSize string `json:"current_size,omitempty"` CurrentSizeInBytes int64 `json:"current_size_in_bytes,omitempty"` Total int64 `json:"total,omitempty"` TotalTime string `json:"total_time,omitempty"` TotalTimeInMillis int64 `json:"total_time_in_millis,omitempty"` TotalDocs int64 `json:"total_docs,omitempty"` TotalSize string `json:"total_size,omitempty"` TotalSizeInBytes int64 `json:"total_size_in_bytes,omitempty"` }
type IndexStatsPercolate ¶
type IndexStatsPercolate struct { Total int64 `json:"total,omitempty"` GetTime string `json:"get_time,omitempty"` TimeInMillis int64 `json:"time_in_millis,omitempty"` Current int64 `json:"current,omitempty"` MemorySize string `json:"memory_size,omitempty"` MemorySizeInBytes int64 `json:"memory_size_in_bytes,omitempty"` Queries int64 `json:"queries,omitempty"` }
type IndexStatsQueryCache ¶
type IndexStatsRefresh ¶
type IndexStatsSearch ¶
type IndexStatsSearch struct { OpenContexts int64 `json:"open_contexts,omitempty"` QueryTotal int64 `json:"query_total,omitempty"` QueryTime string `json:"query_time,omitempty"` QueryTimeInMillis int64 `json:"query_time_in_millis,omitempty"` QueryCurrent int64 `json:"query_current,omitempty"` FetchTotal int64 `json:"fetch_total,omitempty"` FetchTime string `json:"fetch_time,omitempty"` FetchTimeInMillis int64 `json:"fetch_time_in_millis,omitempty"` FetchCurrent int64 `json:"fetch_current,omitempty"` }
type IndexStatsSegments ¶
type IndexStatsSegments struct { Count int64 `json:"count,omitempty"` Memory string `json:"memory,omitempty"` MemoryInBytes int64 `json:"memory_in_bytes,omitempty"` IndexWriterMemory string `json:"index_writer_memory,omitempty"` IndexWriterMemoryInBytes int64 `json:"index_writer_memory_in_bytes,omitempty"` IndexWriterMaxMemory string `json:"index_writer_max_memory,omitempty"` IndexWriterMaxMemoryInBytes int64 `json:"index_writer_max_memory_in_bytes,omitempty"` VersionMapMemory string `json:"version_map_memory,omitempty"` VersionMapMemoryInBytes int64 `json:"version_map_memory_in_bytes,omitempty"` FixedBitSetMemory string `json:"fixed_bit_set,omitempty"` FixedBitSetMemoryInBytes int64 `json:"fixed_bit_set_memory_in_bytes,omitempty"` }
type IndexStatsStore ¶
type IndexStatsSuggest ¶
type IndexStatsTranslog ¶
type IndexStatsWarmer ¶
type IndicesCloseResponse ¶
type IndicesCloseResponse struct {
Acknowledged bool `json:"acknowledged"`
}
IndicesCloseResponse is the response of IndicesCloseService.Do.
type IndicesCloseService ¶
type IndicesCloseService struct {
// contains filtered or unexported fields
}
IndicesCloseService closes an index.
See https://www.elastic.co/guide/en/elasticsearch/reference/current/indices-open-close.html for details.
func NewIndicesCloseService ¶
func NewIndicesCloseService(client *Client) *IndicesCloseService
NewIndicesCloseService creates and initializes a new IndicesCloseService.
func (*IndicesCloseService) AllowNoIndices ¶
func (s *IndicesCloseService) AllowNoIndices(allowNoIndices bool) *IndicesCloseService
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 (*IndicesCloseService) Do ¶
func (s *IndicesCloseService) Do() (*IndicesCloseResponse, error)
Do executes the operation.
func (*IndicesCloseService) ExpandWildcards ¶
func (s *IndicesCloseService) ExpandWildcards(expandWildcards string) *IndicesCloseService
ExpandWildcards indicates whether to expand wildcard expression to concrete indices that are open, closed or both.
func (*IndicesCloseService) IgnoreUnavailable ¶
func (s *IndicesCloseService) IgnoreUnavailable(ignoreUnavailable bool) *IndicesCloseService
IgnoreUnavailable indicates whether specified concrete indices should be ignored when unavailable (missing or closed).
func (*IndicesCloseService) Index ¶
func (s *IndicesCloseService) Index(index string) *IndicesCloseService
Index is the name of the index to close.
func (*IndicesCloseService) MasterTimeout ¶
func (s *IndicesCloseService) MasterTimeout(masterTimeout string) *IndicesCloseService
MasterTimeout specifies the timeout for connection to master.
func (*IndicesCloseService) Pretty ¶
func (s *IndicesCloseService) Pretty(pretty bool) *IndicesCloseService
Pretty indicates that the JSON response be indented and human readable.
func (*IndicesCloseService) Timeout ¶
func (s *IndicesCloseService) Timeout(timeout string) *IndicesCloseService
Timeout is an explicit operation timeout.
func (*IndicesCloseService) Validate ¶
func (s *IndicesCloseService) Validate() error
Validate checks if the operation is valid.
type IndicesCreateResult ¶
type IndicesCreateResult struct {
Acknowledged bool `json:"acknowledged"`
}
IndicesCreateResult is the outcome of creating a new index.
type IndicesCreateService ¶
type IndicesCreateService struct {
// contains filtered or unexported fields
}
IndicesCreateService creates a new index.
See https://www.elastic.co/guide/en/elasticsearch/reference/current/indices-create-index.html for details.
func NewIndicesCreateService ¶
func NewIndicesCreateService(client *Client) *IndicesCreateService
NewIndicesCreateService returns a new IndicesCreateService.
func (*IndicesCreateService) Body ¶
func (b *IndicesCreateService) Body(body string) *IndicesCreateService
Body specifies the configuration of the index as a string. It is an alias for BodyString.
func (*IndicesCreateService) BodyJson ¶
func (b *IndicesCreateService) BodyJson(body interface{}) *IndicesCreateService
BodyJson specifies the configuration of the index. The interface{} will be serializes as a JSON document, so use a map[string]interface{}.
func (*IndicesCreateService) BodyString ¶
func (b *IndicesCreateService) BodyString(body string) *IndicesCreateService
BodyString specifies the configuration of the index as a string.
func (*IndicesCreateService) Do ¶
func (b *IndicesCreateService) Do() (*IndicesCreateResult, error)
Do executes the operation.
func (*IndicesCreateService) Index ¶
func (b *IndicesCreateService) Index(index string) *IndicesCreateService
Index is the name of the index to create.
func (*IndicesCreateService) MasterTimeout ¶
func (s *IndicesCreateService) MasterTimeout(masterTimeout string) *IndicesCreateService
MasterTimeout specifies the timeout for connection to master.
func (*IndicesCreateService) Pretty ¶
func (b *IndicesCreateService) Pretty(pretty bool) *IndicesCreateService
Pretty indicates that the JSON response be indented and human readable.
func (*IndicesCreateService) Timeout ¶
func (s *IndicesCreateService) Timeout(timeout string) *IndicesCreateService
Timeout the explicit operation timeout, e.g. "5s".
type IndicesDeleteResponse ¶
type IndicesDeleteResponse struct {
Acknowledged bool `json:"acknowledged"`
}
IndicesDeleteResponse is the response of IndicesDeleteService.Do.
type IndicesDeleteService ¶
type IndicesDeleteService struct {
// contains filtered or unexported fields
}
IndicesDeleteService allows to delete existing indices.
See https://www.elastic.co/guide/en/elasticsearch/reference/current/indices-delete-index.html for details.
func NewIndicesDeleteService ¶
func NewIndicesDeleteService(client *Client) *IndicesDeleteService
NewIndicesDeleteService creates and initializes a new IndicesDeleteService.
func (*IndicesDeleteService) Do ¶
func (s *IndicesDeleteService) Do() (*IndicesDeleteResponse, error)
Do executes the operation.
func (*IndicesDeleteService) Index ¶
func (s *IndicesDeleteService) Index(index []string) *IndicesDeleteService
Index adds the list of indices to delete. Use `_all` or `*` string to delete all indices.
func (*IndicesDeleteService) MasterTimeout ¶
func (s *IndicesDeleteService) MasterTimeout(masterTimeout string) *IndicesDeleteService
MasterTimeout specifies the timeout for connection to master.
func (*IndicesDeleteService) Pretty ¶
func (s *IndicesDeleteService) Pretty(pretty bool) *IndicesDeleteService
Pretty indicates that the JSON response be indented and human readable.
func (*IndicesDeleteService) Timeout ¶
func (s *IndicesDeleteService) Timeout(timeout string) *IndicesDeleteService
Timeout is an explicit operation timeout.
func (*IndicesDeleteService) Validate ¶
func (s *IndicesDeleteService) Validate() error
Validate checks if the operation is valid.
type IndicesDeleteTemplateResponse ¶
type IndicesDeleteTemplateResponse struct {
Acknowledged bool `json:"acknowledged,omitempty"`
}
IndicesDeleteTemplateResponse is the response of IndicesDeleteTemplateService.Do.
type IndicesDeleteTemplateService ¶
type IndicesDeleteTemplateService struct {
// contains filtered or unexported fields
}
IndicesDeleteTemplateService deletes index templates. See http://www.elasticsearch.org/guide/en/elasticsearch/reference/1.4/indices-templates.html.
func NewIndicesDeleteTemplateService ¶
func NewIndicesDeleteTemplateService(client *Client) *IndicesDeleteTemplateService
NewIndicesDeleteTemplateService creates a new IndicesDeleteTemplateService.
func (*IndicesDeleteTemplateService) Do ¶
func (s *IndicesDeleteTemplateService) Do() (*IndicesDeleteTemplateResponse, error)
Do executes the operation.
func (*IndicesDeleteTemplateService) MasterTimeout ¶
func (s *IndicesDeleteTemplateService) MasterTimeout(masterTimeout string) *IndicesDeleteTemplateService
MasterTimeout specifies the timeout for connection to master.
func (*IndicesDeleteTemplateService) Name ¶
func (s *IndicesDeleteTemplateService) Name(name string) *IndicesDeleteTemplateService
Name is the name of the template.
func (*IndicesDeleteTemplateService) Pretty ¶
func (s *IndicesDeleteTemplateService) Pretty(pretty bool) *IndicesDeleteTemplateService
Pretty indicates that the JSON response be indented and human readable.
func (*IndicesDeleteTemplateService) Timeout ¶
func (s *IndicesDeleteTemplateService) Timeout(timeout string) *IndicesDeleteTemplateService
Timeout is an explicit operation timeout.
func (*IndicesDeleteTemplateService) Validate ¶
func (s *IndicesDeleteTemplateService) Validate() error
Validate checks if the operation is valid.
type IndicesExistsService ¶
type IndicesExistsService struct {
// contains filtered or unexported fields
}
IndicesExistsService checks if an index or indices exist or not.
See https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-exists.html for details.
func NewIndicesExistsService ¶
func NewIndicesExistsService(client *Client) *IndicesExistsService
NewIndicesExistsService creates and initializes a new IndicesExistsService.
func (*IndicesExistsService) AllowNoIndices ¶
func (s *IndicesExistsService) AllowNoIndices(allowNoIndices bool) *IndicesExistsService
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 (*IndicesExistsService) Do ¶
func (s *IndicesExistsService) Do() (bool, error)
Do executes the operation.
func (*IndicesExistsService) ExpandWildcards ¶
func (s *IndicesExistsService) ExpandWildcards(expandWildcards string) *IndicesExistsService
ExpandWildcards indicates whether to expand wildcard expression to concrete indices that are open, closed or both.
func (*IndicesExistsService) IgnoreUnavailable ¶
func (s *IndicesExistsService) IgnoreUnavailable(ignoreUnavailable bool) *IndicesExistsService
IgnoreUnavailable indicates whether specified concrete indices should be ignored when unavailable (missing or closed).
func (*IndicesExistsService) Index ¶
func (s *IndicesExistsService) Index(index []string) *IndicesExistsService
Index is a list of one or more indices to check.
func (*IndicesExistsService) Local ¶
func (s *IndicesExistsService) Local(local bool) *IndicesExistsService
Local, when set, returns local information and does not retrieve the state from master node (default: false).
func (*IndicesExistsService) Pretty ¶
func (s *IndicesExistsService) Pretty(pretty bool) *IndicesExistsService
Pretty indicates that the JSON response be indented and human readable.
func (*IndicesExistsService) Validate ¶
func (s *IndicesExistsService) Validate() error
Validate checks if the operation is valid.
type IndicesExistsTemplateService ¶
type IndicesExistsTemplateService struct {
// contains filtered or unexported fields
}
IndicesExistsTemplateService checks if a given template exists. See http://www.elastic.co/guide/en/elasticsearch/reference/current/indices-templates.html#indices-templates-exists for documentation.
func NewIndicesExistsTemplateService ¶
func NewIndicesExistsTemplateService(client *Client) *IndicesExistsTemplateService
NewIndicesExistsTemplateService creates a new IndicesExistsTemplateService.
func (*IndicesExistsTemplateService) Do ¶
func (s *IndicesExistsTemplateService) Do() (bool, error)
Do executes the operation.
func (*IndicesExistsTemplateService) Local ¶
func (s *IndicesExistsTemplateService) Local(local bool) *IndicesExistsTemplateService
Local indicates whether to return local information, i.e. do not retrieve the state from master node (default: false).
func (*IndicesExistsTemplateService) Name ¶
func (s *IndicesExistsTemplateService) Name(name string) *IndicesExistsTemplateService
Name is the name of the template.
func (*IndicesExistsTemplateService) Pretty ¶
func (s *IndicesExistsTemplateService) Pretty(pretty bool) *IndicesExistsTemplateService
Pretty indicates that the JSON response be indented and human readable.
func (*IndicesExistsTemplateService) Validate ¶
func (s *IndicesExistsTemplateService) Validate() error
Validate checks if the operation is valid.
type IndicesExistsTypeService ¶
type IndicesExistsTypeService struct {
// contains filtered or unexported fields
}
IndicesExistsTypeService checks if one or more types exist in one or more indices.
See https://www.elastic.co/guide/en/elasticsearch/reference/current/indices-types-exists.html for details.
func NewIndicesExistsTypeService ¶
func NewIndicesExistsTypeService(client *Client) *IndicesExistsTypeService
NewIndicesExistsTypeService creates a new IndicesExistsTypeService.
func (*IndicesExistsTypeService) AllowNoIndices ¶
func (s *IndicesExistsTypeService) AllowNoIndices(allowNoIndices bool) *IndicesExistsTypeService
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 (*IndicesExistsTypeService) Do ¶
func (s *IndicesExistsTypeService) Do() (bool, error)
Do executes the operation.
func (*IndicesExistsTypeService) ExpandWildcards ¶
func (s *IndicesExistsTypeService) ExpandWildcards(expandWildcards string) *IndicesExistsTypeService
ExpandWildcards indicates whether to expand wildcard expression to concrete indices that are open, closed or both.
func (*IndicesExistsTypeService) IgnoreUnavailable ¶
func (s *IndicesExistsTypeService) IgnoreUnavailable(ignoreUnavailable bool) *IndicesExistsTypeService
IgnoreUnavailable indicates whether specified concrete indices should be ignored when unavailable (missing or closed).
func (*IndicesExistsTypeService) Index ¶
func (s *IndicesExistsTypeService) Index(indices ...string) *IndicesExistsTypeService
Index is a list of index names; use `_all` to check the types across all indices.
func (*IndicesExistsTypeService) Local ¶
func (s *IndicesExistsTypeService) Local(local bool) *IndicesExistsTypeService
Local specifies whether to return local information, i.e. do not retrieve the state from master node (default: false).
func (*IndicesExistsTypeService) Pretty ¶
func (s *IndicesExistsTypeService) Pretty(pretty bool) *IndicesExistsTypeService
Pretty indicates that the JSON response be indented and human readable.
func (*IndicesExistsTypeService) Type ¶
func (s *IndicesExistsTypeService) Type(types ...string) *IndicesExistsTypeService
Type is a list of document types to check.
func (*IndicesExistsTypeService) Validate ¶
func (s *IndicesExistsTypeService) Validate() error
Validate checks if the operation is valid.
type IndicesFlushResponse ¶
type IndicesFlushResponse struct {
Shards shardsInfo `json:"_shards"`
}
type IndicesFlushService ¶
type IndicesFlushService struct {
// contains filtered or unexported fields
}
Flush allows to flush one or more indices. The flush process of an index basically frees memory from the index by flushing data to the index storage and clearing the internal transaction log.
See https://www.elastic.co/guide/en/elasticsearch/reference/current/indices-flush.html for details.
func NewIndicesFlushService ¶
func NewIndicesFlushService(client *Client) *IndicesFlushService
NewIndicesFlushService creates a new IndicesFlushService.
func (*IndicesFlushService) AllowNoIndices ¶
func (s *IndicesFlushService) AllowNoIndices(allowNoIndices bool) *IndicesFlushService
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 (*IndicesFlushService) Do ¶
func (s *IndicesFlushService) Do() (*IndicesFlushResponse, error)
Do executes the service.
func (*IndicesFlushService) ExpandWildcards ¶
func (s *IndicesFlushService) ExpandWildcards(expandWildcards string) *IndicesFlushService
ExpandWildcards specifies whether to expand wildcard expression to concrete indices that are open, closed or both..
func (*IndicesFlushService) Force ¶
func (s *IndicesFlushService) Force(force bool) *IndicesFlushService
Force indicates whether a flush should be forced even if it is not necessarily needed ie. if no changes will be committed to the index. This is useful if transaction log IDs should be incremented even if no uncommitted changes are present. (This setting can be considered as internal).
func (*IndicesFlushService) IgnoreUnavailable ¶
func (s *IndicesFlushService) IgnoreUnavailable(ignoreUnavailable bool) *IndicesFlushService
IgnoreUnavailable indicates whether specified concrete indices should be ignored when unavailable (missing or closed).
func (*IndicesFlushService) Index ¶
func (s *IndicesFlushService) Index(indices ...string) *IndicesFlushService
Index is a list of index names; use `_all` or empty string for all indices.
func (*IndicesFlushService) Pretty ¶
func (s *IndicesFlushService) Pretty(pretty bool) *IndicesFlushService
Pretty indicates that the JSON response be indented and human readable.
func (*IndicesFlushService) Validate ¶
func (s *IndicesFlushService) Validate() error
Validate checks if the operation is valid.
func (*IndicesFlushService) WaitIfOngoing ¶
func (s *IndicesFlushService) WaitIfOngoing(waitIfOngoing bool) *IndicesFlushService
WaitIfOngoing, if set to true, indicates that the flush operation will block until the flush can be executed if another flush operation is already executing. The default is false and will cause an exception to be thrown on the shard level if another flush operation is already running..
type IndicesForcemergeResponse ¶
type IndicesForcemergeResponse struct {
Shards shardsInfo `json:"_shards"`
}
IndicesForcemergeResponse is the response of IndicesForcemergeService.Do.
type IndicesForcemergeService ¶
type IndicesForcemergeService struct {
// contains filtered or unexported fields
}
IndicesForcemergeService allows to force merging of one or more indices. The merge relates to the number of segments a Lucene index holds within each shard. The force merge operation allows to reduce the number of segments by merging them.
See http://www.elastic.co/guide/en/elasticsearch/reference/2.1/indices-forcemerge.html for more information.
func NewIndicesForcemergeService ¶
func NewIndicesForcemergeService(client *Client) *IndicesForcemergeService
NewIndicesForcemergeService creates a new IndicesForcemergeService.
func (*IndicesForcemergeService) AllowNoIndices ¶
func (s *IndicesForcemergeService) AllowNoIndices(allowNoIndices bool) *IndicesForcemergeService
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 (*IndicesForcemergeService) Do ¶
func (s *IndicesForcemergeService) Do() (*IndicesForcemergeResponse, error)
Do executes the operation.
func (*IndicesForcemergeService) ExpandWildcards ¶
func (s *IndicesForcemergeService) ExpandWildcards(expandWildcards string) *IndicesForcemergeService
ExpandWildcards indicates whether to expand wildcard expression to concrete indices that are open, closed or both..
func (*IndicesForcemergeService) Flush ¶
func (s *IndicesForcemergeService) Flush(flush bool) *IndicesForcemergeService
Flush specifies whether the index should be flushed after performing the operation (default: true).
func (*IndicesForcemergeService) IgnoreUnavailable ¶
func (s *IndicesForcemergeService) IgnoreUnavailable(ignoreUnavailable bool) *IndicesForcemergeService
IgnoreUnavailable indicates whether specified concrete indices should be ignored when unavailable (missing or closed).
func (*IndicesForcemergeService) Index ¶
func (s *IndicesForcemergeService) Index(index ...string) *IndicesForcemergeService
Index is a list of index names; use `_all` or empty string to perform the operation on all indices.
func (*IndicesForcemergeService) MaxNumSegments ¶
func (s *IndicesForcemergeService) MaxNumSegments(maxNumSegments interface{}) *IndicesForcemergeService
MaxNumSegments specifies the number of segments the index should be merged into (default: dynamic).
func (*IndicesForcemergeService) OnlyExpungeDeletes ¶
func (s *IndicesForcemergeService) OnlyExpungeDeletes(onlyExpungeDeletes bool) *IndicesForcemergeService
OnlyExpungeDeletes specifies whether the operation should only expunge deleted documents.
func (*IndicesForcemergeService) OperationThreading ¶
func (s *IndicesForcemergeService) OperationThreading(operationThreading interface{}) *IndicesForcemergeService
func (*IndicesForcemergeService) Pretty ¶
func (s *IndicesForcemergeService) Pretty(pretty bool) *IndicesForcemergeService
Pretty indicates that the JSON response be indented and human readable.
func (*IndicesForcemergeService) Validate ¶
func (s *IndicesForcemergeService) Validate() error
Validate checks if the operation is valid.
func (*IndicesForcemergeService) WaitForMerge ¶
func (s *IndicesForcemergeService) WaitForMerge(waitForMerge bool) *IndicesForcemergeService
WaitForMerge specifies whether the request should block until the merge process is finished (default: true).
type IndicesGetResponse ¶
type IndicesGetResponse struct { Aliases map[string]interface{} `json:"aliases"` Mappings map[string]interface{} `json:"mappings"` Settings map[string]interface{} `json:"settings"` Warmers map[string]interface{} `json:"warmers"` }
IndicesGetResponse is part of the response of IndicesGetService.Do.
type IndicesGetService ¶
type IndicesGetService struct {
// contains filtered or unexported fields
}
IndicesGetService retrieves information about one or more indices.
See https://www.elastic.co/guide/en/elasticsearch/reference/current/indices-get-index.html for more details.
func NewIndicesGetService ¶
func NewIndicesGetService(client *Client) *IndicesGetService
NewIndicesGetService creates a new IndicesGetService.
func (*IndicesGetService) AllowNoIndices ¶
func (s *IndicesGetService) AllowNoIndices(allowNoIndices bool) *IndicesGetService
AllowNoIndices indicates whether to ignore if a wildcard expression resolves to no concrete indices (default: false).
func (*IndicesGetService) Do ¶
func (s *IndicesGetService) Do() (map[string]*IndicesGetResponse, error)
Do executes the operation.
func (*IndicesGetService) ExpandWildcards ¶
func (s *IndicesGetService) ExpandWildcards(expandWildcards string) *IndicesGetService
ExpandWildcards indicates whether wildcard expressions should get expanded to open or closed indices (default: open).
func (*IndicesGetService) Feature ¶
func (s *IndicesGetService) Feature(features ...string) *IndicesGetService
Feature is a list of features.
func (*IndicesGetService) Human ¶
func (s *IndicesGetService) Human(human bool) *IndicesGetService
Human indicates whether to return version and creation date values in human-readable format (default: false).
func (*IndicesGetService) IgnoreUnavailable ¶
func (s *IndicesGetService) IgnoreUnavailable(ignoreUnavailable bool) *IndicesGetService
IgnoreUnavailable indicates whether to ignore unavailable indexes (default: false).
func (*IndicesGetService) Index ¶
func (s *IndicesGetService) Index(indices ...string) *IndicesGetService
Index is a list of index names.
func (*IndicesGetService) Local ¶
func (s *IndicesGetService) Local(local bool) *IndicesGetService
Local indicates whether to return local information, i.e. do not retrieve the state from master node (default: false).
func (*IndicesGetService) Pretty ¶
func (s *IndicesGetService) Pretty(pretty bool) *IndicesGetService
Pretty indicates that the JSON response be indented and human readable.
func (*IndicesGetService) Validate ¶
func (s *IndicesGetService) Validate() error
Validate checks if the operation is valid.
type IndicesGetSettingsResponse ¶
type IndicesGetSettingsResponse struct {
Settings map[string]interface{} `json:"settings"`
}
IndicesGetSettingsResponse is the response of IndicesGetSettingsService.Do.
type IndicesGetSettingsService ¶
type IndicesGetSettingsService struct {
// contains filtered or unexported fields
}
IndicesGetSettingsService allows to retrieve settings of one or more indices.
See https://www.elastic.co/guide/en/elasticsearch/reference/current/indices-get-settings.html for more details.
func NewIndicesGetSettingsService ¶
func NewIndicesGetSettingsService(client *Client) *IndicesGetSettingsService
NewIndicesGetSettingsService creates a new IndicesGetSettingsService.
func (*IndicesGetSettingsService) AllowNoIndices ¶
func (s *IndicesGetSettingsService) AllowNoIndices(allowNoIndices bool) *IndicesGetSettingsService
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 (*IndicesGetSettingsService) Do ¶
func (s *IndicesGetSettingsService) Do() (map[string]*IndicesGetSettingsResponse, error)
Do executes the operation.
func (*IndicesGetSettingsService) ExpandWildcards ¶
func (s *IndicesGetSettingsService) ExpandWildcards(expandWildcards string) *IndicesGetSettingsService
ExpandWildcards indicates whether to expand wildcard expression to concrete indices that are open, closed or both. Options: open, closed, none, all. Default: open,closed.
func (*IndicesGetSettingsService) FlatSettings ¶
func (s *IndicesGetSettingsService) FlatSettings(flatSettings bool) *IndicesGetSettingsService
FlatSettings indicates whether to return settings in flat format (default: false).
func (*IndicesGetSettingsService) IgnoreUnavailable ¶
func (s *IndicesGetSettingsService) IgnoreUnavailable(ignoreUnavailable bool) *IndicesGetSettingsService
IgnoreUnavailable indicates whether specified concrete indices should be ignored when unavailable (missing or closed).
func (*IndicesGetSettingsService) Index ¶
func (s *IndicesGetSettingsService) Index(indices ...string) *IndicesGetSettingsService
Index is a list of index names; use `_all` or empty string to perform the operation on all indices.
func (*IndicesGetSettingsService) Local ¶
func (s *IndicesGetSettingsService) Local(local bool) *IndicesGetSettingsService
Local indicates whether to return local information, do not retrieve the state from master node (default: false).
func (*IndicesGetSettingsService) Name ¶
func (s *IndicesGetSettingsService) Name(name ...string) *IndicesGetSettingsService
Name are the names of the settings that should be included.
func (*IndicesGetSettingsService) Pretty ¶
func (s *IndicesGetSettingsService) Pretty(pretty bool) *IndicesGetSettingsService
Pretty indicates that the JSON response be indented and human readable.
func (*IndicesGetSettingsService) Validate ¶
func (s *IndicesGetSettingsService) Validate() error
Validate checks if the operation is valid.
type IndicesGetTemplateResponse ¶
type IndicesGetTemplateResponse struct { Order int `json:"order,omitempty"` Template string `json:"template,omitempty"` Settings map[string]interface{} `json:"settings,omitempty"` Mappings map[string]interface{} `json:"mappings,omitempty"` Aliases map[string]interface{} `json:"aliases,omitempty"` }
IndicesGetTemplateResponse is the response of IndicesGetTemplateService.Do.
type IndicesGetTemplateService ¶
type IndicesGetTemplateService struct {
// contains filtered or unexported fields
}
IndicesGetTemplateService returns an index template. See http://www.elasticsearch.org/guide/en/elasticsearch/reference/1.4/indices-templates.html.
func NewIndicesGetTemplateService ¶
func NewIndicesGetTemplateService(client *Client) *IndicesGetTemplateService
NewIndicesGetTemplateService creates a new IndicesGetTemplateService.
func (*IndicesGetTemplateService) Do ¶
func (s *IndicesGetTemplateService) Do() (map[string]*IndicesGetTemplateResponse, error)
Do executes the operation.
func (*IndicesGetTemplateService) FlatSettings ¶
func (s *IndicesGetTemplateService) FlatSettings(flatSettings bool) *IndicesGetTemplateService
FlatSettings is returns settings in flat format (default: false).
func (*IndicesGetTemplateService) Local ¶
func (s *IndicesGetTemplateService) Local(local bool) *IndicesGetTemplateService
Local indicates whether to return local information, i.e. do not retrieve the state from master node (default: false).
func (*IndicesGetTemplateService) Name ¶
func (s *IndicesGetTemplateService) Name(name ...string) *IndicesGetTemplateService
Name is the name of the index template.
func (*IndicesGetTemplateService) Pretty ¶
func (s *IndicesGetTemplateService) Pretty(pretty bool) *IndicesGetTemplateService
Pretty indicates that the JSON response be indented and human readable.
func (*IndicesGetTemplateService) Validate ¶
func (s *IndicesGetTemplateService) Validate() error
Validate checks if the operation is valid.
type IndicesOpenResponse ¶
type IndicesOpenResponse struct {
Acknowledged bool `json:"acknowledged"`
}
IndicesOpenResponse is the response of IndicesOpenService.Do.
type IndicesOpenService ¶
type IndicesOpenService struct {
// contains filtered or unexported fields
}
IndicesOpenService opens an index.
See https://www.elastic.co/guide/en/elasticsearch/reference/current/indices-open-close.html for details.
func NewIndicesOpenService ¶
func NewIndicesOpenService(client *Client) *IndicesOpenService
NewIndicesOpenService creates and initializes a new IndicesOpenService.
func (*IndicesOpenService) AllowNoIndices ¶
func (s *IndicesOpenService) AllowNoIndices(allowNoIndices bool) *IndicesOpenService
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 (*IndicesOpenService) Do ¶
func (s *IndicesOpenService) Do() (*IndicesOpenResponse, error)
Do executes the operation.
func (*IndicesOpenService) ExpandWildcards ¶
func (s *IndicesOpenService) ExpandWildcards(expandWildcards string) *IndicesOpenService
ExpandWildcards indicates whether to expand wildcard expression to concrete indices that are open, closed or both..
func (*IndicesOpenService) IgnoreUnavailable ¶
func (s *IndicesOpenService) IgnoreUnavailable(ignoreUnavailable bool) *IndicesOpenService
IgnoreUnavailable indicates whether specified concrete indices should be ignored when unavailable (missing or closed).
func (*IndicesOpenService) Index ¶
func (s *IndicesOpenService) Index(index string) *IndicesOpenService
Index is the name of the index to open.
func (*IndicesOpenService) MasterTimeout ¶
func (s *IndicesOpenService) MasterTimeout(masterTimeout string) *IndicesOpenService
MasterTimeout specifies the timeout for connection to master.
func (*IndicesOpenService) Pretty ¶
func (s *IndicesOpenService) Pretty(pretty bool) *IndicesOpenService
Pretty indicates that the JSON response be indented and human readable.
func (*IndicesOpenService) Timeout ¶
func (s *IndicesOpenService) Timeout(timeout string) *IndicesOpenService
Timeout is an explicit operation timeout.
func (*IndicesOpenService) Validate ¶
func (s *IndicesOpenService) Validate() error
Validate checks if the operation is valid.
type IndicesPutTemplateResponse ¶
type IndicesPutTemplateResponse struct {
Acknowledged bool `json:"acknowledged,omitempty"`
}
IndicesPutTemplateResponse is the response of IndicesPutTemplateService.Do.
type IndicesPutTemplateService ¶
type IndicesPutTemplateService struct {
// contains filtered or unexported fields
}
IndicesPutTemplateService creates or updates index mappings. See http://www.elasticsearch.org/guide/en/elasticsearch/reference/1.4/indices-templates.html.
func NewIndicesPutTemplateService ¶
func NewIndicesPutTemplateService(client *Client) *IndicesPutTemplateService
NewIndicesPutTemplateService creates a new IndicesPutTemplateService.
func (*IndicesPutTemplateService) BodyJson ¶
func (s *IndicesPutTemplateService) BodyJson(body interface{}) *IndicesPutTemplateService
BodyJson is documented as: The template definition.
func (*IndicesPutTemplateService) BodyString ¶
func (s *IndicesPutTemplateService) BodyString(body string) *IndicesPutTemplateService
BodyString is documented as: The template definition.
func (*IndicesPutTemplateService) Create ¶
func (s *IndicesPutTemplateService) Create(create bool) *IndicesPutTemplateService
Create indicates whether the index template should only be added if new or can also replace an existing one.
func (*IndicesPutTemplateService) Do ¶
func (s *IndicesPutTemplateService) Do() (*IndicesPutTemplateResponse, error)
Do executes the operation.
func (*IndicesPutTemplateService) FlatSettings ¶
func (s *IndicesPutTemplateService) FlatSettings(flatSettings bool) *IndicesPutTemplateService
FlatSettings indicates whether to return settings in flat format (default: false).
func (*IndicesPutTemplateService) MasterTimeout ¶
func (s *IndicesPutTemplateService) MasterTimeout(masterTimeout string) *IndicesPutTemplateService
MasterTimeout specifies the timeout for connection to master.
func (*IndicesPutTemplateService) Name ¶
func (s *IndicesPutTemplateService) Name(name string) *IndicesPutTemplateService
Name is the name of the index template.
func (*IndicesPutTemplateService) Order ¶
func (s *IndicesPutTemplateService) Order(order interface{}) *IndicesPutTemplateService
Order is the order for this template when merging multiple matching ones (higher numbers are merged later, overriding the lower numbers).
func (*IndicesPutTemplateService) Pretty ¶
func (s *IndicesPutTemplateService) Pretty(pretty bool) *IndicesPutTemplateService
Pretty indicates that the JSON response be indented and human readable.
func (*IndicesPutTemplateService) Timeout ¶
func (s *IndicesPutTemplateService) Timeout(timeout string) *IndicesPutTemplateService
Timeout is an explicit operation timeout.
func (*IndicesPutTemplateService) Validate ¶
func (s *IndicesPutTemplateService) Validate() error
Validate checks if the operation is valid.
type IndicesQuery ¶
type IndicesQuery struct {
// contains filtered or unexported fields
}
IndicesQuery can be used when executed across multiple indices, allowing to have a query that executes only when executed on an index that matches a specific list of indices, and another query that executes when it is executed on an index that does not match the listed indices.
For more details, see https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-indices-query.html
func NewIndicesQuery ¶
func NewIndicesQuery(query Query, indices ...string) *IndicesQuery
NewIndicesQuery creates and initializes a new indices query.
func (*IndicesQuery) NoMatchQuery ¶
func (q *IndicesQuery) NoMatchQuery(query Query) *IndicesQuery
NoMatchQuery sets the query to use when it executes on an index that does not match the indices provided.
func (*IndicesQuery) NoMatchQueryType ¶
func (q *IndicesQuery) NoMatchQueryType(typ string) *IndicesQuery
NoMatchQueryType sets the no match query which can be either all or none.
func (*IndicesQuery) QueryName ¶
func (q *IndicesQuery) QueryName(queryName string) *IndicesQuery
QueryName sets the query name for the filter.
func (*IndicesQuery) Source ¶
func (q *IndicesQuery) Source() (interface{}, error)
Source returns JSON for the function score query.
type IndicesStatsResponse ¶
type IndicesStatsResponse struct { // Shards provides information returned from shards. Shards shardsInfo `json:"_shards"` // All provides summary stats about all indices. All *IndexStats `json:"_all,omitempty"` // Indices provides a map into the stats of an index. The key of the // map is the index name. Indices map[string]*IndexStats `json:"indices,omitempty"` }
IndicesStatsResponse is the response of IndicesStatsService.Do.
type IndicesStatsService ¶
type IndicesStatsService struct {
// contains filtered or unexported fields
}
IndicesStatsService provides stats on various metrics of one or more indices. See http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/indices-stats.html.
func NewIndicesStatsService ¶
func NewIndicesStatsService(client *Client) *IndicesStatsService
NewIndicesStatsService creates a new IndicesStatsService.
func (*IndicesStatsService) CompletionFields ¶
func (s *IndicesStatsService) CompletionFields(completionFields ...string) *IndicesStatsService
CompletionFields is a list of fields for `fielddata` and `suggest` index metric (supports wildcards).
func (*IndicesStatsService) Do ¶
func (s *IndicesStatsService) Do() (*IndicesStatsResponse, error)
Do executes the operation.
func (*IndicesStatsService) FielddataFields ¶
func (s *IndicesStatsService) FielddataFields(fielddataFields ...string) *IndicesStatsService
FielddataFields is a list of fields for `fielddata` index metric (supports wildcards).
func (*IndicesStatsService) Fields ¶
func (s *IndicesStatsService) Fields(fields ...string) *IndicesStatsService
Fields is a list of fields for `fielddata` and `completion` index metric (supports wildcards).
func (*IndicesStatsService) Groups ¶
func (s *IndicesStatsService) Groups(groups ...string) *IndicesStatsService
Groups is a list of search groups for `search` index metric.
func (*IndicesStatsService) Human ¶
func (s *IndicesStatsService) Human(human bool) *IndicesStatsService
Human indicates whether to return time and byte values in human-readable format..
func (*IndicesStatsService) Index ¶
func (s *IndicesStatsService) Index(indices ...string) *IndicesStatsService
Index is the list of index names; use `_all` or empty string to perform the operation on all indices.
func (*IndicesStatsService) Level ¶
func (s *IndicesStatsService) Level(level string) *IndicesStatsService
Level returns stats aggregated at cluster, index or shard level.
func (*IndicesStatsService) Metric ¶
func (s *IndicesStatsService) Metric(metric ...string) *IndicesStatsService
Metric limits the information returned the specific metrics. Options are: docs, store, indexing, get, search, completion, fielddata, flush, merge, query_cache, refresh, suggest, and warmer.
func (*IndicesStatsService) Pretty ¶
func (s *IndicesStatsService) Pretty(pretty bool) *IndicesStatsService
Pretty indicates that the JSON response be indented and human readable.
func (*IndicesStatsService) Type ¶
func (s *IndicesStatsService) Type(types ...string) *IndicesStatsService
Type is a list of document types for the `indexing` index metric.
func (*IndicesStatsService) Validate ¶
func (s *IndicesStatsService) Validate() error
Validate checks if the operation is valid.
type InnerHit ¶
type InnerHit struct {
// contains filtered or unexported fields
}
InnerHit implements a simple join for parent/child, nested, and even top-level documents in Elasticsearch. It is an experimental feature for Elasticsearch versions 1.5 (or greater). See http://www.elastic.co/guide/en/elasticsearch/reference/1.5/search-request-inner-hits.html for documentation.
See the tests for SearchSource, HasChildFilter, HasChildQuery, HasParentFilter, HasParentQuery, NestedFilter, and NestedQuery for usage examples.
func (*InnerHit) FetchSource ¶
func (*InnerHit) FetchSourceContext ¶
func (hit *InnerHit) FetchSourceContext(fetchSourceContext *FetchSourceContext) *InnerHit
func (*InnerHit) FieldDataField ¶
func (*InnerHit) FieldDataFields ¶
func (*InnerHit) Highlighter ¶
func (*InnerHit) ScriptField ¶
func (hit *InnerHit) ScriptField(scriptField *ScriptField) *InnerHit
func (*InnerHit) ScriptFields ¶
func (hit *InnerHit) ScriptFields(scriptFields ...*ScriptField) *InnerHit
func (*InnerHit) SortWithInfo ¶
func (*InnerHit) TrackScores ¶
type LaplaceSmoothingModel ¶
type LaplaceSmoothingModel struct {
// contains filtered or unexported fields
}
LaplaceSmoothingModel implements a laplace smoothing model. See http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/search-suggesters-phrase.html#_smoothing_models for details about smoothing models.
func NewLaplaceSmoothingModel ¶
func NewLaplaceSmoothingModel(alpha float64) *LaplaceSmoothingModel
func (*LaplaceSmoothingModel) Source ¶
func (sm *LaplaceSmoothingModel) Source() (interface{}, error)
func (*LaplaceSmoothingModel) Type ¶
func (sm *LaplaceSmoothingModel) Type() string
type LinearDecayFunction ¶
type LinearDecayFunction struct {
// contains filtered or unexported fields
}
LinearDecayFunction builds a linear decay score function. See https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-function-score-query.html for details.
func NewLinearDecayFunction ¶
func NewLinearDecayFunction() *LinearDecayFunction
NewLinearDecayFunction initializes and returns a new LinearDecayFunction.
func (*LinearDecayFunction) Decay ¶
func (fn *LinearDecayFunction) Decay(decay float64) *LinearDecayFunction
Decay defines how documents are scored at the distance given a Scale. If no decay is defined, documents at the distance Scale will be scored 0.5.
func (*LinearDecayFunction) FieldName ¶
func (fn *LinearDecayFunction) FieldName(fieldName string) *LinearDecayFunction
FieldName specifies the name of the field to which this decay function is applied to.
func (*LinearDecayFunction) GetMultiValueMode ¶
func (fn *LinearDecayFunction) GetMultiValueMode() string
GetMultiValueMode returns how the decay function should be calculated on a field that has multiple values. Valid modes are: min, max, avg, and sum.
func (*LinearDecayFunction) GetWeight ¶
func (fn *LinearDecayFunction) GetWeight() *float64
GetWeight returns the adjusted score. It is part of the ScoreFunction interface. Returns nil if weight is not specified.
func (*LinearDecayFunction) MultiValueMode ¶
func (fn *LinearDecayFunction) MultiValueMode(mode string) *LinearDecayFunction
MultiValueMode specifies how the decay function should be calculated on a field that has multiple values. Valid modes are: min, max, avg, and sum.
func (*LinearDecayFunction) Name ¶
func (fn *LinearDecayFunction) Name() string
Name represents the JSON field name under which the output of Source needs to be serialized by FunctionScoreQuery (see FunctionScoreQuery.Source).
func (*LinearDecayFunction) Offset ¶
func (fn *LinearDecayFunction) Offset(offset interface{}) *LinearDecayFunction
Offset, if defined, computes the decay function only for a distance greater than the defined offset.
func (*LinearDecayFunction) Origin ¶
func (fn *LinearDecayFunction) Origin(origin interface{}) *LinearDecayFunction
Origin defines the "central point" by which the decay function calculates "distance".
func (*LinearDecayFunction) Scale ¶
func (fn *LinearDecayFunction) Scale(scale interface{}) *LinearDecayFunction
Scale defines the scale to be used with Decay.
func (*LinearDecayFunction) Source ¶
func (fn *LinearDecayFunction) Source() (interface{}, error)
Source returns the serializable JSON data of this score function.
func (*LinearDecayFunction) Weight ¶
func (fn *LinearDecayFunction) Weight(weight float64) *LinearDecayFunction
Weight adjusts the score of the score function. See https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-function-score-query.html#_using_function_score for details.
type LinearInterpolationSmoothingModel ¶
type LinearInterpolationSmoothingModel struct {
// contains filtered or unexported fields
}
LinearInterpolationSmoothingModel implements a linear interpolation smoothing model. See http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/search-suggesters-phrase.html#_smoothing_models for details about smoothing models.
func NewLinearInterpolationSmoothingModel ¶
func NewLinearInterpolationSmoothingModel(trigramLamda, bigramLambda, unigramLambda float64) *LinearInterpolationSmoothingModel
func (*LinearInterpolationSmoothingModel) Source ¶
func (sm *LinearInterpolationSmoothingModel) Source() (interface{}, error)
func (*LinearInterpolationSmoothingModel) Type ¶
func (sm *LinearInterpolationSmoothingModel) Type() string
type LinearMovAvgModel ¶
type LinearMovAvgModel struct { }
LinearMovAvgModel calculates a linearly weighted moving average, such that older values are linearly less important. "Time" is determined by position in collection.
For more details, see https://www.elastic.co/guide/en/elasticsearch/reference/current/search-aggregations-pipeline-movavg-aggregation.html#_linear
func NewLinearMovAvgModel ¶
func NewLinearMovAvgModel() *LinearMovAvgModel
NewLinearMovAvgModel creates and initializes a new LinearMovAvgModel.
func (*LinearMovAvgModel) Settings ¶
func (m *LinearMovAvgModel) Settings() map[string]interface{}
Settings of the model.
type MatchAllQuery ¶
type MatchAllQuery struct {
// contains filtered or unexported fields
}
MatchAllQuery is the most simple query, which matches all documents, giving them all a _score of 1.0.
For more details, see https://www.elastic.co/guide/en/elasticsearch/reference/master/query-dsl-match-all-query.html
func NewMatchAllQuery ¶
func NewMatchAllQuery() *MatchAllQuery
NewMatchAllQuery creates and initializes a new match all query.
func (*MatchAllQuery) Boost ¶
func (q *MatchAllQuery) Boost(boost float64) *MatchAllQuery
Boost sets the boost for this query. Documents matching this query will (in addition to the normal weightings) have their score multiplied by the boost provided.
func (MatchAllQuery) Source ¶
func (q MatchAllQuery) Source() (interface{}, error)
Source returns JSON for the function score query.
type MatchQuery ¶
type MatchQuery struct {
// contains filtered or unexported fields
}
MatchQuery is a family of queries that accepts text/numerics/dates, analyzes them, and constructs a query.
To create a new MatchQuery, use NewMatchQuery. To create specific types of queries, e.g. a match_phrase query, use NewMatchPhrQuery(...).Type("phrase"), or use one of the shortcuts e.g. NewMatchPhraseQuery(...).
For more details, see https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-match-query.html
func NewMatchPhrasePrefixQuery ¶
func NewMatchPhrasePrefixQuery(name string, text interface{}) *MatchQuery
NewMatchPhrasePrefixQuery creates and initializes a new MatchQuery of type phrase_prefix.
func NewMatchPhraseQuery ¶
func NewMatchPhraseQuery(name string, text interface{}) *MatchQuery
NewMatchPhraseQuery creates and initializes a new MatchQuery of type phrase.
func NewMatchQuery ¶
func NewMatchQuery(name string, text interface{}) *MatchQuery
NewMatchQuery creates and initializes a new MatchQuery.
func (*MatchQuery) Analyzer ¶
func (q *MatchQuery) Analyzer(analyzer string) *MatchQuery
Analyzer explicitly sets the analyzer to use. It defaults to use explicit mapping config for the field, or, if not set, the default search analyzer.
func (*MatchQuery) Boost ¶
func (q *MatchQuery) Boost(boost float64) *MatchQuery
Boost sets the boost to apply to this query.
func (*MatchQuery) CutoffFrequency ¶
func (q *MatchQuery) CutoffFrequency(cutoff float64) *MatchQuery
CutoffFrequency can be a value in [0..1] (or an absolute number >=1). It represents the maximum treshold of a terms document frequency to be considered a low frequency term.
func (*MatchQuery) Fuzziness ¶
func (q *MatchQuery) Fuzziness(fuzziness string) *MatchQuery
Fuzziness sets the fuzziness when evaluated to a fuzzy query type. Defaults to "AUTO".
func (*MatchQuery) FuzzyRewrite ¶
func (q *MatchQuery) FuzzyRewrite(fuzzyRewrite string) *MatchQuery
func (*MatchQuery) FuzzyTranspositions ¶
func (q *MatchQuery) FuzzyTranspositions(fuzzyTranspositions bool) *MatchQuery
func (*MatchQuery) Lenient ¶
func (q *MatchQuery) Lenient(lenient bool) *MatchQuery
Lenient specifies whether format based failures will be ignored.
func (*MatchQuery) MaxExpansions ¶
func (q *MatchQuery) MaxExpansions(maxExpansions int) *MatchQuery
MaxExpansions is used with fuzzy or prefix type queries. It specifies the number of term expansions to use. It defaults to unbounded so that its recommended to set it to a reasonable value for faster execution.
func (*MatchQuery) MinimumShouldMatch ¶
func (q *MatchQuery) MinimumShouldMatch(minimumShouldMatch string) *MatchQuery
func (*MatchQuery) Operator ¶
func (q *MatchQuery) Operator(operator string) *MatchQuery
Operator sets the operator to use when using a boolean query. Can be "AND" or "OR" (default).
func (*MatchQuery) PrefixLength ¶
func (q *MatchQuery) PrefixLength(prefixLength int) *MatchQuery
func (*MatchQuery) QueryName ¶
func (q *MatchQuery) QueryName(queryName string) *MatchQuery
QueryName sets the query name for the filter that can be used when searching for matched filters per hit.
func (*MatchQuery) Rewrite ¶
func (q *MatchQuery) Rewrite(rewrite string) *MatchQuery
func (*MatchQuery) Slop ¶
func (q *MatchQuery) Slop(slop int) *MatchQuery
Slop sets the phrase slop if evaluated to a phrase query type.
func (*MatchQuery) Source ¶
func (q *MatchQuery) Source() (interface{}, error)
Source returns JSON for the function score query.
func (*MatchQuery) Type ¶
func (q *MatchQuery) Type(typ string) *MatchQuery
Type can be "boolean", "phrase", or "phrase_prefix". Defaults to "boolean".
func (*MatchQuery) ZeroTermsQuery ¶
func (q *MatchQuery) ZeroTermsQuery(zeroTermsQuery string) *MatchQuery
ZeroTermsQuery can be "all" or "none".
type MaxAggregation ¶
type MaxAggregation struct {
// contains filtered or unexported fields
}
MaxAggregation is a single-value metrics aggregation that keeps track and returns the maximum value among the numeric values extracted from the aggregated documents. These values can be extracted either from specific numeric fields in the documents, or be generated by a provided script. See: http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/search-aggregations-metrics-max-aggregation.html
func NewMaxAggregation ¶
func NewMaxAggregation() *MaxAggregation
func (*MaxAggregation) Field ¶
func (a *MaxAggregation) Field(field string) *MaxAggregation
func (*MaxAggregation) Format ¶
func (a *MaxAggregation) Format(format string) *MaxAggregation
func (*MaxAggregation) Meta ¶
func (a *MaxAggregation) Meta(metaData map[string]interface{}) *MaxAggregation
Meta sets the meta data to be included in the aggregation response.
func (*MaxAggregation) Script ¶
func (a *MaxAggregation) Script(script *Script) *MaxAggregation
func (*MaxAggregation) Source ¶
func (a *MaxAggregation) Source() (interface{}, error)
func (*MaxAggregation) SubAggregation ¶
func (a *MaxAggregation) SubAggregation(name string, subAggregation Aggregation) *MaxAggregation
type MaxBucketAggregation ¶
type MaxBucketAggregation struct {
// contains filtered or unexported fields
}
MaxBucketAggregation is a sibling pipeline aggregation which identifies the bucket(s) with the maximum value of a specified metric in a sibling aggregation and outputs both the value and the key(s) of the bucket(s). The specified metric must be numeric and the sibling aggregation must be a multi-bucket aggregation.
For more details, see https://www.elastic.co/guide/en/elasticsearch/reference/current/search-aggregations-pipeline-max-bucket-aggregation.html
func NewMaxBucketAggregation ¶
func NewMaxBucketAggregation() *MaxBucketAggregation
NewMaxBucketAggregation creates and initializes a new MaxBucketAggregation.
func (*MaxBucketAggregation) BucketsPath ¶
func (a *MaxBucketAggregation) BucketsPath(bucketsPaths ...string) *MaxBucketAggregation
BucketsPath sets the paths to the buckets to use for this pipeline aggregator.
func (*MaxBucketAggregation) Format ¶
func (a *MaxBucketAggregation) Format(format string) *MaxBucketAggregation
func (*MaxBucketAggregation) GapInsertZeros ¶
func (a *MaxBucketAggregation) GapInsertZeros() *MaxBucketAggregation
GapInsertZeros inserts zeros for gaps in the series.
func (*MaxBucketAggregation) GapPolicy ¶
func (a *MaxBucketAggregation) GapPolicy(gapPolicy string) *MaxBucketAggregation
GapPolicy defines what should be done when a gap in the series is discovered. Valid values include "insert_zeros" or "skip". Default is "insert_zeros".
func (*MaxBucketAggregation) GapSkip ¶
func (a *MaxBucketAggregation) GapSkip() *MaxBucketAggregation
GapSkip skips gaps in the series.
func (*MaxBucketAggregation) Meta ¶
func (a *MaxBucketAggregation) Meta(metaData map[string]interface{}) *MaxBucketAggregation
Meta sets the meta data to be included in the aggregation response.
func (*MaxBucketAggregation) Source ¶
func (a *MaxBucketAggregation) Source() (interface{}, error)
func (*MaxBucketAggregation) SubAggregation ¶
func (a *MaxBucketAggregation) SubAggregation(name string, subAggregation Aggregation) *MaxBucketAggregation
SubAggregation adds a sub-aggregation to this aggregation.
type MgetResponse ¶
type MgetResponse struct {
Docs []*GetResult `json:"docs,omitempty"`
}
type MgetService ¶
type MgetService struct {
// contains filtered or unexported fields
}
MgetService allows to get multiple documents based on an index, type (optional) and id (possibly routing). The response includes a docs array with all the fetched documents, each element similar in structure to a document provided by the Get API.
See https://www.elastic.co/guide/en/elasticsearch/reference/current/docs-multi-get.html for details.
func NewMgetService ¶
func NewMgetService(client *Client) *MgetService
func (*MgetService) Add ¶
func (b *MgetService) Add(items ...*MultiGetItem) *MgetService
func (*MgetService) Do ¶
func (b *MgetService) Do() (*MgetResponse, error)
func (*MgetService) Preference ¶
func (b *MgetService) Preference(preference string) *MgetService
func (*MgetService) Pretty ¶
func (s *MgetService) Pretty(pretty bool) *MgetService
Pretty indicates that the JSON response be indented and human readable.
func (*MgetService) Realtime ¶
func (b *MgetService) Realtime(realtime bool) *MgetService
func (*MgetService) Refresh ¶
func (b *MgetService) Refresh(refresh bool) *MgetService
func (*MgetService) Source ¶
func (b *MgetService) Source() (interface{}, error)
type MinAggregation ¶
type MinAggregation struct {
// contains filtered or unexported fields
}
MinAggregation is a single-value metrics aggregation that keeps track and returns the minimum value among numeric values extracted from the aggregated documents. These values can be extracted either from specific numeric fields in the documents, or be generated by a provided script. See: http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/search-aggregations-metrics-min-aggregation.html
func NewMinAggregation ¶
func NewMinAggregation() *MinAggregation
func (*MinAggregation) Field ¶
func (a *MinAggregation) Field(field string) *MinAggregation
func (*MinAggregation) Format ¶
func (a *MinAggregation) Format(format string) *MinAggregation
func (*MinAggregation) Meta ¶
func (a *MinAggregation) Meta(metaData map[string]interface{}) *MinAggregation
Meta sets the meta data to be included in the aggregation response.
func (*MinAggregation) Script ¶
func (a *MinAggregation) Script(script *Script) *MinAggregation
func (*MinAggregation) Source ¶
func (a *MinAggregation) Source() (interface{}, error)
func (*MinAggregation) SubAggregation ¶
func (a *MinAggregation) SubAggregation(name string, subAggregation Aggregation) *MinAggregation
type MinBucketAggregation ¶
type MinBucketAggregation struct {
// contains filtered or unexported fields
}
MinBucketAggregation is a sibling pipeline aggregation which identifies the bucket(s) with the maximum value of a specified metric in a sibling aggregation and outputs both the value and the key(s) of the bucket(s). The specified metric must be numeric and the sibling aggregation must be a multi-bucket aggregation.
For more details, see https://www.elastic.co/guide/en/elasticsearch/reference/current/search-aggregations-pipeline-min-bucket-aggregation.html
func NewMinBucketAggregation ¶
func NewMinBucketAggregation() *MinBucketAggregation
NewMinBucketAggregation creates and initializes a new MinBucketAggregation.
func (*MinBucketAggregation) BucketsPath ¶
func (a *MinBucketAggregation) BucketsPath(bucketsPaths ...string) *MinBucketAggregation
BucketsPath sets the paths to the buckets to use for this pipeline aggregator.
func (*MinBucketAggregation) Format ¶
func (a *MinBucketAggregation) Format(format string) *MinBucketAggregation
func (*MinBucketAggregation) GapInsertZeros ¶
func (a *MinBucketAggregation) GapInsertZeros() *MinBucketAggregation
GapInsertZeros inserts zeros for gaps in the series.
func (*MinBucketAggregation) GapPolicy ¶
func (a *MinBucketAggregation) GapPolicy(gapPolicy string) *MinBucketAggregation
GapPolicy defines what should be done when a gap in the series is discovered. Valid values include "insert_zeros" or "skip". Default is "insert_zeros".
func (*MinBucketAggregation) GapSkip ¶
func (a *MinBucketAggregation) GapSkip() *MinBucketAggregation
GapSkip skips gaps in the series.
func (*MinBucketAggregation) Meta ¶
func (a *MinBucketAggregation) Meta(metaData map[string]interface{}) *MinBucketAggregation
Meta sets the meta data to be included in the aggregation response.
func (*MinBucketAggregation) Source ¶
func (a *MinBucketAggregation) Source() (interface{}, error)
func (*MinBucketAggregation) SubAggregation ¶
func (a *MinBucketAggregation) SubAggregation(name string, subAggregation Aggregation) *MinBucketAggregation
SubAggregation adds a sub-aggregation to this aggregation.
type MissingAggregation ¶
type MissingAggregation struct {
// contains filtered or unexported fields
}
MissingAggregation is a field data based single bucket aggregation, that creates a bucket of all documents in the current document set context that are missing a field value (effectively, missing a field or having the configured NULL value set). This aggregator will often be used in conjunction with other field data bucket aggregators (such as ranges) to return information for all the documents that could not be placed in any of the other buckets due to missing field data values. See: http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/search-aggregations-bucket-missing-aggregation.html
func NewMissingAggregation ¶
func NewMissingAggregation() *MissingAggregation
func (*MissingAggregation) Field ¶
func (a *MissingAggregation) Field(field string) *MissingAggregation
func (*MissingAggregation) Meta ¶
func (a *MissingAggregation) Meta(metaData map[string]interface{}) *MissingAggregation
Meta sets the meta data to be included in the aggregation response.
func (*MissingAggregation) Source ¶
func (a *MissingAggregation) Source() (interface{}, error)
func (*MissingAggregation) SubAggregation ¶
func (a *MissingAggregation) SubAggregation(name string, subAggregation Aggregation) *MissingAggregation
type MissingQuery ¶
type MissingQuery struct {
// contains filtered or unexported fields
}
MissingQuery returns documents that have only null values or no value in the original field.
For details, see: https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-missing-query.html
func NewMissingQuery ¶
func NewMissingQuery(name string) *MissingQuery
NewMissingQuery creates and initializes a new MissingQuery.
func (*MissingQuery) Existence ¶
func (q *MissingQuery) Existence(existence bool) *MissingQuery
Existence indicates whether the missing filter includes documents where the field doesn't exist in the docs.
func (*MissingQuery) NullValue ¶
func (q *MissingQuery) NullValue(nullValue bool) *MissingQuery
NullValue indicates whether the missing filter automatically includes fields with null value configured in the mappings. Defaults to false.
func (*MissingQuery) QueryName ¶
func (q *MissingQuery) QueryName(queryName string) *MissingQuery
QueryName sets the query name for the query that can be used when searching for matched filters hit.
func (*MissingQuery) Source ¶
func (q *MissingQuery) Source() (interface{}, error)
Source returns JSON for the query.
type MoreLikeThisQuery ¶
type MoreLikeThisQuery struct {
// contains filtered or unexported fields
}
MoreLikeThis query (MLT Query) finds documents that are "like" a given set of documents. In order to do so, MLT selects a set of representative terms of these input documents, forms a query using these terms, executes the query and returns the results. The user controls the input documents, how the terms should be selected and how the query is formed.
For more details, see https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-mlt-query.html
func NewMoreLikeThisQuery ¶
func NewMoreLikeThisQuery() *MoreLikeThisQuery
NewMoreLikeThisQuery creates and initializes a new MoreLikeThisQuery.
func (*MoreLikeThisQuery) Analyzer ¶
func (q *MoreLikeThisQuery) Analyzer(analyzer string) *MoreLikeThisQuery
Analyzer specifies the analyzer that will be use to analyze the text. Defaults to the analyzer associated with the field.
func (*MoreLikeThisQuery) Boost ¶
func (q *MoreLikeThisQuery) Boost(boost float64) *MoreLikeThisQuery
Boost sets the boost for this query.
func (*MoreLikeThisQuery) BoostTerms ¶
func (q *MoreLikeThisQuery) BoostTerms(boostTerms float64) *MoreLikeThisQuery
BoostTerms sets the boost factor to use when boosting terms. It defaults to 1.
func (*MoreLikeThisQuery) FailOnUnsupportedField ¶
func (q *MoreLikeThisQuery) FailOnUnsupportedField(fail bool) *MoreLikeThisQuery
FailOnUnsupportedField indicates whether to fail or return no result when this query is run against a field which is not supported such as a binary/numeric field.
func (*MoreLikeThisQuery) Field ¶
func (q *MoreLikeThisQuery) Field(fields ...string) *MoreLikeThisQuery
Field adds one or more field names to the query.
func (*MoreLikeThisQuery) Ids ¶
func (q *MoreLikeThisQuery) Ids(ids ...string) *MoreLikeThisQuery
Ids sets the document ids to use in order to find documents that are "like" this.
func (*MoreLikeThisQuery) IgnoreLikeItems ¶
func (q *MoreLikeThisQuery) IgnoreLikeItems(ignoreDocs ...*MoreLikeThisQueryItem) *MoreLikeThisQuery
IgnoreLikeItems sets the documents from which the terms should not be selected from.
func (*MoreLikeThisQuery) IgnoreLikeText ¶
func (q *MoreLikeThisQuery) IgnoreLikeText(ignoreLikeText ...string) *MoreLikeThisQuery
IgnoreLikeText sets the text from which the terms should not be selected from.
func (*MoreLikeThisQuery) Include ¶
func (q *MoreLikeThisQuery) Include(include bool) *MoreLikeThisQuery
Include specifies whether the input documents should also be included in the results returned. Defaults to false.
func (*MoreLikeThisQuery) LikeItems ¶
func (q *MoreLikeThisQuery) LikeItems(docs ...*MoreLikeThisQueryItem) *MoreLikeThisQuery
LikeItems sets the documents to use in order to find documents that are "like" this.
func (*MoreLikeThisQuery) LikeText ¶
func (q *MoreLikeThisQuery) LikeText(likeTexts ...string) *MoreLikeThisQuery
LikeText sets the text to use in order to find documents that are "like" this.
func (*MoreLikeThisQuery) MaxDocFreq ¶
func (q *MoreLikeThisQuery) MaxDocFreq(maxDocFreq int) *MoreLikeThisQuery
MaxDocFreq sets the maximum frequency for which words may still appear. Words that appear in more than this many docs will be ignored. It defaults to unbounded.
func (*MoreLikeThisQuery) MaxQueryTerms ¶
func (q *MoreLikeThisQuery) MaxQueryTerms(maxQueryTerms int) *MoreLikeThisQuery
MaxQueryTerms sets the maximum number of query terms that will be included in any generated query. It defaults to 25.
func (*MoreLikeThisQuery) MaxWordLen ¶
func (q *MoreLikeThisQuery) MaxWordLen(maxWordLen int) *MoreLikeThisQuery
MaxWordLen sets the maximum word length above which words will be ignored. Defaults to unbounded (0).
func (*MoreLikeThisQuery) MinDocFreq ¶
func (q *MoreLikeThisQuery) MinDocFreq(minDocFreq int) *MoreLikeThisQuery
MinDocFreq sets the frequency at which words will be ignored which do not occur in at least this many docs. The default is 5.
func (*MoreLikeThisQuery) MinTermFreq ¶
func (q *MoreLikeThisQuery) MinTermFreq(minTermFreq int) *MoreLikeThisQuery
MinTermFreq is the frequency below which terms will be ignored in the source doc. The default frequency is 2.
func (*MoreLikeThisQuery) MinWordLen ¶
func (q *MoreLikeThisQuery) MinWordLen(minWordLen int) *MoreLikeThisQuery
MinWordLength sets the minimum word length below which words will be ignored. It defaults to 0.
func (*MoreLikeThisQuery) MinimumShouldMatch ¶
func (q *MoreLikeThisQuery) MinimumShouldMatch(minimumShouldMatch string) *MoreLikeThisQuery
MinimumShouldMatch sets the number of terms that must match the generated query expressed in the common syntax for minimum should match. The default value is "30%".
This used to be "PercentTermsToMatch" in Elasticsearch versions before 2.0.
func (*MoreLikeThisQuery) QueryName ¶
func (q *MoreLikeThisQuery) QueryName(queryName string) *MoreLikeThisQuery
QueryName sets the query name for the filter that can be used when searching for matched_filters per hit.
func (*MoreLikeThisQuery) Source ¶
func (q *MoreLikeThisQuery) Source() (interface{}, error)
Source creates the source for the MLT query. It may return an error if the caller forgot to specify any documents to be "liked" in the MoreLikeThisQuery.
func (*MoreLikeThisQuery) StopWord ¶
func (q *MoreLikeThisQuery) StopWord(stopWords ...string) *MoreLikeThisQuery
StopWord sets the stopwords. Any word in this set is considered "uninteresting" and ignored. Even if your Analyzer allows stopwords, you might want to tell the MoreLikeThis code to ignore them, as for the purposes of document similarity it seems reasonable to assume that "a stop word is never interesting".
type MoreLikeThisQueryItem ¶
type MoreLikeThisQueryItem struct {
// contains filtered or unexported fields
}
MoreLikeThisQueryItem represents a single item of a MoreLikeThisQuery to be "liked" or "unliked".
func NewMoreLikeThisQueryItem ¶
func NewMoreLikeThisQueryItem() *MoreLikeThisQueryItem
NewMoreLikeThisQueryItem creates and initializes a MoreLikeThisQueryItem.
func (*MoreLikeThisQueryItem) Doc ¶
func (item *MoreLikeThisQueryItem) Doc(doc interface{}) *MoreLikeThisQueryItem
Doc represents a raw document template for the item.
func (*MoreLikeThisQueryItem) FetchSourceContext ¶
func (item *MoreLikeThisQueryItem) FetchSourceContext(fsc *FetchSourceContext) *MoreLikeThisQueryItem
FetchSourceContext represents the fetch source of the item which controls if and how _source should be returned.
func (*MoreLikeThisQueryItem) Fields ¶
func (item *MoreLikeThisQueryItem) Fields(fields ...string) *MoreLikeThisQueryItem
Fields represents the list of fields of the item.
func (*MoreLikeThisQueryItem) Id ¶
func (item *MoreLikeThisQueryItem) Id(id string) *MoreLikeThisQueryItem
Id represents the document id of the item.
func (*MoreLikeThisQueryItem) Index ¶
func (item *MoreLikeThisQueryItem) Index(index string) *MoreLikeThisQueryItem
Index represents the index of the item.
func (*MoreLikeThisQueryItem) LikeText ¶
func (item *MoreLikeThisQueryItem) LikeText(likeText string) *MoreLikeThisQueryItem
LikeText represents a text to be "liked".
func (*MoreLikeThisQueryItem) Routing ¶
func (item *MoreLikeThisQueryItem) Routing(routing string) *MoreLikeThisQueryItem
Routing sets the routing associated with the item.
func (*MoreLikeThisQueryItem) Source ¶
func (item *MoreLikeThisQueryItem) Source() (interface{}, error)
Source returns the JSON-serializable fragment of the entity.
func (*MoreLikeThisQueryItem) Type ¶
func (item *MoreLikeThisQueryItem) Type(typ string) *MoreLikeThisQueryItem
Type represents the document type of the item.
func (*MoreLikeThisQueryItem) Version ¶
func (item *MoreLikeThisQueryItem) Version(version int64) *MoreLikeThisQueryItem
Version specifies the version of the item.
func (*MoreLikeThisQueryItem) VersionType ¶
func (item *MoreLikeThisQueryItem) VersionType(versionType string) *MoreLikeThisQueryItem
VersionType represents the version type of the item.
type MovAvgAggregation ¶
type MovAvgAggregation struct {
// contains filtered or unexported fields
}
MovAvgAggregation operates on a series of data. It will slide a window across the data and emit the average value of that window.
For more details, see https://www.elastic.co/guide/en/elasticsearch/reference/current/search-aggregations-pipeline-movavg-aggregation.html
func NewMovAvgAggregation ¶
func NewMovAvgAggregation() *MovAvgAggregation
NewMovAvgAggregation creates and initializes a new MovAvgAggregation.
func (*MovAvgAggregation) BucketsPath ¶
func (a *MovAvgAggregation) BucketsPath(bucketsPaths ...string) *MovAvgAggregation
BucketsPath sets the paths to the buckets to use for this pipeline aggregator.
func (*MovAvgAggregation) Format ¶
func (a *MovAvgAggregation) Format(format string) *MovAvgAggregation
func (*MovAvgAggregation) GapInsertZeros ¶
func (a *MovAvgAggregation) GapInsertZeros() *MovAvgAggregation
GapInsertZeros inserts zeros for gaps in the series.
func (*MovAvgAggregation) GapPolicy ¶
func (a *MovAvgAggregation) GapPolicy(gapPolicy string) *MovAvgAggregation
GapPolicy defines what should be done when a gap in the series is discovered. Valid values include "insert_zeros" or "skip". Default is "insert_zeros".
func (*MovAvgAggregation) GapSkip ¶
func (a *MovAvgAggregation) GapSkip() *MovAvgAggregation
GapSkip skips gaps in the series.
func (*MovAvgAggregation) Meta ¶
func (a *MovAvgAggregation) Meta(metaData map[string]interface{}) *MovAvgAggregation
Meta sets the meta data to be included in the aggregation response.
func (*MovAvgAggregation) Minimize ¶
func (a *MovAvgAggregation) Minimize(minimize bool) *MovAvgAggregation
Minimize determines if the model should be fit to the data using a cost minimizing algorithm.
func (*MovAvgAggregation) Model ¶
func (a *MovAvgAggregation) Model(model MovAvgModel) *MovAvgAggregation
Model is used to define what type of moving average you want to use in the series.
func (*MovAvgAggregation) Predict ¶
func (a *MovAvgAggregation) Predict(numPredictions int) *MovAvgAggregation
Predict sets the number of predictions that should be returned. Each prediction will be spaced at the intervals in the histogram. E.g. a predict of 2 will return two new buckets at the end of the histogram with the predicted values.
func (*MovAvgAggregation) Source ¶
func (a *MovAvgAggregation) Source() (interface{}, error)
func (*MovAvgAggregation) SubAggregation ¶
func (a *MovAvgAggregation) SubAggregation(name string, subAggregation Aggregation) *MovAvgAggregation
SubAggregation adds a sub-aggregation to this aggregation.
func (*MovAvgAggregation) Window ¶
func (a *MovAvgAggregation) Window(window int) *MovAvgAggregation
Window sets the window size for the moving average. This window will "slide" across the series, and the values inside that window will be used to calculate the moving avg value.
type MovAvgModel ¶
MovAvgModel specifies the model to use with the MovAvgAggregation.
type MultiGetItem ¶
type MultiGetItem struct {
// contains filtered or unexported fields
}
MultiGetItem is a single document to retrieve via the MgetService.
func NewMultiGetItem ¶
func NewMultiGetItem() *MultiGetItem
func (*MultiGetItem) FetchSource ¶
func (item *MultiGetItem) FetchSource(fetchSourceContext *FetchSourceContext) *MultiGetItem
func (*MultiGetItem) Fields ¶
func (item *MultiGetItem) Fields(fields ...string) *MultiGetItem
func (*MultiGetItem) Id ¶
func (item *MultiGetItem) Id(id string) *MultiGetItem
func (*MultiGetItem) Index ¶
func (item *MultiGetItem) Index(index string) *MultiGetItem
func (*MultiGetItem) Routing ¶
func (item *MultiGetItem) Routing(routing string) *MultiGetItem
func (*MultiGetItem) Source ¶
func (item *MultiGetItem) Source() (interface{}, error)
Source returns the serialized JSON to be sent to Elasticsearch as part of a MultiGet search.
func (*MultiGetItem) Type ¶
func (item *MultiGetItem) Type(typ string) *MultiGetItem
func (*MultiGetItem) Version ¶
func (item *MultiGetItem) Version(version int64) *MultiGetItem
Version can be MatchAny (-3), MatchAnyPre120 (0), NotFound (-1), or NotSet (-2). These are specified in org.elasticsearch.common.lucene.uid.Versions. The default in Elasticsearch is MatchAny (-3).
func (*MultiGetItem) VersionType ¶
func (item *MultiGetItem) VersionType(versionType string) *MultiGetItem
VersionType can be "internal", "external", "external_gt", "external_gte", or "force". See org.elasticsearch.index.VersionType in Elasticsearch source. It is "internal" by default.
type MultiMatchQuery ¶
type MultiMatchQuery struct {
// contains filtered or unexported fields
}
MultiMatchQuery builds on the MatchQuery to allow multi-field queries.
For more details, see https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-multi-match-query.html
func NewMultiMatchQuery ¶
func NewMultiMatchQuery(text interface{}, fields ...string) *MultiMatchQuery
MultiMatchQuery creates and initializes a new MultiMatchQuery.
func (*MultiMatchQuery) Analyzer ¶
func (q *MultiMatchQuery) Analyzer(analyzer string) *MultiMatchQuery
Analyzer sets the analyzer to use explicitly. It defaults to use explicit mapping config for the field, or, if not set, the default search analyzer.
func (*MultiMatchQuery) Boost ¶
func (q *MultiMatchQuery) Boost(boost float64) *MultiMatchQuery
Boost sets the boost for this query.
func (*MultiMatchQuery) CutoffFrequency ¶
func (q *MultiMatchQuery) CutoffFrequency(cutoff float64) *MultiMatchQuery
CutoffFrequency sets a cutoff value in [0..1] (or absolute number >=1) representing the maximum threshold of a terms document frequency to be considered a low frequency term.
func (*MultiMatchQuery) Field ¶
func (q *MultiMatchQuery) Field(field string) *MultiMatchQuery
Field adds a field to run the multi match against.
func (*MultiMatchQuery) FieldWithBoost ¶
func (q *MultiMatchQuery) FieldWithBoost(field string, boost float64) *MultiMatchQuery
FieldWithBoost adds a field to run the multi match against with a specific boost.
func (*MultiMatchQuery) Fuzziness ¶
func (q *MultiMatchQuery) Fuzziness(fuzziness string) *MultiMatchQuery
Fuzziness sets the fuzziness used when evaluated to a fuzzy query type. It defaults to "AUTO".
func (*MultiMatchQuery) FuzzyRewrite ¶
func (q *MultiMatchQuery) FuzzyRewrite(fuzzyRewrite string) *MultiMatchQuery
func (*MultiMatchQuery) Lenient ¶
func (q *MultiMatchQuery) Lenient(lenient bool) *MultiMatchQuery
Lenient indicates whether format based failures will be ignored.
func (*MultiMatchQuery) MaxExpansions ¶
func (q *MultiMatchQuery) MaxExpansions(maxExpansions int) *MultiMatchQuery
MaxExpansions is the number of term expansions to use when using fuzzy or prefix type query. It defaults to unbounded so it's recommended to set it to a reasonable value for faster execution.
func (*MultiMatchQuery) MinimumShouldMatch ¶
func (q *MultiMatchQuery) MinimumShouldMatch(minimumShouldMatch string) *MultiMatchQuery
MinimumShouldMatch represents the minimum number of optional should clauses to match.
func (*MultiMatchQuery) Operator ¶
func (q *MultiMatchQuery) Operator(operator string) *MultiMatchQuery
Operator sets the operator to use when using boolean query. It can be either AND or OR (default).
func (*MultiMatchQuery) PrefixLength ¶
func (q *MultiMatchQuery) PrefixLength(prefixLength int) *MultiMatchQuery
PrefixLength for the fuzzy process.
func (*MultiMatchQuery) QueryName ¶
func (q *MultiMatchQuery) QueryName(queryName string) *MultiMatchQuery
QueryName sets the query name for the filter that can be used when searching for matched filters per hit.
func (*MultiMatchQuery) Rewrite ¶
func (q *MultiMatchQuery) Rewrite(rewrite string) *MultiMatchQuery
func (*MultiMatchQuery) Slop ¶
func (q *MultiMatchQuery) Slop(slop int) *MultiMatchQuery
Slop sets the phrase slop if evaluated to a phrase query type.
func (*MultiMatchQuery) Source ¶
func (q *MultiMatchQuery) Source() (interface{}, error)
Source returns JSON for the query.
func (*MultiMatchQuery) TieBreaker ¶
func (q *MultiMatchQuery) TieBreaker(tieBreaker float64) *MultiMatchQuery
TieBreaker for "best-match" disjunction queries (OR queries). The tie breaker capability allows documents that match more than one query clause (in this case on more than one field) to be scored better than documents that match only the best of the fields, without confusing this with the better case of two distinct matches in the multiple fields.
A tie-breaker value of 1.0 is interpreted as a signal to score queries as "most-match" queries where all matching query clauses are considered for scoring.
func (*MultiMatchQuery) Type ¶
func (q *MultiMatchQuery) Type(typ string) *MultiMatchQuery
Type can be "best_fields", "boolean", "most_fields", "cross_fields", "phrase", or "phrase_prefix".
func (*MultiMatchQuery) ZeroTermsQuery ¶
func (q *MultiMatchQuery) ZeroTermsQuery(zeroTermsQuery string) *MultiMatchQuery
ZeroTermsQuery can be "all" or "none".
type MultiSearchResult ¶
type MultiSearchResult struct {
Responses []*SearchResult `json:"responses,omitempty"`
}
type MultiSearchService ¶
type MultiSearchService struct {
// contains filtered or unexported fields
}
MultiSearch executes one or more searches in one roundtrip. See http://www.elasticsearch.org/guide/reference/api/multi-search/
func NewMultiSearchService ¶
func NewMultiSearchService(client *Client) *MultiSearchService
func (*MultiSearchService) Add ¶
func (s *MultiSearchService) Add(requests ...*SearchRequest) *MultiSearchService
func (*MultiSearchService) Do ¶
func (s *MultiSearchService) Do() (*MultiSearchResult, error)
func (*MultiSearchService) Index ¶
func (s *MultiSearchService) Index(indices ...string) *MultiSearchService
func (*MultiSearchService) Pretty ¶
func (s *MultiSearchService) Pretty(pretty bool) *MultiSearchService
type NestedAggregation ¶
type NestedAggregation struct {
// contains filtered or unexported fields
}
NestedAggregation is a special single bucket aggregation that enables aggregating nested documents. See: http://www.elasticsearch.org/guide/en/elasticsearch/reference/master/search-aggregations-bucket-nested-aggregation.html
func NewNestedAggregation ¶
func NewNestedAggregation() *NestedAggregation
func (*NestedAggregation) Meta ¶
func (a *NestedAggregation) Meta(metaData map[string]interface{}) *NestedAggregation
Meta sets the meta data to be included in the aggregation response.
func (*NestedAggregation) Path ¶
func (a *NestedAggregation) Path(path string) *NestedAggregation
func (*NestedAggregation) Source ¶
func (a *NestedAggregation) Source() (interface{}, error)
func (*NestedAggregation) SubAggregation ¶
func (a *NestedAggregation) SubAggregation(name string, subAggregation Aggregation) *NestedAggregation
type NestedQuery ¶
type NestedQuery struct {
// contains filtered or unexported fields
}
NestedQuery allows to query nested objects / docs. The query is executed against the nested objects / docs as if they were indexed as separate docs (they are, internally) and resulting in the root parent doc (or parent nested mapping).
For more details, see https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-nested-query.html
func NewNestedQuery ¶
func NewNestedQuery(path string, query Query) *NestedQuery
NewNestedQuery creates and initializes a new NestedQuery.
func (*NestedQuery) Boost ¶
func (q *NestedQuery) Boost(boost float64) *NestedQuery
Boost sets the boost for this query.
func (*NestedQuery) InnerHit ¶
func (q *NestedQuery) InnerHit(innerHit *InnerHit) *NestedQuery
InnerHit sets the inner hit definition in the scope of this nested query and reusing the defined path and query.
func (*NestedQuery) QueryName ¶
func (q *NestedQuery) QueryName(queryName string) *NestedQuery
QueryName sets the query name for the filter that can be used when searching for matched_filters per hit
func (*NestedQuery) ScoreMode ¶
func (q *NestedQuery) ScoreMode(scoreMode string) *NestedQuery
ScoreMode specifies the score mode.
func (*NestedQuery) Source ¶
func (q *NestedQuery) Source() (interface{}, error)
Source returns JSON for the query.
type NodesInfoNode ¶
type NodesInfoNode struct { // Name of the node, e.g. "Mister Fear" Name string `json:"name"` // TransportAddress, e.g. "127.0.0.1:9300" TransportAddress string `json:"transport_address"` // Host is the host name, e.g. "macbookair" Host string `json:"host"` // IP is the IP address, e.g. "192.168.1.2" IP string `json:"ip"` // Version is the Elasticsearch version running on the node, e.g. "1.4.3" Version string `json:"version"` // Build is the Elasticsearch build, e.g. "36a29a7" Build string `json:"build"` // HTTPAddress, e.g. "127.0.0.1:9200" HTTPAddress string `json:"http_address"` // HTTPSAddress, e.g. "127.0.0.1:9200" HTTPSAddress string `json:"https_address"` // Attributes of the node. Attributes map[string]interface{} `json:"attributes"` // Settings of the node, e.g. paths and pidfile. Settings map[string]interface{} `json:"settings"` // OS information, e.g. CPU and memory. OS *NodesInfoNodeOS `json:"os"` // Process information, e.g. max file descriptors. Process *NodesInfoNodeProcess `json:"process"` // JVM information, e.g. VM version. JVM *NodesInfoNodeProcess `json:"jvm"` // ThreadPool information. ThreadPool *NodesInfoNodeThreadPool `json:"thread_pool"` // Network information. Network *NodesInfoNodeNetwork `json:"network"` // Network information. Transport *NodesInfoNodeTransport `json:"transport"` // HTTP information. HTTP *NodesInfoNodeHTTP `json:"http"` // Plugins information. Plugins []*NodesInfoNodePlugin `json:"plugins"` }
type NodesInfoNodeHTTP ¶
type NodesInfoNodeHTTP struct { BoundAddress []string `json:"bound_address"` // e.g. ["127.0.0.1:9200", "[fe80::1]:9200", "[::1]:9200"] PublishAddress string `json:"publish_address"` // e.g. "127.0.0.1:9300" MaxContentLength string `json:"max_content_length"` // e.g. "100mb" MaxContentLengthInBytes int64 `json:"max_content_length_in_bytes"` }
type NodesInfoNodeJVM ¶
type NodesInfoNodeJVM struct { PID int `json:"pid"` // process id, e.g. 87079 Version string `json:"version"` // e.g. "1.8.0_25" VMName string `json:"vm_name"` // e.g. "Java HotSpot(TM) 64-Bit Server VM" VMVersion string `json:"vm_version"` // e.g. "25.25-b02" VMVendor string `json:"vm_vendor"` // e.g. "Oracle Corporation" StartTime time.Time `json:"start_time"` // e.g. "2015-01-03T15:18:30.982Z" StartTimeInMillis int64 `json:"start_time_in_millis"` // Mem information Mem struct { HeapInit string `json:"heap_init"` // e.g. 1gb HeapInitInBytes int `json:"heap_init_in_bytes"` HeapMax string `json:"heap_max"` // e.g. 4gb HeapMaxInBytes int `json:"heap_max_in_bytes"` NonHeapInit string `json:"non_heap_init"` // e.g. 2.4mb NonHeapInitInBytes int `json:"non_heap_init_in_bytes"` NonHeapMax string `json:"non_heap_max"` // e.g. 0b NonHeapMaxInBytes int `json:"non_heap_max_in_bytes"` DirectMax string `json:"direct_max"` // e.g. 4gb DirectMaxInBytes int `json:"direct_max_in_bytes"` } `json:"mem"` GCCollectors []string `json:"gc_collectors"` // e.g. ["ParNew"] MemoryPools []string `json:"memory_pools"` // e.g. ["Code Cache", "Metaspace"] }
type NodesInfoNodeNetwork ¶
type NodesInfoNodeNetwork struct { RefreshInterval string `json:"refresh_interval"` // e.g. 1s RefreshIntervalInMillis int `json:"refresh_interval_in_millis"` // e.g. 1000 PrimaryInterface struct { Address string `json:"address"` // e.g. 192.168.1.2 Name string `json:"name"` // e.g. en0 MACAddress string `json:"mac_address"` // e.g. 11:22:33:44:55:66 } `json:"primary_interface"` }
type NodesInfoNodeOS ¶
type NodesInfoNodeOS struct { RefreshInterval string `json:"refresh_interval"` // e.g. 1s RefreshIntervalInMillis int `json:"refresh_interval_in_millis"` // e.g. 1000 AvailableProcessors int `json:"available_processors"` // e.g. 4 // CPU information CPU struct { Vendor string `json:"vendor"` // e.g. Intel Model string `json:"model"` // e.g. iMac15,1 MHz int `json:"mhz"` // e.g. 3500 TotalCores int `json:"total_cores"` // e.g. 4 TotalSockets int `json:"total_sockets"` // e.g. 4 CoresPerSocket int `json:"cores_per_socket"` // e.g. 16 CacheSizeInBytes int `json:"cache_size_in_bytes"` // e.g. 256 } `json:"cpu"` // Mem information Mem struct { Total string `json:"total"` // e.g. 16gb TotalInBytes int `json:"total_in_bytes"` // e.g. 17179869184 } `json:"mem"` // Swap information Swap struct { Total string `json:"total"` // e.g. 1gb TotalInBytes int `json:"total_in_bytes"` // e.g. 1073741824 } `json:"swap"` }
type NodesInfoNodePlugin ¶
type NodesInfoNodeProcess ¶
type NodesInfoNodeProcess struct { RefreshInterval string `json:"refresh_interval"` // e.g. 1s RefreshIntervalInMillis int `json:"refresh_interval_in_millis"` // e.g. 1000 ID int `json:"id"` // process id, e.g. 87079 MaxFileDescriptors int `json:"max_file_descriptors"` // e.g. 32768 Mlockall bool `json:"mlockall"` // e.g. false }
type NodesInfoNodeThreadPool ¶
type NodesInfoNodeThreadPool struct { Percolate *NodesInfoNodeThreadPoolSection `json:"percolate"` Bench *NodesInfoNodeThreadPoolSection `json:"bench"` Listener *NodesInfoNodeThreadPoolSection `json:"listener"` Index *NodesInfoNodeThreadPoolSection `json:"index"` Refresh *NodesInfoNodeThreadPoolSection `json:"refresh"` Suggest *NodesInfoNodeThreadPoolSection `json:"suggest"` Generic *NodesInfoNodeThreadPoolSection `json:"generic"` Warmer *NodesInfoNodeThreadPoolSection `json:"warmer"` Search *NodesInfoNodeThreadPoolSection `json:"search"` Flush *NodesInfoNodeThreadPoolSection `json:"flush"` Optimize *NodesInfoNodeThreadPoolSection `json:"optimize"` Management *NodesInfoNodeThreadPoolSection `json:"management"` Get *NodesInfoNodeThreadPoolSection `json:"get"` Merge *NodesInfoNodeThreadPoolSection `json:"merge"` Bulk *NodesInfoNodeThreadPoolSection `json:"bulk"` Snapshot *NodesInfoNodeThreadPoolSection `json:"snapshot"` }
type NodesInfoNodeTransport ¶
type NodesInfoNodeTransport struct { BoundAddress []string `json:"bound_address"` PublishAddress string `json:"publish_address"` Profiles map[string]*NodesInfoNodeTransportProfile `json:"profiles"` }
type NodesInfoResponse ¶
type NodesInfoResponse struct { ClusterName string `json:"cluster_name"` Nodes map[string]*NodesInfoNode `json:"nodes"` }
NodesInfoResponse is the response of NodesInfoService.Do.
type NodesInfoService ¶
type NodesInfoService struct {
// contains filtered or unexported fields
}
NodesInfoService allows to retrieve one or more or all of the cluster nodes information. It is documented at http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/cluster-nodes-info.html.
func NewNodesInfoService ¶
func NewNodesInfoService(client *Client) *NodesInfoService
NewNodesInfoService creates a new NodesInfoService.
func (*NodesInfoService) Do ¶
func (s *NodesInfoService) Do() (*NodesInfoResponse, error)
Do executes the operation.
func (*NodesInfoService) FlatSettings ¶
func (s *NodesInfoService) FlatSettings(flatSettings bool) *NodesInfoService
FlatSettings returns settings in flat format (default: false).
func (*NodesInfoService) Human ¶
func (s *NodesInfoService) Human(human bool) *NodesInfoService
Human indicates whether to return time and byte values in human-readable format.
func (*NodesInfoService) Metric ¶
func (s *NodesInfoService) Metric(metric ...string) *NodesInfoService
Metric is a list of metrics you wish returned. Leave empty to return all. Valid metrics are: settings, os, process, jvm, thread_pool, network, transport, http, and plugins.
func (*NodesInfoService) NodeId ¶
func (s *NodesInfoService) NodeId(nodeId ...string) *NodesInfoService
NodeId is a list of node IDs or names to limit the returned information. Use "_local" to return information from the node you're connecting to, leave empty to get information from all nodes.
func (*NodesInfoService) Pretty ¶
func (s *NodesInfoService) Pretty(pretty bool) *NodesInfoService
Pretty indicates whether to indent the returned JSON.
func (*NodesInfoService) Validate ¶
func (s *NodesInfoService) Validate() error
Validate checks if the operation is valid.
type NotQuery ¶
type NotQuery struct {
// contains filtered or unexported fields
}
NotQuery filters out matched documents using a query.
For details, see https://www.elastic.co/guide/en/elasticsearch/reference/master/query-dsl-not-query.html
func NewNotQuery ¶
NewNotQuery creates and initializes a new NotQuery.
type OptimizeResult ¶
type OptimizeResult struct {
Shards shardsInfo `json:"_shards,omitempty"`
}
type OptimizeService ¶
type OptimizeService struct {
// contains filtered or unexported fields
}
func NewOptimizeService ¶
func NewOptimizeService(client *Client) *OptimizeService
func (*OptimizeService) Do ¶
func (s *OptimizeService) Do() (*OptimizeResult, error)
func (*OptimizeService) Flush ¶
func (s *OptimizeService) Flush(flush bool) *OptimizeService
func (*OptimizeService) Force ¶
func (s *OptimizeService) Force(force bool) *OptimizeService
func (*OptimizeService) Index ¶
func (s *OptimizeService) Index(indices ...string) *OptimizeService
func (*OptimizeService) MaxNumSegments ¶
func (s *OptimizeService) MaxNumSegments(maxNumSegments int) *OptimizeService
func (*OptimizeService) OnlyExpungeDeletes ¶
func (s *OptimizeService) OnlyExpungeDeletes(onlyExpungeDeletes bool) *OptimizeService
func (*OptimizeService) Pretty ¶
func (s *OptimizeService) Pretty(pretty bool) *OptimizeService
func (*OptimizeService) WaitForMerge ¶
func (s *OptimizeService) WaitForMerge(waitForMerge bool) *OptimizeService
type PercentileRanksAggregation ¶
type PercentileRanksAggregation struct {
// contains filtered or unexported fields
}
PercentileRanksAggregation See: http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/search-aggregations-metrics-percentile-rank-aggregation.html
func NewPercentileRanksAggregation ¶
func NewPercentileRanksAggregation() *PercentileRanksAggregation
func (*PercentileRanksAggregation) Compression ¶
func (a *PercentileRanksAggregation) Compression(compression float64) *PercentileRanksAggregation
func (*PercentileRanksAggregation) Estimator ¶
func (a *PercentileRanksAggregation) Estimator(estimator string) *PercentileRanksAggregation
func (*PercentileRanksAggregation) Field ¶
func (a *PercentileRanksAggregation) Field(field string) *PercentileRanksAggregation
func (*PercentileRanksAggregation) Format ¶
func (a *PercentileRanksAggregation) Format(format string) *PercentileRanksAggregation
func (*PercentileRanksAggregation) Meta ¶
func (a *PercentileRanksAggregation) Meta(metaData map[string]interface{}) *PercentileRanksAggregation
Meta sets the meta data to be included in the aggregation response.
func (*PercentileRanksAggregation) Script ¶
func (a *PercentileRanksAggregation) Script(script *Script) *PercentileRanksAggregation
func (*PercentileRanksAggregation) Source ¶
func (a *PercentileRanksAggregation) Source() (interface{}, error)
func (*PercentileRanksAggregation) SubAggregation ¶
func (a *PercentileRanksAggregation) SubAggregation(name string, subAggregation Aggregation) *PercentileRanksAggregation
func (*PercentileRanksAggregation) Values ¶
func (a *PercentileRanksAggregation) Values(values ...float64) *PercentileRanksAggregation
type PercentilesAggregation ¶
type PercentilesAggregation struct {
// contains filtered or unexported fields
}
PercentilesAggregation See: http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/search-aggregations-metrics-percentile-aggregation.html
func NewPercentilesAggregation ¶
func NewPercentilesAggregation() *PercentilesAggregation
func (*PercentilesAggregation) Compression ¶
func (a *PercentilesAggregation) Compression(compression float64) *PercentilesAggregation
func (*PercentilesAggregation) Estimator ¶
func (a *PercentilesAggregation) Estimator(estimator string) *PercentilesAggregation
func (*PercentilesAggregation) Field ¶
func (a *PercentilesAggregation) Field(field string) *PercentilesAggregation
func (*PercentilesAggregation) Format ¶
func (a *PercentilesAggregation) Format(format string) *PercentilesAggregation
func (*PercentilesAggregation) Meta ¶
func (a *PercentilesAggregation) Meta(metaData map[string]interface{}) *PercentilesAggregation
Meta sets the meta data to be included in the aggregation response.
func (*PercentilesAggregation) Percentiles ¶
func (a *PercentilesAggregation) Percentiles(percentiles ...float64) *PercentilesAggregation
func (*PercentilesAggregation) Script ¶
func (a *PercentilesAggregation) Script(script *Script) *PercentilesAggregation
func (*PercentilesAggregation) Source ¶
func (a *PercentilesAggregation) Source() (interface{}, error)
func (*PercentilesAggregation) SubAggregation ¶
func (a *PercentilesAggregation) SubAggregation(name string, subAggregation Aggregation) *PercentilesAggregation
type PercolateMatch ¶
type PercolateMatch struct { Index string `json:"_index,omitempty"` Id string `json:"_id"` Score float64 `json:"_score,omitempty"` }
PercolateMatch returns a single match in a PercolateResponse.
type PercolateResponse ¶
type PercolateResponse struct { TookInMillis int64 `json:"took"` // search time in milliseconds Total int64 `json:"total"` // total matches Matches []*PercolateMatch `json:"matches,omitempty"` Aggregations Aggregations `json:"aggregations,omitempty"` // results from aggregations }
PercolateResponse is the response of PercolateService.Do.
type PercolateService ¶
type PercolateService struct {
// contains filtered or unexported fields
}
PercolateService is documented at http://www.elasticsearch.org/guide/en/elasticsearch/reference/1.4/search-percolate.html.
func NewPercolateService ¶
func NewPercolateService(client *Client) *PercolateService
NewPercolateService creates a new PercolateService.
func (*PercolateService) AllowNoIndices ¶
func (s *PercolateService) AllowNoIndices(allowNoIndices bool) *PercolateService
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 (*PercolateService) BodyJson ¶
func (s *PercolateService) BodyJson(body interface{}) *PercolateService
BodyJson is the percolator request definition using the percolate DSL.
func (*PercolateService) BodyString ¶
func (s *PercolateService) BodyString(body string) *PercolateService
BodyString is the percolator request definition using the percolate DSL.
func (*PercolateService) Do ¶
func (s *PercolateService) Do() (*PercolateResponse, error)
Do executes the operation.
func (*PercolateService) Doc ¶
func (s *PercolateService) Doc(doc interface{}) *PercolateService
Doc wraps the given document into the "doc" key of the body.
func (*PercolateService) ExpandWildcards ¶
func (s *PercolateService) ExpandWildcards(expandWildcards string) *PercolateService
ExpandWildcards indicates whether to expand wildcard expressions to concrete indices that are open, closed or both.
func (*PercolateService) Id ¶
func (s *PercolateService) Id(id string) *PercolateService
Id is to substitute the document in the request body with a document that is known by the specified id. On top of the id, the index and type parameter will be used to retrieve the document from within the cluster.
func (*PercolateService) IgnoreUnavailable ¶
func (s *PercolateService) IgnoreUnavailable(ignoreUnavailable bool) *PercolateService
IgnoreUnavailable indicates whether specified concrete indices should be ignored when unavailable (missing or closed).
func (*PercolateService) Index ¶
func (s *PercolateService) Index(index string) *PercolateService
Index is the name of the index of the document being percolated.
func (*PercolateService) PercolateFormat ¶
func (s *PercolateService) PercolateFormat(percolateFormat string) *PercolateService
PercolateFormat indicates whether to return an array of matching query IDs instead of objects.
func (*PercolateService) PercolateIndex ¶
func (s *PercolateService) PercolateIndex(percolateIndex string) *PercolateService
PercolateIndex is the index to percolate the document into. Defaults to index.
func (*PercolateService) PercolatePreference ¶
func (s *PercolateService) PercolatePreference(percolatePreference string) *PercolateService
PercolatePreference defines which shard to prefer when executing the percolate request.
func (*PercolateService) PercolateRouting ¶
func (s *PercolateService) PercolateRouting(percolateRouting string) *PercolateService
PercolateRouting is the routing value to use when percolating the existing document.
func (*PercolateService) PercolateType ¶
func (s *PercolateService) PercolateType(percolateType string) *PercolateService
PercolateType is the type to percolate document into. Defaults to type.
func (*PercolateService) Preference ¶
func (s *PercolateService) Preference(preference string) *PercolateService
Preference specifies the node or shard the operation should be performed on (default: random).
func (*PercolateService) Pretty ¶
func (s *PercolateService) Pretty(pretty bool) *PercolateService
Pretty indicates that the JSON response be indented and human readable.
func (*PercolateService) Routing ¶
func (s *PercolateService) Routing(routing []string) *PercolateService
Routing is a list of specific routing values.
func (*PercolateService) Source ¶
func (s *PercolateService) Source(source string) *PercolateService
Source is the URL-encoded request definition.
func (*PercolateService) Type ¶
func (s *PercolateService) Type(typ string) *PercolateService
Type is the type of the document being percolated.
func (*PercolateService) Validate ¶
func (s *PercolateService) Validate() error
Validate checks if the operation is valid.
func (*PercolateService) Version ¶
func (s *PercolateService) Version(version interface{}) *PercolateService
Version is an explicit version number for concurrency control.
func (*PercolateService) VersionType ¶
func (s *PercolateService) VersionType(versionType string) *PercolateService
VersionType is the specific version type.
type PhraseSuggester ¶
type PhraseSuggester struct { Suggester // contains filtered or unexported fields }
For more details, see http://www.elasticsearch.org/guide/reference/api/search/phrase-suggest/
func NewPhraseSuggester ¶
func NewPhraseSuggester(name string) *PhraseSuggester
Creates a new phrase suggester.
func (*PhraseSuggester) Analyzer ¶
func (q *PhraseSuggester) Analyzer(analyzer string) *PhraseSuggester
func (*PhraseSuggester) CandidateGenerator ¶
func (q *PhraseSuggester) CandidateGenerator(generator CandidateGenerator) *PhraseSuggester
func (*PhraseSuggester) CandidateGenerators ¶
func (q *PhraseSuggester) CandidateGenerators(generators ...CandidateGenerator) *PhraseSuggester
func (*PhraseSuggester) ClearCandidateGenerator ¶
func (q *PhraseSuggester) ClearCandidateGenerator() *PhraseSuggester
func (*PhraseSuggester) CollateFilter ¶
func (q *PhraseSuggester) CollateFilter(collateFilter string) *PhraseSuggester
func (*PhraseSuggester) CollateParams ¶
func (q *PhraseSuggester) CollateParams(collateParams map[string]interface{}) *PhraseSuggester
func (*PhraseSuggester) CollatePreference ¶
func (q *PhraseSuggester) CollatePreference(collatePreference string) *PhraseSuggester
func (*PhraseSuggester) CollatePrune ¶
func (q *PhraseSuggester) CollatePrune(collatePrune bool) *PhraseSuggester
func (*PhraseSuggester) CollateQuery ¶
func (q *PhraseSuggester) CollateQuery(collateQuery string) *PhraseSuggester
func (*PhraseSuggester) Confidence ¶
func (q *PhraseSuggester) Confidence(confidence float64) *PhraseSuggester
func (*PhraseSuggester) ContextQueries ¶
func (q *PhraseSuggester) ContextQueries(queries ...SuggesterContextQuery) *PhraseSuggester
func (*PhraseSuggester) ContextQuery ¶
func (q *PhraseSuggester) ContextQuery(query SuggesterContextQuery) *PhraseSuggester
func (*PhraseSuggester) Field ¶
func (q *PhraseSuggester) Field(field string) *PhraseSuggester
func (*PhraseSuggester) ForceUnigrams ¶
func (q *PhraseSuggester) ForceUnigrams(forceUnigrams bool) *PhraseSuggester
func (*PhraseSuggester) GramSize ¶
func (q *PhraseSuggester) GramSize(gramSize int) *PhraseSuggester
func (*PhraseSuggester) Highlight ¶
func (q *PhraseSuggester) Highlight(preTag, postTag string) *PhraseSuggester
func (*PhraseSuggester) MaxErrors ¶
func (q *PhraseSuggester) MaxErrors(maxErrors float64) *PhraseSuggester
func (*PhraseSuggester) Name ¶
func (q *PhraseSuggester) Name() string
func (*PhraseSuggester) RealWordErrorLikelihood ¶
func (q *PhraseSuggester) RealWordErrorLikelihood(realWordErrorLikelihood float64) *PhraseSuggester
func (*PhraseSuggester) Separator ¶
func (q *PhraseSuggester) Separator(separator string) *PhraseSuggester
func (*PhraseSuggester) ShardSize ¶
func (q *PhraseSuggester) ShardSize(shardSize int) *PhraseSuggester
func (*PhraseSuggester) Size ¶
func (q *PhraseSuggester) Size(size int) *PhraseSuggester
func (*PhraseSuggester) SmoothingModel ¶
func (q *PhraseSuggester) SmoothingModel(smoothingModel SmoothingModel) *PhraseSuggester
func (*PhraseSuggester) Source ¶
func (q *PhraseSuggester) Source(includeName bool) (interface{}, error)
Creates the source for the phrase suggester.
func (*PhraseSuggester) Text ¶
func (q *PhraseSuggester) Text(text string) *PhraseSuggester
func (*PhraseSuggester) TokenLimit ¶
func (q *PhraseSuggester) TokenLimit(tokenLimit int) *PhraseSuggester
type PingResult ¶
type PingResult struct { Name string `json:"name"` ClusterName string `json:"cluster_name"` Version struct { Number string `json:"number"` BuildHash string `json:"build_hash"` BuildTimestamp string `json:"build_timestamp"` BuildSnapshot bool `json:"build_snapshot"` LuceneVersion string `json:"lucene_version"` } `json:"version"` TagLine string `json:"tagline"` }
PingResult is the result returned from querying the Elasticsearch server.
type PingService ¶
type PingService struct {
// contains filtered or unexported fields
}
PingService checks if an Elasticsearch server on a given URL is alive. When asked for, it can also return various information about the Elasticsearch server, e.g. the Elasticsearch version number.
Ping simply starts a HTTP GET request to the URL of the server. If the server responds with HTTP Status code 200 OK, the server is alive.
func NewPingService ¶
func NewPingService(client *Client) *PingService
func (*PingService) Do ¶
func (s *PingService) Do() (*PingResult, int, error)
Do returns the PingResult, the HTTP status code of the Elasticsearch server, and an error.
func (*PingService) HttpHeadOnly ¶
func (s *PingService) HttpHeadOnly(httpHeadOnly bool) *PingService
HeadOnly makes the service to only return the status code in Do; the PingResult will be nil.
func (*PingService) Pretty ¶
func (s *PingService) Pretty(pretty bool) *PingService
func (*PingService) Timeout ¶
func (s *PingService) Timeout(timeout string) *PingService
func (*PingService) URL ¶
func (s *PingService) URL(url string) *PingService
type PrefixQuery ¶
type PrefixQuery struct {
// contains filtered or unexported fields
}
PrefixQuery matches documents that have fields containing terms with a specified prefix (not analyzed).
For more details, see https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-prefix-query.html
func NewPrefixQuery ¶
func NewPrefixQuery(name string, prefix string) *PrefixQuery
NewPrefixQuery creates and initializes a new PrefixQuery.
func (*PrefixQuery) Boost ¶
func (q *PrefixQuery) Boost(boost float64) *PrefixQuery
Boost sets the boost for this query.
func (*PrefixQuery) QueryName ¶
func (q *PrefixQuery) QueryName(queryName string) *PrefixQuery
QueryName sets the query name for the filter that can be used when searching for matched_filters per hit.
func (*PrefixQuery) Rewrite ¶
func (q *PrefixQuery) Rewrite(rewrite string) *PrefixQuery
func (*PrefixQuery) Source ¶
func (q *PrefixQuery) Source() (interface{}, error)
Source returns JSON for the query.
type PutMappingResponse ¶
type PutMappingResponse struct {
Acknowledged bool `json:"acknowledged"`
}
PutMappingResponse is the response of PutMappingService.Do.
type PutMappingService ¶
type PutMappingService struct {
// contains filtered or unexported fields
}
PutMappingService allows to register specific mapping definition for a specific type. See http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/indices-put-mapping.html.
func NewPutMappingService ¶
func NewPutMappingService(client *Client) *PutMappingService
NewPutMappingService creates a new PutMappingService.
func (*PutMappingService) AllowNoIndices ¶
func (s *PutMappingService) AllowNoIndices(allowNoIndices bool) *PutMappingService
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 (*PutMappingService) BodyJson ¶
func (s *PutMappingService) BodyJson(mapping map[string]interface{}) *PutMappingService
BodyJson contains the mapping definition.
func (*PutMappingService) BodyString ¶
func (s *PutMappingService) BodyString(mapping string) *PutMappingService
BodyString is the mapping definition serialized as a string.
func (*PutMappingService) Do ¶
func (s *PutMappingService) Do() (*PutMappingResponse, error)
Do executes the operation.
func (*PutMappingService) ExpandWildcards ¶
func (s *PutMappingService) ExpandWildcards(expandWildcards string) *PutMappingService
ExpandWildcards indicates whether to expand wildcard expression to concrete indices that are open, closed or both.
func (*PutMappingService) IgnoreConflicts ¶
func (s *PutMappingService) IgnoreConflicts(ignoreConflicts bool) *PutMappingService
IgnoreConflicts specifies whether to ignore conflicts while updating the mapping (default: false).
func (*PutMappingService) IgnoreUnavailable ¶
func (s *PutMappingService) IgnoreUnavailable(ignoreUnavailable bool) *PutMappingService
IgnoreUnavailable indicates whether specified concrete indices should be ignored when unavailable (missing or closed).
func (*PutMappingService) Index ¶
func (s *PutMappingService) Index(indices ...string) *PutMappingService
Index is a list of index names the mapping should be added to (supports wildcards); use `_all` or omit to add the mapping on all indices.
func (*PutMappingService) MasterTimeout ¶
func (s *PutMappingService) MasterTimeout(masterTimeout string) *PutMappingService
MasterTimeout specifies the timeout for connection to master.
func (*PutMappingService) Pretty ¶
func (s *PutMappingService) Pretty(pretty bool) *PutMappingService
Pretty indicates that the JSON response be indented and human readable.
func (*PutMappingService) Timeout ¶
func (s *PutMappingService) Timeout(timeout string) *PutMappingService
Timeout is an explicit operation timeout.
func (*PutMappingService) Type ¶
func (s *PutMappingService) Type(typ string) *PutMappingService
Type is the name of the document type.
func (*PutMappingService) Validate ¶
func (s *PutMappingService) Validate() error
Validate checks if the operation is valid.
type PutTemplateResponse ¶
type PutTemplateResponse struct { Id string `json:"_id"` Version int `json:"_version"` Created bool `json:"created"` }
PutTemplateResponse is the response of PutTemplateService.Do.
type PutTemplateService ¶
type PutTemplateService struct {
// contains filtered or unexported fields
}
PutTemplateService creates or updates a search template. The documentation can be found at http://www.elasticsearch.org/guide/en/elasticsearch/reference/master/search-template.html.
Example ¶
client, err := elastic.NewClient() if err != nil { panic(err) } // Create search template tmpl := `{"template":{"query":{"match":{"title":"{{query_string}}"}}}}` // Create template resp, err := client.PutTemplate(). Id("my-search-template"). // Name of the template BodyString(tmpl). // Search template itself Do() // Execute if err != nil { panic(err) } if resp.Created { fmt.Println("search template created") }
Output:
func NewPutTemplateService ¶
func NewPutTemplateService(client *Client) *PutTemplateService
NewPutTemplateService creates a new PutTemplateService.
func (*PutTemplateService) BodyJson ¶
func (s *PutTemplateService) BodyJson(body interface{}) *PutTemplateService
BodyJson is the document as a JSON serializable object.
func (*PutTemplateService) BodyString ¶
func (s *PutTemplateService) BodyString(body string) *PutTemplateService
BodyString is the document as a string.
func (*PutTemplateService) Do ¶
func (s *PutTemplateService) Do() (*PutTemplateResponse, error)
Do executes the operation.
func (*PutTemplateService) Id ¶
func (s *PutTemplateService) Id(id string) *PutTemplateService
Id is the template ID.
func (*PutTemplateService) OpType ¶
func (s *PutTemplateService) OpType(opType string) *PutTemplateService
OpType is an explicit operation type.
func (*PutTemplateService) Validate ¶
func (s *PutTemplateService) Validate() error
Validate checks if the operation is valid.
func (*PutTemplateService) Version ¶
func (s *PutTemplateService) Version(version int) *PutTemplateService
Version is an explicit version number for concurrency control.
func (*PutTemplateService) VersionType ¶
func (s *PutTemplateService) VersionType(versionType string) *PutTemplateService
VersionType is a specific version type.
type Query ¶
type Query interface { // Source returns the JSON-serializable query request. Source() (interface{}, error) }
Query represents the generic query interface. A query's sole purpose is to return the source of the query as a JSON-serializable object. Returning map[string]interface{} is the norm for queries.
type QueryRescorer ¶
type QueryRescorer struct {
// contains filtered or unexported fields
}
func NewQueryRescorer ¶
func NewQueryRescorer(query Query) *QueryRescorer
func (*QueryRescorer) Name ¶
func (r *QueryRescorer) Name() string
func (*QueryRescorer) QueryWeight ¶
func (r *QueryRescorer) QueryWeight(queryWeight float64) *QueryRescorer
func (*QueryRescorer) RescoreQueryWeight ¶
func (r *QueryRescorer) RescoreQueryWeight(rescoreQueryWeight float64) *QueryRescorer
func (*QueryRescorer) ScoreMode ¶
func (r *QueryRescorer) ScoreMode(scoreMode string) *QueryRescorer
func (*QueryRescorer) Source ¶
func (r *QueryRescorer) Source() (interface{}, error)
type QueryStringQuery ¶
type QueryStringQuery struct {
// contains filtered or unexported fields
}
QueryStringQuery uses the query parser in order to parse its content.
For more details, see https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-query-string-query.html
func NewQueryStringQuery ¶
func NewQueryStringQuery(queryString string) *QueryStringQuery
NewQueryStringQuery creates and initializes a new QueryStringQuery.
func (*QueryStringQuery) AllowLeadingWildcard ¶
func (q *QueryStringQuery) AllowLeadingWildcard(allowLeadingWildcard bool) *QueryStringQuery
AllowLeadingWildcard specifies whether leading wildcards should be allowed or not (defaults to true).
func (*QueryStringQuery) AnalyzeWildcard ¶
func (q *QueryStringQuery) AnalyzeWildcard(analyzeWildcard bool) *QueryStringQuery
AnalyzeWildcard indicates whether to enabled analysis on wildcard and prefix queries.
func (*QueryStringQuery) Analyzer ¶
func (q *QueryStringQuery) Analyzer(analyzer string) *QueryStringQuery
Analyzer is an optional analyzer used to analyze the query string. Note, if a field has search analyzer defined for it, then it will be used automatically. Defaults to the smart search analyzer.
func (*QueryStringQuery) AutoGeneratePhraseQueries ¶
func (q *QueryStringQuery) AutoGeneratePhraseQueries(autoGeneratePhraseQueries bool) *QueryStringQuery
AutoGeneratePhraseQueries indicates whether or not phrase queries will be automatically generated when the analyzer returns more then one term from whitespace delimited text. Set to false if phrase queries should only be generated when surrounded by double quotes.
func (*QueryStringQuery) Boost ¶
func (q *QueryStringQuery) Boost(boost float64) *QueryStringQuery
Boost sets the boost for this query.
func (*QueryStringQuery) DefaultField ¶
func (q *QueryStringQuery) DefaultField(defaultField string) *QueryStringQuery
DefaultField specifies the field to run against when no prefix field is specified. Only relevant when not explicitly adding fields the query string will run against.
func (*QueryStringQuery) DefaultOperator ¶
func (q *QueryStringQuery) DefaultOperator(operator string) *QueryStringQuery
DefaultOperator sets the boolean operator of the query parser used to parse the query string.
In default mode (OR) terms without any modifiers are considered optional, e.g. "capital of Hungary" is equal to "capital OR of OR Hungary".
In AND mode, terms are considered to be in conjunction. The above mentioned query is then parsed as "capital AND of AND Hungary".
func (*QueryStringQuery) EnablePositionIncrements ¶
func (q *QueryStringQuery) EnablePositionIncrements(enablePositionIncrements bool) *QueryStringQuery
EnablePositionIncrements indicates whether to enable position increments in result query. Defaults to true.
When set, result phrase and multi-phrase queries will be aware of position increments. Useful when e.g. a StopFilter increases the position increment of the token that follows an omitted token.
func (*QueryStringQuery) Field ¶
func (q *QueryStringQuery) Field(field string) *QueryStringQuery
Field adds a field to run the query string against.
func (*QueryStringQuery) FieldWithBoost ¶
func (q *QueryStringQuery) FieldWithBoost(field string, boost float64) *QueryStringQuery
FieldWithBoost adds a field to run the query string against with a specific boost.
func (*QueryStringQuery) Fuzziness ¶
func (q *QueryStringQuery) Fuzziness(fuzziness string) *QueryStringQuery
Fuzziness sets the edit distance for fuzzy queries. Default is "AUTO".
func (*QueryStringQuery) FuzzyMaxExpansions ¶
func (q *QueryStringQuery) FuzzyMaxExpansions(fuzzyMaxExpansions int) *QueryStringQuery
func (*QueryStringQuery) FuzzyPrefixLength ¶
func (q *QueryStringQuery) FuzzyPrefixLength(fuzzyPrefixLength int) *QueryStringQuery
FuzzyPrefixLength sets the minimum prefix length for fuzzy queries. Default is 1.
func (*QueryStringQuery) FuzzyRewrite ¶
func (q *QueryStringQuery) FuzzyRewrite(fuzzyRewrite string) *QueryStringQuery
func (*QueryStringQuery) Lenient ¶
func (q *QueryStringQuery) Lenient(lenient bool) *QueryStringQuery
Lenient indicates whether the query string parser should be lenient when parsing field values. It defaults to the index setting and if not set, defaults to false.
func (*QueryStringQuery) Locale ¶
func (q *QueryStringQuery) Locale(locale string) *QueryStringQuery
func (*QueryStringQuery) LowercaseExpandedTerms ¶
func (q *QueryStringQuery) LowercaseExpandedTerms(lowercaseExpandedTerms bool) *QueryStringQuery
LowercaseExpandedTerms indicates whether terms of wildcard, prefix, fuzzy and range queries are automatically lower-cased or not. Default is true.
func (*QueryStringQuery) MaxDeterminizedState ¶
func (q *QueryStringQuery) MaxDeterminizedState(maxDeterminizedStates int) *QueryStringQuery
MaxDeterminizedState protects against too-difficult regular expression queries.
func (*QueryStringQuery) MinimumShouldMatch ¶
func (q *QueryStringQuery) MinimumShouldMatch(minimumShouldMatch string) *QueryStringQuery
func (*QueryStringQuery) PhraseSlop ¶
func (q *QueryStringQuery) PhraseSlop(phraseSlop int) *QueryStringQuery
PhraseSlop sets the default slop for phrases. If zero, then exact matches are required. Default value is zero.
func (*QueryStringQuery) QueryName ¶
func (q *QueryStringQuery) QueryName(queryName string) *QueryStringQuery
QueryName sets the query name for the filter that can be used when searching for matched_filters per hit.
func (*QueryStringQuery) QuoteAnalyzer ¶
func (q *QueryStringQuery) QuoteAnalyzer(quoteAnalyzer string) *QueryStringQuery
QuoteAnalyzer is an optional analyzer to be used to analyze the query string for phrase searches. Note, if a field has search analyzer defined for it, then it will be used automatically. Defaults to the smart search analyzer.
func (*QueryStringQuery) QuoteFieldSuffix ¶
func (q *QueryStringQuery) QuoteFieldSuffix(quoteFieldSuffix string) *QueryStringQuery
QuoteFieldSuffix is an optional field name suffix to automatically try and add to the field searched when using quoted text.
func (*QueryStringQuery) Rewrite ¶
func (q *QueryStringQuery) Rewrite(rewrite string) *QueryStringQuery
func (*QueryStringQuery) Source ¶
func (q *QueryStringQuery) Source() (interface{}, error)
Source returns JSON for the query.
func (*QueryStringQuery) TieBreaker ¶
func (q *QueryStringQuery) TieBreaker(tieBreaker float64) *QueryStringQuery
TieBreaker is used when more than one field is used with the query string, and combined queries are using dismax.
func (*QueryStringQuery) TimeZone ¶
func (q *QueryStringQuery) TimeZone(timeZone string) *QueryStringQuery
TimeZone can be used to automatically adjust to/from fields using a timezone. Only used with date fields, of course.
func (*QueryStringQuery) UseDisMax ¶
func (q *QueryStringQuery) UseDisMax(useDisMax bool) *QueryStringQuery
UseDisMax specifies whether to combine queries using dis max or boolean query when more zhan one field is used with the query string. Defaults to dismax (true).
type RandomFunction ¶
type RandomFunction struct {
// contains filtered or unexported fields
}
RandomFunction builds a random score function. See https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-function-score-query.html#_random for details.
func NewRandomFunction ¶
func NewRandomFunction() *RandomFunction
NewRandomFunction initializes and returns a new RandomFunction.
func (*RandomFunction) GetWeight ¶
func (fn *RandomFunction) GetWeight() *float64
GetWeight returns the adjusted score. It is part of the ScoreFunction interface. Returns nil if weight is not specified.
func (*RandomFunction) Name ¶
func (fn *RandomFunction) Name() string
Name represents the JSON field name under which the output of Source needs to be serialized by FunctionScoreQuery (see FunctionScoreQuery.Source).
func (*RandomFunction) Seed ¶
func (fn *RandomFunction) Seed(seed interface{}) *RandomFunction
Seed is documented in 1.6 as a numeric value. However, in the source code of the Java client, it also accepts strings. So we accept both here, too.
func (*RandomFunction) Source ¶
func (fn *RandomFunction) Source() (interface{}, error)
Source returns the serializable JSON data of this score function.
func (*RandomFunction) Weight ¶
func (fn *RandomFunction) Weight(weight float64) *RandomFunction
Weight adjusts the score of the score function. See https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-function-score-query.html#_using_function_score for details.
type RangeAggregation ¶
type RangeAggregation struct {
// contains filtered or unexported fields
}
RangeAggregation is a multi-bucket value source based aggregation that enables the user to define a set of ranges - each representing a bucket. During the aggregation process, the values extracted from each document will be checked against each bucket range and "bucket" the relevant/matching document. Note that this aggregration includes the from value and excludes the to value for each range. See: http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/search-aggregations-bucket-range-aggregation.html
func NewRangeAggregation ¶
func NewRangeAggregation() *RangeAggregation
func (*RangeAggregation) AddRange ¶
func (a *RangeAggregation) AddRange(from, to interface{}) *RangeAggregation
func (*RangeAggregation) AddRangeWithKey ¶
func (a *RangeAggregation) AddRangeWithKey(key string, from, to interface{}) *RangeAggregation
func (*RangeAggregation) AddUnboundedFrom ¶
func (a *RangeAggregation) AddUnboundedFrom(to interface{}) *RangeAggregation
func (*RangeAggregation) AddUnboundedFromWithKey ¶
func (a *RangeAggregation) AddUnboundedFromWithKey(key string, to interface{}) *RangeAggregation
func (*RangeAggregation) AddUnboundedTo ¶
func (a *RangeAggregation) AddUnboundedTo(from interface{}) *RangeAggregation
func (*RangeAggregation) AddUnboundedToWithKey ¶
func (a *RangeAggregation) AddUnboundedToWithKey(key string, from interface{}) *RangeAggregation
func (*RangeAggregation) Between ¶
func (a *RangeAggregation) Between(from, to interface{}) *RangeAggregation
func (*RangeAggregation) BetweenWithKey ¶
func (a *RangeAggregation) BetweenWithKey(key string, from, to interface{}) *RangeAggregation
func (*RangeAggregation) Field ¶
func (a *RangeAggregation) Field(field string) *RangeAggregation
func (*RangeAggregation) Gt ¶
func (a *RangeAggregation) Gt(from interface{}) *RangeAggregation
func (*RangeAggregation) GtWithKey ¶
func (a *RangeAggregation) GtWithKey(key string, from interface{}) *RangeAggregation
func (*RangeAggregation) Keyed ¶
func (a *RangeAggregation) Keyed(keyed bool) *RangeAggregation
func (*RangeAggregation) Lt ¶
func (a *RangeAggregation) Lt(to interface{}) *RangeAggregation
func (*RangeAggregation) LtWithKey ¶
func (a *RangeAggregation) LtWithKey(key string, to interface{}) *RangeAggregation
func (*RangeAggregation) Meta ¶
func (a *RangeAggregation) Meta(metaData map[string]interface{}) *RangeAggregation
Meta sets the meta data to be included in the aggregation response.
func (*RangeAggregation) Script ¶
func (a *RangeAggregation) Script(script *Script) *RangeAggregation
func (*RangeAggregation) Source ¶
func (a *RangeAggregation) Source() (interface{}, error)
func (*RangeAggregation) SubAggregation ¶
func (a *RangeAggregation) SubAggregation(name string, subAggregation Aggregation) *RangeAggregation
func (*RangeAggregation) Unmapped ¶
func (a *RangeAggregation) Unmapped(unmapped bool) *RangeAggregation
type RangeQuery ¶
type RangeQuery struct {
// contains filtered or unexported fields
}
RangeQuery matches documents with fields that have terms within a certain range.
For details, see https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-range-query.html
func NewRangeQuery ¶
func NewRangeQuery(name string) *RangeQuery
NewRangeQuery creates and initializes a new RangeQuery.
func (*RangeQuery) Boost ¶
func (q *RangeQuery) Boost(boost float64) *RangeQuery
Boost sets the boost for this query.
func (*RangeQuery) Format ¶
func (q *RangeQuery) Format(format string) *RangeQuery
Format is used for date fields. In that case, we can set the format to be used instead of the mapper format.
func (*RangeQuery) From ¶
func (q *RangeQuery) From(from interface{}) *RangeQuery
From indicates the from part of the RangeQuery. Use nil to indicate an unbounded from part.
func (*RangeQuery) Gt ¶
func (q *RangeQuery) Gt(from interface{}) *RangeQuery
Gt indicates a greater-than value for the from part. Use nil to indicate an unbounded from part.
func (*RangeQuery) Gte ¶
func (q *RangeQuery) Gte(from interface{}) *RangeQuery
Gte indicates a greater-than-or-equal value for the from part. Use nil to indicate an unbounded from part.
func (*RangeQuery) IncludeLower ¶
func (q *RangeQuery) IncludeLower(includeLower bool) *RangeQuery
IncludeLower indicates whether the lower bound should be included or not. Defaults to true.
func (*RangeQuery) IncludeUpper ¶
func (q *RangeQuery) IncludeUpper(includeUpper bool) *RangeQuery
IncludeUpper indicates whether the upper bound should be included or not. Defaults to true.
func (*RangeQuery) Lt ¶
func (q *RangeQuery) Lt(to interface{}) *RangeQuery
Lt indicates a less-than value for the to part. Use nil to indicate an unbounded to part.
func (*RangeQuery) Lte ¶
func (q *RangeQuery) Lte(to interface{}) *RangeQuery
Lte indicates a less-than-or-equal value for the to part. Use nil to indicate an unbounded to part.
func (*RangeQuery) QueryName ¶
func (q *RangeQuery) QueryName(queryName string) *RangeQuery
QueryName sets the query name for the filter that can be used when searching for matched_filters per hit.
func (*RangeQuery) Source ¶
func (q *RangeQuery) Source() (interface{}, error)
Source returns JSON for the query.
func (*RangeQuery) TimeZone ¶
func (q *RangeQuery) TimeZone(timeZone string) *RangeQuery
TimeZone is used for date fields. In that case, we can adjust the from/to fields using a timezone.
func (*RangeQuery) To ¶
func (q *RangeQuery) To(to interface{}) *RangeQuery
To indicates the to part of the RangeQuery. Use nil to indicate an unbounded to part.
type RefreshResult ¶
type RefreshResult struct {
Shards shardsInfo `json:"_shards,omitempty"`
}
type RefreshService ¶
type RefreshService struct {
// contains filtered or unexported fields
}
func NewRefreshService ¶
func NewRefreshService(client *Client) *RefreshService
func (*RefreshService) Do ¶
func (s *RefreshService) Do() (*RefreshResult, error)
func (*RefreshService) Force ¶
func (s *RefreshService) Force(force bool) *RefreshService
func (*RefreshService) Index ¶
func (s *RefreshService) Index(indices ...string) *RefreshService
func (*RefreshService) Pretty ¶
func (s *RefreshService) Pretty(pretty bool) *RefreshService
type RegexpQuery ¶
type RegexpQuery struct {
// contains filtered or unexported fields
}
RegexpQuery allows you to use regular expression term queries.
For more details, see https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-regexp-query.html
func NewRegexpQuery ¶
func NewRegexpQuery(name string, regexp string) *RegexpQuery
NewRegexpQuery creates and initializes a new RegexpQuery.
func (*RegexpQuery) Boost ¶
func (q *RegexpQuery) Boost(boost float64) *RegexpQuery
Boost sets the boost for this query.
func (*RegexpQuery) Flags ¶
func (q *RegexpQuery) Flags(flags string) *RegexpQuery
Flags sets the regexp flags.
func (*RegexpQuery) MaxDeterminizedStates ¶
func (q *RegexpQuery) MaxDeterminizedStates(maxDeterminizedStates int) *RegexpQuery
MaxDeterminizedStates protects against complex regular expressions.
func (*RegexpQuery) QueryName ¶
func (q *RegexpQuery) QueryName(queryName string) *RegexpQuery
QueryName sets the query name for the filter that can be used when searching for matched_filters per hit
func (*RegexpQuery) Rewrite ¶
func (q *RegexpQuery) Rewrite(rewrite string) *RegexpQuery
func (*RegexpQuery) Source ¶
func (q *RegexpQuery) Source() (interface{}, error)
Source returns the JSON-serializable query data.
type Reindexer ¶
type Reindexer struct {
// contains filtered or unexported fields
}
Reindexer simplifies the process of reindexing an index. You typically reindex a source index to a target index. However, you can also specify a query that filters out documents from the source index before bulk indexing them into the target index. The caller may also specify a different client for the target, e.g. when copying indices from one Elasticsearch cluster to another.
Internally, the Reindex users a scan and scroll operation on the source index and bulk indexing to push data into the target index.
By default the reindexer fetches the _source, _parent, and _routing attributes from the source index, using the provided CopyToTargetIndex will copy those attributes into the destinationIndex. This behaviour can be overridden by setting the ScanFields and providing a custom ReindexerFunc.
The caller is responsible for setting up and/or clearing the target index before starting the reindex process.
See http://www.elastic.co/guide/en/elasticsearch/guide/current/reindex.html for more information about reindexing.
func NewReindexer ¶
func NewReindexer(client *Client, source string, reindexerFunc ReindexerFunc) *Reindexer
NewReindexer returns a new Reindexer.
func (*Reindexer) BulkSize ¶
BulkSize returns the number of documents to send to Elasticsearch per chunk. The default is 500.
func (*Reindexer) Do ¶
func (ix *Reindexer) Do() (*ReindexerResponse, error)
Do starts the reindexing process.
func (*Reindexer) Progress ¶
func (ix *Reindexer) Progress(f ReindexerProgressFunc) *Reindexer
Progress indicates a callback that will be called while indexing.
func (*Reindexer) Query ¶
Query specifies the query to apply to the source. It filters out those documents to be indexed into target. A nil query does not filter out any documents.
func (*Reindexer) ScanFields ¶
ScanFields specifies the fields the scan query should load. The default fields are _source, _parent, _routing.
func (*Reindexer) Scroll ¶
Scroll specifies for how long the scroll operation on the source index should be maintained. The default is 5m.
func (*Reindexer) Size ¶
Size is the number of results to return per shard, not per request. So a size of 10 which hits 5 shards will return a maximum of 50 results per scan request.
func (*Reindexer) StatsOnly ¶
StatsOnly indicates whether the Do method should return details e.g. about the documents that failed while indexing. It is true by default, i.e. only the number of documents that succeeded/failed are returned. Set to false if you want all the details.
func (*Reindexer) TargetClient ¶
TargetClient specifies a different client for the target. This is necessary when the target index is in a different Elasticsearch cluster. By default, the source and target clients are the same.
type ReindexerFunc ¶
type ReindexerFunc func(hit *SearchHit, bulkService *BulkService) error
A ReindexerFunc receives each hit from the sourceIndex. It can choose to add any number of BulkableRequests to the bulkService.
func CopyToTargetIndex ¶
func CopyToTargetIndex(targetIndex string) ReindexerFunc
CopyToTargetIndex returns a ReindexerFunc that copies the SearchHit's _source, _parent, and _routing attributes into the targetIndex
type ReindexerProgressFunc ¶
type ReindexerProgressFunc func(current, total int64)
ReindexerProgressFunc is a callback that can be used with Reindexer to report progress while reindexing data.
type ReindexerResponse ¶
type ReindexerResponse struct { Success int64 Failed int64 Errors []*BulkResponseItem }
ReindexerResponse is returned from the Do func in a Reindexer. By default, it returns the number of succeeded and failed bulk operations. To return details about all failed items, set StatsOnly to false in Reindexer.
type Request ¶
Elasticsearch-specific HTTP request
func NewRequest ¶
NewRequest is a http.Request and adds features such as encoding the body.
func (*Request) SetBasicAuth ¶
SetBasicAuth wraps http.Request's SetBasicAuth.
type Rescore ¶
type Rescore struct {
// contains filtered or unexported fields
}
func NewRescore ¶
func NewRescore() *Rescore
func (*Rescore) WindowSize ¶
type Response ¶
type Response struct { // StatusCode is the HTTP status code, e.g. 200. StatusCode int // Header is the HTTP header from the HTTP response. // Keys in the map are canonicalized (see http.CanonicalHeaderKey). Header http.Header // Body is the deserialized response body. Body json.RawMessage }
Response represents a response from Elasticsearch.
type RestoreSource ¶
type ScanCursor ¶
type ScanCursor struct { Results *SearchResult // contains filtered or unexported fields }
scanCursor represents a single page of results from an Elasticsearch Scan operation.
func NewScanCursor ¶
func NewScanCursor(client *Client, keepAlive string, pretty bool, searchResult *SearchResult) *ScanCursor
newScanCursor returns a new initialized instance of scanCursor.
func (*ScanCursor) Next ¶
func (c *ScanCursor) Next() (*SearchResult, error)
Next returns the next search result or nil when all documents have been scanned.
Usage:
for { res, err := cursor.Next() if err == elastic.EOS { // End of stream (or scan) break } if err != nil { // Handle error } // Work with res }
func (*ScanCursor) TotalHits ¶
func (c *ScanCursor) TotalHits() int64
TotalHits is a convenience method that returns the number of hits the cursor will iterate through.
type ScanService ¶
type ScanService struct {
// contains filtered or unexported fields
}
ScanService manages a cursor through documents in Elasticsearch.
func NewScanService ¶
func NewScanService(client *Client) *ScanService
NewScanService creates a new service to iterate through the results of a query.
func (*ScanService) Do ¶
func (s *ScanService) Do() (*ScanCursor, error)
Do executes the query and returns a "server-side cursor".
func (*ScanService) FetchSource ¶
func (s *ScanService) FetchSource(fetchSource bool) *ScanService
FetchSource indicates whether the response should contain the stored _source for every hit.
func (*ScanService) FetchSourceContext ¶
func (s *ScanService) FetchSourceContext(fetchSourceContext *FetchSourceContext) *ScanService
FetchSourceContext indicates how the _source should be fetched.
func (*ScanService) Fields ¶
func (s *ScanService) Fields(fields ...string) *ScanService
Fields tells Elasticsearch to only load specific fields from a search hit. See http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/search-request-fields.html.
func (*ScanService) Index ¶
func (s *ScanService) Index(indices ...string) *ScanService
Index sets the name(s) of the index to use for scan.
func (*ScanService) KeepAlive ¶
func (s *ScanService) KeepAlive(keepAlive string) *ScanService
KeepAlive sets the maximum time the cursor will be available before expiration (e.g. "5m" for 5 minutes).
func (*ScanService) PostFilter ¶
func (s *ScanService) PostFilter(postFilter Query) *ScanService
PostFilter is executed as the last filter. It only affects the search hits but not facets. See http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/search-request-post-filter.html for details.
func (*ScanService) Preference ¶
func (s *ScanService) Preference(preference string) *ScanService
Preference specifies the node or shard the operation should be performed on (default: "random").
func (*ScanService) Pretty ¶
func (s *ScanService) Pretty(pretty bool) *ScanService
Pretty enables the caller to indent the JSON output.
func (*ScanService) Query ¶
func (s *ScanService) Query(query Query) *ScanService
Query sets the query to perform, e.g. MatchAllQuery.
func (*ScanService) Routing ¶
func (s *ScanService) Routing(routings ...string) *ScanService
Routing allows for (a comma-separated) list of specific routing values.
func (*ScanService) Scroll ¶
func (s *ScanService) Scroll(keepAlive string) *ScanService
Scroll is an alias for KeepAlive, the time to keep the cursor alive (e.g. "5m" for 5 minutes).
func (*ScanService) SearchSource ¶
func (s *ScanService) SearchSource(searchSource *SearchSource) *ScanService
SearchSource sets the search source builder to use with this service.
func (*ScanService) Size ¶
func (s *ScanService) Size(size int) *ScanService
Size is the number of results to return per shard, not per request. So a size of 10 which hits 5 shards will return a maximum of 50 results per scan request.
func (*ScanService) Sort ¶
func (s *ScanService) Sort(field string, ascending bool) *ScanService
Sort the results by the given field, in the given order. Use the alternative SortWithInfo to use a struct to define the sorting. See http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/search-request-sort.html for detailed documentation of sorting.
func (*ScanService) SortBy ¶
func (s *ScanService) SortBy(sorter ...Sorter) *ScanService
SortBy defines how to sort results. Use the Sort func for a shortcut. See http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/search-request-sort.html for detailed documentation of sorting.
func (*ScanService) SortWithInfo ¶
func (s *ScanService) SortWithInfo(info SortInfo) *ScanService
SortWithInfo defines how to sort results. Use the Sort func for a shortcut. See http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/search-request-sort.html for detailed documentation of sorting.
func (*ScanService) Type ¶
func (s *ScanService) Type(types ...string) *ScanService
Types allows to restrict the scan to a list of types.
func (*ScanService) Version ¶
func (s *ScanService) Version(version bool) *ScanService
Version can be set to true to return a version for each search hit. See http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/search-request-version.html.
type ScoreFunction ¶
type ScoreFunction interface { Name() string GetWeight() *float64 // returns the weight which must be serialized at the level of FunctionScoreQuery Source() (interface{}, error) }
ScoreFunction is used in combination with the Function Score Query.
type ScoreSort ¶
type ScoreSort struct { Sorter // contains filtered or unexported fields }
ScoreSort sorts by relevancy score.
type Script ¶
type Script struct {
// contains filtered or unexported fields
}
Script holds all the paramaters necessary to compile or find in cache and then execute a script.
See https://www.elastic.co/guide/en/elasticsearch/reference/current/modules-scripting.html for details of scripting.
func NewScriptFile ¶
NewScriptFile creates and initializes a new Script of type "file".
func NewScriptId ¶
NewScriptId creates and initializes a new Script of type "id".
func NewScriptInline ¶
NewScriptInline creates and initializes a new Script of type "inline".
func (*Script) Lang ¶
Lang sets the language of the script. Permitted values are "groovy", "expression", "mustache", "mvel" (default), "javascript", "python". To use certain languages, you need to configure your server and/or add plugins. See https://www.elastic.co/guide/en/elasticsearch/reference/current/modules-scripting.html for details.
func (*Script) Param ¶
Param adds a key/value pair to the parameters that this script will be executed with.
func (*Script) Script ¶
Script is either the cache key of the script to be compiled/executed or the actual script source code for inline scripts. For indexed scripts this is the id used in the request. For file scripts this is the file name.
type ScriptField ¶
type ScriptField struct { FieldName string // name of the field // contains filtered or unexported fields }
ScriptField is a single script field.
func NewScriptField ¶
func NewScriptField(fieldName string, script *Script) *ScriptField
NewScriptField creates and initializes a new ScriptField.
func (*ScriptField) Source ¶
func (f *ScriptField) Source() (interface{}, error)
Source returns the serializable JSON for the ScriptField.
type ScriptFunction ¶
type ScriptFunction struct {
// contains filtered or unexported fields
}
ScriptFunction builds a script score function. It uses a script to compute or influence the score of documents that match with the inner query or filter.
See https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-function-score-query.html#_script_score for details.
func NewScriptFunction ¶
func NewScriptFunction(script *Script) *ScriptFunction
NewScriptFunction initializes and returns a new ScriptFunction.
func (*ScriptFunction) GetWeight ¶
func (fn *ScriptFunction) GetWeight() *float64
GetWeight returns the adjusted score. It is part of the ScoreFunction interface. Returns nil if weight is not specified.
func (*ScriptFunction) Name ¶
func (fn *ScriptFunction) Name() string
Name represents the JSON field name under which the output of Source needs to be serialized by FunctionScoreQuery (see FunctionScoreQuery.Source).
func (*ScriptFunction) Script ¶
func (fn *ScriptFunction) Script(script *Script) *ScriptFunction
Script specifies the script to be executed.
func (*ScriptFunction) Source ¶
func (fn *ScriptFunction) Source() (interface{}, error)
Source returns the serializable JSON data of this score function.
func (*ScriptFunction) Weight ¶
func (fn *ScriptFunction) Weight(weight float64) *ScriptFunction
Weight adjusts the score of the score function. See https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-function-score-query.html#_using_function_score for details.
type ScriptQuery ¶
type ScriptQuery struct {
// contains filtered or unexported fields
}
ScriptQuery allows to define scripts as filters.
For details, see https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-script-query.html
func NewScriptQuery ¶
func NewScriptQuery(script *Script) *ScriptQuery
NewScriptQuery creates and initializes a new ScriptQuery.
func (*ScriptQuery) QueryName ¶
func (q *ScriptQuery) QueryName(queryName string) *ScriptQuery
QueryName sets the query name for the filter that can be used when searching for matched_filters per hit
func (*ScriptQuery) Source ¶
func (q *ScriptQuery) Source() (interface{}, error)
Source returns JSON for the query.
type ScriptSort ¶
type ScriptSort struct { Sorter // contains filtered or unexported fields }
ScriptSort sorts by a custom script. See http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/modules-scripting.html#modules-scripting for details about scripting.
func NewScriptSort ¶
func NewScriptSort(script *Script, typ string) ScriptSort
NewScriptSort creates and initializes a new ScriptSort. You must provide a script and a type, e.g. "string" or "number".
func (ScriptSort) NestedFilter ¶
func (s ScriptSort) NestedFilter(nestedFilter Query) ScriptSort
NestedFilter sets a filter that nested objects should match with in order to be taken into account for sorting.
func (ScriptSort) NestedPath ¶
func (s ScriptSort) NestedPath(nestedPath string) ScriptSort
NestedPath is used if sorting occurs on a field that is inside a nested object.
func (ScriptSort) Order ¶
func (s ScriptSort) Order(ascending bool) ScriptSort
Order defines whether sorting ascending (default) or descending.
func (ScriptSort) SortMode ¶
func (s ScriptSort) SortMode(sortMode string) ScriptSort
SortMode specifies what values to pick in case a document contains multiple values for the targeted sort field. Possible values are: min or max.
func (ScriptSort) Source ¶
func (s ScriptSort) Source() (interface{}, error)
Source returns the JSON-serializable data.
func (ScriptSort) Type ¶
func (s ScriptSort) Type(typ string) ScriptSort
Type sets the script type, which can be either "string" or "number".
type ScrollService ¶
type ScrollService struct {
// contains filtered or unexported fields
}
ScrollService manages a cursor through documents in Elasticsearch.
func NewScrollService ¶
func NewScrollService(client *Client) *ScrollService
func (*ScrollService) Do ¶
func (s *ScrollService) Do() (*SearchResult, error)
func (*ScrollService) GetFirstPage ¶
func (s *ScrollService) GetFirstPage() (*SearchResult, error)
func (*ScrollService) GetNextPage ¶
func (s *ScrollService) GetNextPage() (*SearchResult, error)
func (*ScrollService) Index ¶
func (s *ScrollService) Index(indices ...string) *ScrollService
func (*ScrollService) KeepAlive ¶
func (s *ScrollService) KeepAlive(keepAlive string) *ScrollService
KeepAlive sets the maximum time the cursor will be available before expiration (e.g. "5m" for 5 minutes).
func (*ScrollService) Pretty ¶
func (s *ScrollService) Pretty(pretty bool) *ScrollService
func (*ScrollService) Query ¶
func (s *ScrollService) Query(query Query) *ScrollService
func (*ScrollService) Scroll ¶
func (s *ScrollService) Scroll(keepAlive string) *ScrollService
Scroll is an alias for KeepAlive, the time to keep the cursor alive (e.g. "5m" for 5 minutes).
func (*ScrollService) ScrollId ¶
func (s *ScrollService) ScrollId(scrollId string) *ScrollService
func (*ScrollService) Size ¶
func (s *ScrollService) Size(size int) *ScrollService
func (*ScrollService) Type ¶
func (s *ScrollService) Type(types ...string) *ScrollService
type SearchExplanation ¶
type SearchExplanation struct { Value float64 `json:"value"` // e.g. 1.0 Description string `json:"description"` // e.g. "boost" or "ConstantScore(*:*), product of:" Details []SearchExplanation `json:"details,omitempty"` // recursive details }
SearchExplanation explains how the score for a hit was computed. See http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/search-request-explain.html.
type SearchHit ¶
type SearchHit struct { Score *float64 `json:"_score"` // computed score Index string `json:"_index"` // index name Type string `json:"_type"` // type meta field Id string `json:"_id"` // external or internal Uid string `json:"_uid"` // uid meta field (see MapperService.java for all meta fields) Timestamp int64 `json:"_timestamp"` // timestamp meta field TTL int64 `json:"_ttl"` // ttl meta field Routing string `json:"_routing"` // routing meta field Parent string `json:"_parent"` // parent meta field Version *int64 `json:"_version"` // version number, when Version is set to true in SearchService Sort []interface{} `json:"sort"` // sort information Highlight SearchHitHighlight `json:"highlight"` // highlighter information Source *json.RawMessage `json:"_source"` // stored document source Fields map[string]interface{} `json:"fields"` // returned fields Explanation *SearchExplanation `json:"_explanation"` // explains how the score was computed MatchedQueries []string `json:"matched_queries"` // matched queries InnerHits map[string]*SearchHitInnerHits `json:"inner_hits"` // inner hits with ES >= 1.5.0 }
SearchHit is a single hit.
type SearchHitHighlight ¶
SearchHitHighlight is the highlight information of a search hit. See http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/search-request-highlighting.html for a general discussion of highlighting.
type SearchHitInnerHits ¶
type SearchHitInnerHits struct {
Hits *SearchHits `json:"hits"`
}
type SearchHits ¶
type SearchHits struct { TotalHits int64 `json:"total"` // total number of hits found MaxScore *float64 `json:"max_score"` // maximum score of all hits Hits []*SearchHit `json:"hits"` // the actual hits returned }
SearchHits specifies the list of search hits.
type SearchRequest ¶
type SearchRequest struct {
// contains filtered or unexported fields
}
SearchRequest combines a search request and its query details (see SearchSource). It is used in combination with MultiSearch.
func NewSearchRequest ¶
func NewSearchRequest() *SearchRequest
NewSearchRequest creates a new search request.
func (*SearchRequest) HasIndices ¶
func (r *SearchRequest) HasIndices() bool
func (*SearchRequest) Index ¶
func (r *SearchRequest) Index(indices ...string) *SearchRequest
func (*SearchRequest) Preference ¶
func (r *SearchRequest) Preference(preference string) *SearchRequest
func (*SearchRequest) Routing ¶
func (r *SearchRequest) Routing(routing string) *SearchRequest
func (*SearchRequest) Routings ¶
func (r *SearchRequest) Routings(routings ...string) *SearchRequest
func (*SearchRequest) SearchType ¶
func (r *SearchRequest) SearchType(searchType string) *SearchRequest
SearchRequest must be one of "query_then_fetch", "query_and_fetch", "scan", "count", "dfs_query_then_fetch", or "dfs_query_and_fetch". Use one of the constants defined via SearchType.
func (*SearchRequest) SearchTypeCount ¶
func (r *SearchRequest) SearchTypeCount() *SearchRequest
func (*SearchRequest) SearchTypeDfsQueryAndFetch ¶
func (r *SearchRequest) SearchTypeDfsQueryAndFetch() *SearchRequest
func (*SearchRequest) SearchTypeDfsQueryThenFetch ¶
func (r *SearchRequest) SearchTypeDfsQueryThenFetch() *SearchRequest
func (*SearchRequest) SearchTypeQueryAndFetch ¶
func (r *SearchRequest) SearchTypeQueryAndFetch() *SearchRequest
func (*SearchRequest) SearchTypeQueryThenFetch ¶
func (r *SearchRequest) SearchTypeQueryThenFetch() *SearchRequest
func (*SearchRequest) SearchTypeScan ¶
func (r *SearchRequest) SearchTypeScan() *SearchRequest
func (*SearchRequest) Source ¶
func (r *SearchRequest) Source(source interface{}) *SearchRequest
func (*SearchRequest) Type ¶
func (r *SearchRequest) Type(types ...string) *SearchRequest
type SearchResult ¶
type SearchResult struct { TookInMillis int64 `json:"took"` // search time in milliseconds ScrollId string `json:"_scroll_id"` // only used with Scroll and Scan operations Hits *SearchHits `json:"hits"` // the actual search hits Suggest SearchSuggest `json:"suggest"` // results from suggesters Aggregations Aggregations `json:"aggregations"` // results from aggregations TimedOut bool `json:"timed_out"` // true if the search timed out //Error string `json:"error,omitempty"` // used in MultiSearch only // TODO double-check that MultiGet now returns details error information Error *ErrorDetails `json:"error,omitempty"` // only used in MultiGet }
SearchResult is the result of a search in Elasticsearch.
Example ¶
client, err := elastic.NewClient() if err != nil { panic(err) } // Do a search searchResult, err := client.Search().Index("twitter").Query(elastic.NewMatchAllQuery()).Do() if err != nil { 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) // Each is a utility function that iterates over hits in a search result. // It makes sure you don't need to check for nil values in the response. // However, it ignores errors in serialization. If you want full control // over iterating the hits, see below. var ttyp Tweet for _, item := range searchResult.Each(reflect.TypeOf(ttyp)) { t := item.(Tweet) fmt.Printf("Tweet by %s: %s\n", t.User, t.Message) } fmt.Printf("Found a total of %d tweets\n", searchResult.TotalHits()) // Here's how you iterate hits with full control. 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") }
Output:
func (*SearchResult) Each ¶
func (r *SearchResult) Each(typ reflect.Type) []interface{}
Each is a utility function to iterate over all hits. It saves you from checking for nil values. Notice that Each will ignore errors in serializing JSON.
func (*SearchResult) TotalHits ¶
func (r *SearchResult) TotalHits() int64
TotalHits is a convenience function to return the number of hits for a search result.
type SearchService ¶
type SearchService struct {
// contains filtered or unexported fields
}
Search for documents in Elasticsearch.
Example ¶
// Get a client to the local Elasticsearch instance. client, err := elastic.NewClient() if err != nil { // Handle error 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 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") }
Output:
func NewSearchService ¶
func NewSearchService(client *Client) *SearchService
NewSearchService creates a new service for searching in Elasticsearch.
func (*SearchService) Aggregation ¶
func (s *SearchService) Aggregation(name string, aggregation Aggregation) *SearchService
Aggregation adds an aggreation to perform as part of the search.
func (*SearchService) Do ¶
func (s *SearchService) Do() (*SearchResult, error)
Do executes the search and returns a SearchResult.
func (*SearchService) Explain ¶
func (s *SearchService) Explain(explain bool) *SearchService
Explain indicates whether each search hit should be returned with an explanation of the hit (ranking).
func (*SearchService) FetchSource ¶
func (s *SearchService) FetchSource(fetchSource bool) *SearchService
FetchSource indicates whether the response should contain the stored _source for every hit.
func (*SearchService) FetchSourceContext ¶
func (s *SearchService) FetchSourceContext(fetchSourceContext *FetchSourceContext) *SearchService
FetchSourceContext indicates how the _source should be fetched.
func (*SearchService) Field ¶
func (s *SearchService) Field(fieldName string) *SearchService
Field adds a single field to load and return (note, must be stored) as part of the search request. If none are specified, the source of the document will be returned.
func (*SearchService) Fields ¶
func (s *SearchService) Fields(fields ...string) *SearchService
Fields sets the fields to load and return as part of the search request. If none are specified, the source of the document will be returned.
func (*SearchService) From ¶
func (s *SearchService) From(from int) *SearchService
From index to start the search from. Defaults to 0.
func (*SearchService) GlobalSuggestText ¶
func (s *SearchService) GlobalSuggestText(globalText string) *SearchService
GlobalSuggestText defines the global text to use with all suggesters. This avoids repetition.
func (*SearchService) Highlight ¶
func (s *SearchService) Highlight(highlight *Highlight) *SearchService
Highlight adds highlighting to the search.
func (*SearchService) Index ¶
func (s *SearchService) Index(indices ...string) *SearchService
Index sets the names of the indices to use for search.
func (*SearchService) MinScore ¶
func (s *SearchService) MinScore(minScore float64) *SearchService
MinScore sets the minimum score below which docs will be filtered out.
func (*SearchService) NoFields ¶
func (s *SearchService) NoFields() *SearchService
NoFields indicates that no fields should be loaded, resulting in only id and type to be returned per field.
func (*SearchService) PostFilter ¶
func (s *SearchService) PostFilter(postFilter Query) *SearchService
PostFilter will be executed after the query has been executed and only affects the search hits, not the aggregations. This filter is always executed as the last filtering mechanism.
func (*SearchService) Preference ¶
func (s *SearchService) Preference(preference string) *SearchService
Preference sets the preference to execute the search. Defaults to randomize across shards. Can be set to "_local" to prefer local shards, "_primary" to execute on primary shards only, or a custom value which guarantees that the same order will be used across different requests.
func (*SearchService) Pretty ¶
func (s *SearchService) Pretty(pretty bool) *SearchService
Pretty enables the caller to indent the JSON output.
func (*SearchService) Query ¶
func (s *SearchService) Query(query Query) *SearchService
Query sets the query to perform, e.g. MatchAllQuery.
func (*SearchService) Routing ¶
func (s *SearchService) Routing(routings ...string) *SearchService
Routing is a list of specific routing values to control the shards the search will be executed on.
func (*SearchService) SearchSource ¶
func (s *SearchService) SearchSource(searchSource *SearchSource) *SearchService
SearchSource sets the search source builder to use with this service.
func (*SearchService) SearchType ¶
func (s *SearchService) SearchType(searchType string) *SearchService
SearchType sets the search operation type. Valid values are: "query_then_fetch", "query_and_fetch", "dfs_query_then_fetch", "dfs_query_and_fetch", "count", "scan". See https://www.elastic.co/guide/en/elasticsearch/reference/current/search-request-search-type.html for details.
func (*SearchService) Size ¶
func (s *SearchService) Size(size int) *SearchService
Size is the number of search hits to return. Defaults to 10.
func (*SearchService) Sort ¶
func (s *SearchService) Sort(field string, ascending bool) *SearchService
Sort adds a sort order.
func (*SearchService) SortBy ¶
func (s *SearchService) SortBy(sorter ...Sorter) *SearchService
SortBy adds a sort order.
func (*SearchService) SortWithInfo ¶
func (s *SearchService) SortWithInfo(info SortInfo) *SearchService
SortWithInfo adds a sort order.
func (*SearchService) Source ¶
func (s *SearchService) Source(source interface{}) *SearchService
Source allows the user to set the request body manually without using any of the structs and interfaces in Elastic.
func (*SearchService) Suggester ¶
func (s *SearchService) Suggester(suggester Suggester) *SearchService
Suggester adds a suggester to the search.
func (*SearchService) Timeout ¶
func (s *SearchService) Timeout(timeout string) *SearchService
Timeout sets the timeout to use, e.g. "1s" or "1000ms".
func (*SearchService) TimeoutInMillis ¶
func (s *SearchService) TimeoutInMillis(timeoutInMillis int) *SearchService
TimeoutInMillis sets the timeout in milliseconds.
func (*SearchService) Type ¶
func (s *SearchService) Type(types ...string) *SearchService
Type allows to restrict the search to a list of types.
func (*SearchService) Version ¶
func (s *SearchService) Version(version bool) *SearchService
Version indicates whether each search hit should be returned with a version associated to it.
type SearchSource ¶
type SearchSource struct {
// contains filtered or unexported fields
}
SearchSource enables users to build the search source. It resembles the SearchSourceBuilder in Elasticsearch.
func NewSearchSource ¶
func NewSearchSource() *SearchSource
NewSearchSource initializes a new SearchSource.
func (*SearchSource) Aggregation ¶
func (s *SearchSource) Aggregation(name string, aggregation Aggregation) *SearchSource
Aggregation adds an aggreation to perform as part of the search.
func (*SearchSource) ClearRescorers ¶
func (s *SearchSource) ClearRescorers() *SearchSource
ClearRescorers removes all rescorers from the search.
func (*SearchSource) DefaultRescoreWindowSize ¶
func (s *SearchSource) DefaultRescoreWindowSize(defaultRescoreWindowSize int) *SearchSource
DefaultRescoreWindowSize sets the rescore window size for rescores that don't specify their window.
func (*SearchSource) Explain ¶
func (s *SearchSource) Explain(explain bool) *SearchSource
Explain indicates whether each search hit should be returned with an explanation of the hit (ranking).
func (*SearchSource) FetchSource ¶
func (s *SearchSource) FetchSource(fetchSource bool) *SearchSource
FetchSource indicates whether the response should contain the stored _source for every hit.
func (*SearchSource) FetchSourceContext ¶
func (s *SearchSource) FetchSourceContext(fetchSourceContext *FetchSourceContext) *SearchSource
FetchSourceContext indicates how the _source should be fetched.
func (*SearchSource) Field ¶
func (s *SearchSource) Field(fieldName string) *SearchSource
Field adds a single field to load and return (note, must be stored) as part of the search request. If none are specified, the source of the document will be returned.
func (*SearchSource) FieldDataField ¶
func (s *SearchSource) FieldDataField(fieldDataField string) *SearchSource
FieldDataField adds a single field to load from the field data cache and return as part of the search request.
func (*SearchSource) FieldDataFields ¶
func (s *SearchSource) FieldDataFields(fieldDataFields ...string) *SearchSource
FieldDataFields adds one or more fields to load from the field data cache and return as part of the search request.
func (*SearchSource) Fields ¶
func (s *SearchSource) Fields(fieldNames ...string) *SearchSource
Fields sets the fields to load and return as part of the search request. If none are specified, the source of the document will be returned.
func (*SearchSource) From ¶
func (s *SearchSource) From(from int) *SearchSource
From index to start the search from. Defaults to 0.
func (*SearchSource) GlobalSuggestText ¶
func (s *SearchSource) GlobalSuggestText(text string) *SearchSource
GlobalSuggestText defines the global text to use with all suggesters. This avoids repetition.
func (*SearchSource) Highlight ¶
func (s *SearchSource) Highlight(highlight *Highlight) *SearchSource
Highlight adds highlighting to the search.
func (*SearchSource) Highlighter ¶
func (s *SearchSource) Highlighter() *Highlight
Highlighter returns the highlighter.
func (*SearchSource) IndexBoost ¶
func (s *SearchSource) IndexBoost(index string, boost float64) *SearchSource
IndexBoost sets the boost that a specific index will receive when the query is executed against it.
func (*SearchSource) InnerHit ¶
func (s *SearchSource) InnerHit(name string, innerHit *InnerHit) *SearchSource
InnerHit adds an inner hit to return with the result.
func (*SearchSource) MinScore ¶
func (s *SearchSource) MinScore(minScore float64) *SearchSource
MinScore sets the minimum score below which docs will be filtered out.
func (*SearchSource) NoFields ¶
func (s *SearchSource) NoFields() *SearchSource
NoFields indicates that no fields should be loaded, resulting in only id and type to be returned per field.
func (*SearchSource) PostFilter ¶
func (s *SearchSource) PostFilter(postFilter Query) *SearchSource
PostFilter will be executed after the query has been executed and only affects the search hits, not the aggregations. This filter is always executed as the last filtering mechanism.
func (*SearchSource) Query ¶
func (s *SearchSource) Query(query Query) *SearchSource
Query sets the query to use with this search source.
func (*SearchSource) Rescorer ¶
func (s *SearchSource) Rescorer(rescore *Rescore) *SearchSource
Rescorer adds a rescorer to the search.
func (*SearchSource) ScriptField ¶
func (s *SearchSource) ScriptField(scriptField *ScriptField) *SearchSource
ScriptField adds a single script field with the provided script.
func (*SearchSource) ScriptFields ¶
func (s *SearchSource) ScriptFields(scriptFields ...*ScriptField) *SearchSource
ScriptFields adds one or more script fields with the provided scripts.
func (*SearchSource) Size ¶
func (s *SearchSource) Size(size int) *SearchSource
Size is the number of search hits to return. Defaults to 10.
func (*SearchSource) Sort ¶
func (s *SearchSource) Sort(field string, ascending bool) *SearchSource
Sort adds a sort order.
func (*SearchSource) SortBy ¶
func (s *SearchSource) SortBy(sorter ...Sorter) *SearchSource
SortBy adds a sort order.
func (*SearchSource) SortWithInfo ¶
func (s *SearchSource) SortWithInfo(info SortInfo) *SearchSource
SortWithInfo adds a sort order.
func (*SearchSource) Source ¶
func (s *SearchSource) Source() (interface{}, error)
Source returns the serializable JSON for the source builder.
func (*SearchSource) Stats ¶
func (s *SearchSource) Stats(statsGroup ...string) *SearchSource
Stats group this request will be aggregated under.
func (*SearchSource) Suggester ¶
func (s *SearchSource) Suggester(suggester Suggester) *SearchSource
Suggester adds a suggester to the search.
func (*SearchSource) TerminateAfter ¶
func (s *SearchSource) TerminateAfter(terminateAfter int) *SearchSource
TerminateAfter allows the request to stop after the given number of search hits are collected.
func (*SearchSource) Timeout ¶
func (s *SearchSource) Timeout(timeout string) *SearchSource
Timeout controls how long a search is allowed to take, e.g. "1s" or "500ms".
func (*SearchSource) TimeoutInMillis ¶
func (s *SearchSource) TimeoutInMillis(timeoutInMillis int) *SearchSource
TimeoutInMillis controls how many milliseconds a search is allowed to take before it is canceled.
func (*SearchSource) TrackScores ¶
func (s *SearchSource) TrackScores(trackScores bool) *SearchSource
TrackScores is applied when sorting and controls if scores will be tracked as well. Defaults to false.
func (*SearchSource) Version ¶
func (s *SearchSource) Version(version bool) *SearchSource
Version indicates whether each search hit should be returned with a version associated to it.
type SearchSuggest ¶
type SearchSuggest map[string][]SearchSuggestion
SearchSuggest is a map of suggestions. See http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/search-suggesters.html.
type SearchSuggestion ¶
type SearchSuggestion struct { Text string `json:"text"` Offset int `json:"offset"` Length int `json:"length"` Options []SearchSuggestionOption `json:"options"` }
SearchSuggestion is a single search suggestion. See http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/search-suggesters.html.
type SearchSuggestionOption ¶
type SearchSuggestionOption struct { Text string `json:"text"` Score float64 `json:"score"` Freq int `json:"freq"` Payload interface{} `json:"payload"` }
SearchSuggestionOption is an option of a SearchSuggestion. See http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/search-suggesters.html.
type SerialDiffAggregation ¶
type SerialDiffAggregation struct {
// contains filtered or unexported fields
}
SerialDiffAggregation implements serial differencing. Serial differencing is a technique where values in a time series are subtracted from itself at different time lags or periods.
For more details, see https://www.elastic.co/guide/en/elasticsearch/reference/current/search-aggregations-pipeline-serialdiff-aggregation.html
func NewSerialDiffAggregation ¶
func NewSerialDiffAggregation() *SerialDiffAggregation
NewSerialDiffAggregation creates and initializes a new SerialDiffAggregation.
func (*SerialDiffAggregation) BucketsPath ¶
func (a *SerialDiffAggregation) BucketsPath(bucketsPaths ...string) *SerialDiffAggregation
BucketsPath sets the paths to the buckets to use for this pipeline aggregator.
func (*SerialDiffAggregation) Format ¶
func (a *SerialDiffAggregation) Format(format string) *SerialDiffAggregation
func (*SerialDiffAggregation) GapInsertZeros ¶
func (a *SerialDiffAggregation) GapInsertZeros() *SerialDiffAggregation
GapInsertZeros inserts zeros for gaps in the series.
func (*SerialDiffAggregation) GapPolicy ¶
func (a *SerialDiffAggregation) GapPolicy(gapPolicy string) *SerialDiffAggregation
GapPolicy defines what should be done when a gap in the series is discovered. Valid values include "insert_zeros" or "skip". Default is "insert_zeros".
func (*SerialDiffAggregation) GapSkip ¶
func (a *SerialDiffAggregation) GapSkip() *SerialDiffAggregation
GapSkip skips gaps in the series.
func (*SerialDiffAggregation) Lag ¶
func (a *SerialDiffAggregation) Lag(lag int) *SerialDiffAggregation
Lag specifies the historical bucket to subtract from the current value. E.g. a lag of 7 will subtract the current value from the value 7 buckets ago. Lag must be a positive, non-zero integer.
func (*SerialDiffAggregation) Meta ¶
func (a *SerialDiffAggregation) Meta(metaData map[string]interface{}) *SerialDiffAggregation
Meta sets the meta data to be included in the aggregation response.
func (*SerialDiffAggregation) Source ¶
func (a *SerialDiffAggregation) Source() (interface{}, error)
func (*SerialDiffAggregation) SubAggregation ¶
func (a *SerialDiffAggregation) SubAggregation(name string, subAggregation Aggregation) *SerialDiffAggregation
SubAggregation adds a sub-aggregation to this aggregation.
type SignificantTermsAggregation ¶
type SignificantTermsAggregation struct {
// contains filtered or unexported fields
}
SignificantSignificantTermsAggregation is an aggregation that returns interesting or unusual occurrences of terms in a set. See: http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/search-aggregations-bucket-significantterms-aggregation.html
func NewSignificantTermsAggregation ¶
func NewSignificantTermsAggregation() *SignificantTermsAggregation
func (*SignificantTermsAggregation) BackgroundFilter ¶
func (a *SignificantTermsAggregation) BackgroundFilter(filter Query) *SignificantTermsAggregation
func (*SignificantTermsAggregation) ExecutionHint ¶
func (a *SignificantTermsAggregation) ExecutionHint(hint string) *SignificantTermsAggregation
func (*SignificantTermsAggregation) Field ¶
func (a *SignificantTermsAggregation) Field(field string) *SignificantTermsAggregation
func (*SignificantTermsAggregation) Meta ¶
func (a *SignificantTermsAggregation) Meta(metaData map[string]interface{}) *SignificantTermsAggregation
Meta sets the meta data to be included in the aggregation response.
func (*SignificantTermsAggregation) MinDocCount ¶
func (a *SignificantTermsAggregation) MinDocCount(minDocCount int) *SignificantTermsAggregation
func (*SignificantTermsAggregation) RequiredSize ¶
func (a *SignificantTermsAggregation) RequiredSize(requiredSize int) *SignificantTermsAggregation
func (*SignificantTermsAggregation) ShardMinDocCount ¶
func (a *SignificantTermsAggregation) ShardMinDocCount(shardMinDocCount int) *SignificantTermsAggregation
func (*SignificantTermsAggregation) ShardSize ¶
func (a *SignificantTermsAggregation) ShardSize(shardSize int) *SignificantTermsAggregation
func (*SignificantTermsAggregation) Source ¶
func (a *SignificantTermsAggregation) Source() (interface{}, error)
func (*SignificantTermsAggregation) SubAggregation ¶
func (a *SignificantTermsAggregation) SubAggregation(name string, subAggregation Aggregation) *SignificantTermsAggregation
type SimpleMovAvgModel ¶
type SimpleMovAvgModel struct { }
SimpleMovAvgModel calculates a simple unweighted (arithmetic) moving average.
For more details, see https://www.elastic.co/guide/en/elasticsearch/reference/current/search-aggregations-pipeline-movavg-aggregation.html#_simple
func NewSimpleMovAvgModel ¶
func NewSimpleMovAvgModel() *SimpleMovAvgModel
NewSimpleMovAvgModel creates and initializes a new SimpleMovAvgModel.
func (*SimpleMovAvgModel) Settings ¶
func (m *SimpleMovAvgModel) Settings() map[string]interface{}
Settings of the model.
type SimpleQueryStringQuery ¶
type SimpleQueryStringQuery struct {
// contains filtered or unexported fields
}
SimpleQueryStringQuery is a query that uses the SimpleQueryParser to parse its context. Unlike the regular query_string query, the simple_query_string query will never throw an exception, and discards invalid parts of the query.
For more details, see https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-simple-query-string-query.html
func NewSimpleQueryStringQuery ¶
func NewSimpleQueryStringQuery(text string) *SimpleQueryStringQuery
NewSimpleQueryStringQuery creates and initializes a new SimpleQueryStringQuery.
func (*SimpleQueryStringQuery) AnalyzeWildcard ¶
func (q *SimpleQueryStringQuery) AnalyzeWildcard(analyzeWildcard bool) *SimpleQueryStringQuery
AnalyzeWildcard indicates whether to enabled analysis on wildcard and prefix queries.
func (*SimpleQueryStringQuery) Analyzer ¶
func (q *SimpleQueryStringQuery) Analyzer(analyzer string) *SimpleQueryStringQuery
Analyzer specifies the analyzer to use for the query.
func (*SimpleQueryStringQuery) Boost ¶
func (q *SimpleQueryStringQuery) Boost(boost float64) *SimpleQueryStringQuery
Boost sets the boost for this query.
func (*SimpleQueryStringQuery) DefaultOperator ¶
func (q *SimpleQueryStringQuery) DefaultOperator(defaultOperator string) *SimpleQueryStringQuery
DefaultOperator specifies the default operator for the query.
func (*SimpleQueryStringQuery) Field ¶
func (q *SimpleQueryStringQuery) Field(field string) *SimpleQueryStringQuery
Field adds a field to run the query against.
func (*SimpleQueryStringQuery) FieldWithBoost ¶
func (q *SimpleQueryStringQuery) FieldWithBoost(field string, boost float64) *SimpleQueryStringQuery
Field adds a field to run the query against with a specific boost.
func (*SimpleQueryStringQuery) Flags ¶
func (q *SimpleQueryStringQuery) Flags(flags string) *SimpleQueryStringQuery
Flags sets the flags for the query.
func (*SimpleQueryStringQuery) Lenient ¶
func (q *SimpleQueryStringQuery) Lenient(lenient bool) *SimpleQueryStringQuery
Lenient indicates whether the query string parser should be lenient when parsing field values. It defaults to the index setting and if not set, defaults to false.
func (*SimpleQueryStringQuery) Locale ¶
func (q *SimpleQueryStringQuery) Locale(locale string) *SimpleQueryStringQuery
func (*SimpleQueryStringQuery) LowercaseExpandedTerms ¶
func (q *SimpleQueryStringQuery) LowercaseExpandedTerms(lowercaseExpandedTerms bool) *SimpleQueryStringQuery
LowercaseExpandedTerms indicates whether terms of wildcard, prefix, fuzzy and range queries are automatically lower-cased or not. Default is true.
func (*SimpleQueryStringQuery) MinimumShouldMatch ¶
func (q *SimpleQueryStringQuery) MinimumShouldMatch(minimumShouldMatch string) *SimpleQueryStringQuery
func (*SimpleQueryStringQuery) QueryName ¶
func (q *SimpleQueryStringQuery) QueryName(queryName string) *SimpleQueryStringQuery
QueryName sets the query name for the filter that can be used when searching for matched_filters per hit.
func (*SimpleQueryStringQuery) Source ¶
func (q *SimpleQueryStringQuery) Source() (interface{}, error)
Source returns JSON for the query.
type SmoothingModel ¶
type SortInfo ¶
type SortInfo struct { Sorter Field string Ascending bool Missing interface{} IgnoreUnmapped *bool SortMode string NestedFilter Query NestedPath string }
SortInfo contains information about sorting a field.
type Sorter ¶
type Sorter interface {
Source() (interface{}, error)
}
Sorter is an interface for sorting strategies, e.g. ScoreSort or FieldSort. See http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/search-request-sort.html.
type StatsAggregation ¶
type StatsAggregation struct {
// contains filtered or unexported fields
}
StatsAggregation is a multi-value metrics aggregation that computes stats over numeric values extracted from the aggregated documents. These values can be extracted either from specific numeric fields in the documents, or be generated by a provided script. See: http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/search-aggregations-metrics-stats-aggregation.html
func NewStatsAggregation ¶
func NewStatsAggregation() *StatsAggregation
func (*StatsAggregation) Field ¶
func (a *StatsAggregation) Field(field string) *StatsAggregation
func (*StatsAggregation) Format ¶
func (a *StatsAggregation) Format(format string) *StatsAggregation
func (*StatsAggregation) Meta ¶
func (a *StatsAggregation) Meta(metaData map[string]interface{}) *StatsAggregation
Meta sets the meta data to be included in the aggregation response.
func (*StatsAggregation) Script ¶
func (a *StatsAggregation) Script(script *Script) *StatsAggregation
func (*StatsAggregation) Source ¶
func (a *StatsAggregation) Source() (interface{}, error)
func (*StatsAggregation) SubAggregation ¶
func (a *StatsAggregation) SubAggregation(name string, subAggregation Aggregation) *StatsAggregation
type StupidBackoffSmoothingModel ¶
type StupidBackoffSmoothingModel struct {
// contains filtered or unexported fields
}
StupidBackoffSmoothingModel implements a stupid backoff smoothing model. See http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/search-suggesters-phrase.html#_smoothing_models for details about smoothing models.
func NewStupidBackoffSmoothingModel ¶
func NewStupidBackoffSmoothingModel(discount float64) *StupidBackoffSmoothingModel
func (*StupidBackoffSmoothingModel) Source ¶
func (sm *StupidBackoffSmoothingModel) Source() (interface{}, error)
func (*StupidBackoffSmoothingModel) Type ¶
func (sm *StupidBackoffSmoothingModel) Type() string
type SuggestField ¶
type SuggestField struct {
// contains filtered or unexported fields
}
SuggestField can be used by the caller to specify a suggest field at index time. For a detailed example, see e.g. http://www.elasticsearch.org/blog/you-complete-me/.
func NewSuggestField ¶
func NewSuggestField() *SuggestField
func (*SuggestField) ContextQuery ¶
func (f *SuggestField) ContextQuery(queries ...SuggesterContextQuery) *SuggestField
func (*SuggestField) Input ¶
func (f *SuggestField) Input(input ...string) *SuggestField
func (*SuggestField) MarshalJSON ¶
func (f *SuggestField) MarshalJSON() ([]byte, error)
MarshalJSON encodes SuggestField into JSON.
func (*SuggestField) Output ¶
func (f *SuggestField) Output(output string) *SuggestField
func (*SuggestField) Payload ¶
func (f *SuggestField) Payload(payload interface{}) *SuggestField
func (*SuggestField) Weight ¶
func (f *SuggestField) Weight(weight int) *SuggestField
type SuggestResult ¶
type SuggestResult map[string][]Suggestion
type SuggestService ¶
type SuggestService struct {
// contains filtered or unexported fields
}
SuggestService returns suggestions for text.
func NewSuggestService ¶
func NewSuggestService(client *Client) *SuggestService
func (*SuggestService) Do ¶
func (s *SuggestService) Do() (SuggestResult, error)
func (*SuggestService) Index ¶
func (s *SuggestService) Index(indices ...string) *SuggestService
func (*SuggestService) Preference ¶
func (s *SuggestService) Preference(preference string) *SuggestService
func (*SuggestService) Pretty ¶
func (s *SuggestService) Pretty(pretty bool) *SuggestService
func (*SuggestService) Routing ¶
func (s *SuggestService) Routing(routing string) *SuggestService
func (*SuggestService) Suggester ¶
func (s *SuggestService) Suggester(suggester Suggester) *SuggestService
type Suggester ¶
Represents the generic suggester interface. A suggester's only purpose is to return the source of the query as a JSON-serializable object. Returning a map[string]interface{} will do.
type SuggesterCategoryMapping ¶
type SuggesterCategoryMapping struct {
// contains filtered or unexported fields
}
SuggesterCategoryMapping provides a mapping for a category context in a suggester. See http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/suggester-context.html#_category_mapping.
func NewSuggesterCategoryMapping ¶
func NewSuggesterCategoryMapping(name string) *SuggesterCategoryMapping
NewSuggesterCategoryMapping creates a new SuggesterCategoryMapping.
func (*SuggesterCategoryMapping) DefaultValues ¶
func (q *SuggesterCategoryMapping) DefaultValues(values ...string) *SuggesterCategoryMapping
func (*SuggesterCategoryMapping) FieldName ¶
func (q *SuggesterCategoryMapping) FieldName(fieldName string) *SuggesterCategoryMapping
func (*SuggesterCategoryMapping) Source ¶
func (q *SuggesterCategoryMapping) Source() (interface{}, error)
Source returns a map that will be used to serialize the context query as JSON.
type SuggesterCategoryQuery ¶
type SuggesterCategoryQuery struct {
// contains filtered or unexported fields
}
SuggesterCategoryQuery provides querying a category context in a suggester. See http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/suggester-context.html#_category_query.
func NewSuggesterCategoryQuery ¶
func NewSuggesterCategoryQuery(name string, values ...string) *SuggesterCategoryQuery
NewSuggesterCategoryQuery creates a new SuggesterCategoryQuery.
func (*SuggesterCategoryQuery) Source ¶
func (q *SuggesterCategoryQuery) Source() (interface{}, error)
Source returns a map that will be used to serialize the context query as JSON.
func (*SuggesterCategoryQuery) Values ¶
func (q *SuggesterCategoryQuery) Values(values ...string) *SuggesterCategoryQuery
type SuggesterContextQuery ¶
type SuggesterContextQuery interface {
Source() (interface{}, error)
}
SuggesterContextQuery is used to define context information within a suggestion request.
type SuggesterGeoMapping ¶
type SuggesterGeoMapping struct {
// contains filtered or unexported fields
}
SuggesterGeoMapping provides a mapping for a geolocation context in a suggester. See http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/suggester-context.html#_geo_location_mapping.
func NewSuggesterGeoMapping ¶
func NewSuggesterGeoMapping(name string) *SuggesterGeoMapping
NewSuggesterGeoMapping creates a new SuggesterGeoMapping.
func (*SuggesterGeoMapping) DefaultLocations ¶
func (q *SuggesterGeoMapping) DefaultLocations(locations ...*GeoPoint) *SuggesterGeoMapping
func (*SuggesterGeoMapping) FieldName ¶
func (q *SuggesterGeoMapping) FieldName(fieldName string) *SuggesterGeoMapping
func (*SuggesterGeoMapping) Neighbors ¶
func (q *SuggesterGeoMapping) Neighbors(neighbors bool) *SuggesterGeoMapping
func (*SuggesterGeoMapping) Precision ¶
func (q *SuggesterGeoMapping) Precision(precision ...string) *SuggesterGeoMapping
func (*SuggesterGeoMapping) Source ¶
func (q *SuggesterGeoMapping) Source() (interface{}, error)
Source returns a map that will be used to serialize the context query as JSON.
type SuggesterGeoQuery ¶
type SuggesterGeoQuery struct {
// contains filtered or unexported fields
}
SuggesterGeoQuery provides querying a geolocation context in a suggester. See http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/suggester-context.html#_geo_location_query
func NewSuggesterGeoQuery ¶
func NewSuggesterGeoQuery(name string, location *GeoPoint) *SuggesterGeoQuery
NewSuggesterGeoQuery creates a new SuggesterGeoQuery.
func (*SuggesterGeoQuery) Precision ¶
func (q *SuggesterGeoQuery) Precision(precision ...string) *SuggesterGeoQuery
func (*SuggesterGeoQuery) Source ¶
func (q *SuggesterGeoQuery) Source() (interface{}, error)
Source returns a map that will be used to serialize the context query as JSON.
type Suggestion ¶
type SumAggregation ¶
type SumAggregation struct {
// contains filtered or unexported fields
}
SumAggregation is a single-value metrics aggregation that sums up 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-sum-aggregation.html
func NewSumAggregation ¶
func NewSumAggregation() *SumAggregation
func (*SumAggregation) Field ¶
func (a *SumAggregation) Field(field string) *SumAggregation
func (*SumAggregation) Format ¶
func (a *SumAggregation) Format(format string) *SumAggregation
func (*SumAggregation) Meta ¶
func (a *SumAggregation) Meta(metaData map[string]interface{}) *SumAggregation
Meta sets the meta data to be included in the aggregation response.
func (*SumAggregation) Script ¶
func (a *SumAggregation) Script(script *Script) *SumAggregation
func (*SumAggregation) Source ¶
func (a *SumAggregation) Source() (interface{}, error)
func (*SumAggregation) SubAggregation ¶
func (a *SumAggregation) SubAggregation(name string, subAggregation Aggregation) *SumAggregation
type SumBucketAggregation ¶
type SumBucketAggregation struct {
// contains filtered or unexported fields
}
SumBucketAggregation is a sibling pipeline aggregation which calculates the sum across all buckets of a specified metric in a sibling aggregation. The specified metric must be numeric and the sibling aggregation must be a multi-bucket aggregation.
For more details, see https://www.elastic.co/guide/en/elasticsearch/reference/current/search-aggregations-pipeline-sum-bucket-aggregation.html
func NewSumBucketAggregation ¶
func NewSumBucketAggregation() *SumBucketAggregation
NewSumBucketAggregation creates and initializes a new SumBucketAggregation.
func (*SumBucketAggregation) BucketsPath ¶
func (a *SumBucketAggregation) BucketsPath(bucketsPaths ...string) *SumBucketAggregation
BucketsPath sets the paths to the buckets to use for this pipeline aggregator.
func (*SumBucketAggregation) Format ¶
func (a *SumBucketAggregation) Format(format string) *SumBucketAggregation
func (*SumBucketAggregation) GapInsertZeros ¶
func (a *SumBucketAggregation) GapInsertZeros() *SumBucketAggregation
GapInsertZeros inserts zeros for gaps in the series.
func (*SumBucketAggregation) GapPolicy ¶
func (a *SumBucketAggregation) GapPolicy(gapPolicy string) *SumBucketAggregation
GapPolicy defines what should be done when a gap in the series is discovered. Valid values include "insert_zeros" or "skip". Default is "insert_zeros".
func (*SumBucketAggregation) GapSkip ¶
func (a *SumBucketAggregation) GapSkip() *SumBucketAggregation
GapSkip skips gaps in the series.
func (*SumBucketAggregation) Meta ¶
func (a *SumBucketAggregation) Meta(metaData map[string]interface{}) *SumBucketAggregation
Meta sets the meta data to be included in the aggregation response.
func (*SumBucketAggregation) Source ¶
func (a *SumBucketAggregation) Source() (interface{}, error)
func (*SumBucketAggregation) SubAggregation ¶
func (a *SumBucketAggregation) SubAggregation(name string, subAggregation Aggregation) *SumBucketAggregation
SubAggregation adds a sub-aggregation to this aggregation.
type TemplateQuery ¶
type TemplateQuery struct {
// contains filtered or unexported fields
}
TemplateQuery is a query that accepts a query template and a map of key/value pairs to fill in template parameters.
For more details, see https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-template-query.html
func NewTemplateQuery ¶
func NewTemplateQuery(name string) *TemplateQuery
NewTemplateQuery creates and initializes a new TemplateQuery.
func (*TemplateQuery) Source ¶
func (q *TemplateQuery) Source() (interface{}, error)
Source returns the JSON serializable content for the search.
func (*TemplateQuery) Template ¶
func (q *TemplateQuery) Template(name string) *TemplateQuery
Template specifies the name of the template.
func (*TemplateQuery) TemplateType ¶
func (q *TemplateQuery) TemplateType(typ string) *TemplateQuery
TemplateType defines which kind of query we use. The values can be: inline, indexed, or file. If undefined, inline is used.
func (*TemplateQuery) Var ¶
func (q *TemplateQuery) Var(name string, value interface{}) *TemplateQuery
Var sets a single parameter pair.
func (*TemplateQuery) Vars ¶
func (q *TemplateQuery) Vars(vars map[string]interface{}) *TemplateQuery
Vars sets parameters for the template query.
type TermQuery ¶
type TermQuery struct {
// contains filtered or unexported fields
}
TermQuery finds documents that contain the exact term specified in the inverted index.
For details, see https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-term-query.html
func NewTermQuery ¶
NewTermQuery creates and initializes a new TermQuery.
type TermSuggester ¶
type TermSuggester struct { Suggester // contains filtered or unexported fields }
For more details, see http://www.elasticsearch.org/guide/reference/api/search/term-suggest/
func NewTermSuggester ¶
func NewTermSuggester(name string) *TermSuggester
Creates a new term suggester.
func (*TermSuggester) Accuracy ¶
func (q *TermSuggester) Accuracy(accuracy float64) *TermSuggester
func (*TermSuggester) Analyzer ¶
func (q *TermSuggester) Analyzer(analyzer string) *TermSuggester
func (*TermSuggester) ContextQueries ¶
func (q *TermSuggester) ContextQueries(queries ...SuggesterContextQuery) *TermSuggester
func (*TermSuggester) ContextQuery ¶
func (q *TermSuggester) ContextQuery(query SuggesterContextQuery) *TermSuggester
func (*TermSuggester) Field ¶
func (q *TermSuggester) Field(field string) *TermSuggester
func (*TermSuggester) MaxEdits ¶
func (q *TermSuggester) MaxEdits(maxEdits int) *TermSuggester
func (*TermSuggester) MaxInspections ¶
func (q *TermSuggester) MaxInspections(maxInspections int) *TermSuggester
func (*TermSuggester) MaxTermFreq ¶
func (q *TermSuggester) MaxTermFreq(maxTermFreq float64) *TermSuggester
func (*TermSuggester) MinDocFreq ¶
func (q *TermSuggester) MinDocFreq(minDocFreq float64) *TermSuggester
func (*TermSuggester) MinWordLength ¶
func (q *TermSuggester) MinWordLength(minWordLength int) *TermSuggester
func (*TermSuggester) Name ¶
func (q *TermSuggester) Name() string
func (*TermSuggester) PrefixLength ¶
func (q *TermSuggester) PrefixLength(prefixLength int) *TermSuggester
func (*TermSuggester) ShardSize ¶
func (q *TermSuggester) ShardSize(shardSize int) *TermSuggester
func (*TermSuggester) Size ¶
func (q *TermSuggester) Size(size int) *TermSuggester
func (*TermSuggester) Sort ¶
func (q *TermSuggester) Sort(sort string) *TermSuggester
func (*TermSuggester) Source ¶
func (q *TermSuggester) Source(includeName bool) (interface{}, error)
Creates the source for the term suggester.
func (*TermSuggester) StringDistance ¶
func (q *TermSuggester) StringDistance(stringDistance string) *TermSuggester
func (*TermSuggester) SuggestMode ¶
func (q *TermSuggester) SuggestMode(suggestMode string) *TermSuggester
func (*TermSuggester) Text ¶
func (q *TermSuggester) Text(text string) *TermSuggester
type TermVectorsFieldInfo ¶
type TermVectorsFieldInfo struct { FieldStatistics FieldStatistics `json:"field_statistics"` Terms map[string]TermsInfo `json:"terms"` }
type TermsAggregation ¶
type TermsAggregation struct {
// contains filtered or unexported fields
}
TermsAggregation is a multi-bucket value source based aggregation where buckets are dynamically built - one per unique value. See: http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/search-aggregations-bucket-terms-aggregation.html
func NewTermsAggregation ¶
func NewTermsAggregation() *TermsAggregation
func (*TermsAggregation) CollectionMode ¶
func (a *TermsAggregation) CollectionMode(collectionMode string) *TermsAggregation
Collection mode can be depth_first or breadth_first as of 1.4.0.
func (*TermsAggregation) Exclude ¶
func (a *TermsAggregation) Exclude(regexp string) *TermsAggregation
func (*TermsAggregation) ExcludeTerms ¶
func (a *TermsAggregation) ExcludeTerms(terms ...string) *TermsAggregation
func (*TermsAggregation) ExcludeWithFlags ¶
func (a *TermsAggregation) ExcludeWithFlags(regexp string, flags int) *TermsAggregation
func (*TermsAggregation) ExecutionHint ¶
func (a *TermsAggregation) ExecutionHint(hint string) *TermsAggregation
func (*TermsAggregation) Field ¶
func (a *TermsAggregation) Field(field string) *TermsAggregation
func (*TermsAggregation) Include ¶
func (a *TermsAggregation) Include(regexp string) *TermsAggregation
func (*TermsAggregation) IncludeTerms ¶
func (a *TermsAggregation) IncludeTerms(terms ...string) *TermsAggregation
func (*TermsAggregation) IncludeWithFlags ¶
func (a *TermsAggregation) IncludeWithFlags(regexp string, flags int) *TermsAggregation
func (*TermsAggregation) Meta ¶
func (a *TermsAggregation) Meta(metaData map[string]interface{}) *TermsAggregation
Meta sets the meta data to be included in the aggregation response.
func (*TermsAggregation) MinDocCount ¶
func (a *TermsAggregation) MinDocCount(minDocCount int) *TermsAggregation
func (*TermsAggregation) Order ¶
func (a *TermsAggregation) Order(order string, asc bool) *TermsAggregation
func (*TermsAggregation) OrderByAggregation ¶
func (a *TermsAggregation) OrderByAggregation(aggName string, asc bool) *TermsAggregation
OrderByAggregation creates a bucket ordering strategy which sorts buckets based on a single-valued calc get.
func (*TermsAggregation) OrderByAggregationAndMetric ¶
func (a *TermsAggregation) OrderByAggregationAndMetric(aggName, metric string, asc bool) *TermsAggregation
OrderByAggregationAndMetric creates a bucket ordering strategy which sorts buckets based on a multi-valued calc get.
func (*TermsAggregation) OrderByCount ¶
func (a *TermsAggregation) OrderByCount(asc bool) *TermsAggregation
func (*TermsAggregation) OrderByCountAsc ¶
func (a *TermsAggregation) OrderByCountAsc() *TermsAggregation
func (*TermsAggregation) OrderByCountDesc ¶
func (a *TermsAggregation) OrderByCountDesc() *TermsAggregation
func (*TermsAggregation) OrderByTerm ¶
func (a *TermsAggregation) OrderByTerm(asc bool) *TermsAggregation
func (*TermsAggregation) OrderByTermAsc ¶
func (a *TermsAggregation) OrderByTermAsc() *TermsAggregation
func (*TermsAggregation) OrderByTermDesc ¶
func (a *TermsAggregation) OrderByTermDesc() *TermsAggregation
func (*TermsAggregation) RequiredSize ¶
func (a *TermsAggregation) RequiredSize(requiredSize int) *TermsAggregation
func (*TermsAggregation) Script ¶
func (a *TermsAggregation) Script(script *Script) *TermsAggregation
func (*TermsAggregation) ShardMinDocCount ¶
func (a *TermsAggregation) ShardMinDocCount(shardMinDocCount int) *TermsAggregation
func (*TermsAggregation) ShardSize ¶
func (a *TermsAggregation) ShardSize(shardSize int) *TermsAggregation
func (*TermsAggregation) ShowTermDocCountError ¶
func (a *TermsAggregation) ShowTermDocCountError(showTermDocCountError bool) *TermsAggregation
func (*TermsAggregation) Size ¶
func (a *TermsAggregation) Size(size int) *TermsAggregation
func (*TermsAggregation) Source ¶
func (a *TermsAggregation) Source() (interface{}, error)
func (*TermsAggregation) SubAggregation ¶
func (a *TermsAggregation) SubAggregation(name string, subAggregation Aggregation) *TermsAggregation
func (*TermsAggregation) ValueType ¶
func (a *TermsAggregation) ValueType(valueType string) *TermsAggregation
ValueType can be string, long, or double.
type TermsQuery ¶
type TermsQuery struct {
// contains filtered or unexported fields
}
TermsQuery filters documents that have fields that match any of the provided terms (not analyzed).
For more details, see https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-terms-query.html
func NewTermsQuery ¶
func NewTermsQuery(name string, values ...interface{}) *TermsQuery
NewTermsQuery creates and initializes a new TermsQuery.
func (*TermsQuery) Boost ¶
func (q *TermsQuery) Boost(boost float64) *TermsQuery
Boost sets the boost for this query.
func (*TermsQuery) QueryName ¶
func (q *TermsQuery) QueryName(queryName string) *TermsQuery
QueryName sets the query name for the filter that can be used when searching for matched_filters per hit
func (*TermsQuery) Source ¶
func (q *TermsQuery) Source() (interface{}, error)
Creates the query source for the term query.
type TermvectorsFilterSettings ¶
type TermvectorsFilterSettings struct {
// contains filtered or unexported fields
}
TermvectorsFilterSettings adds additional filters to a Termsvector request. It allows to filter terms based on their tf-idf scores. See https://www.elastic.co/guide/en/elasticsearch/reference/2.1/docs-termvectors.html#_terms_filtering for more information.
func NewTermvectorsFilterSettings ¶
func NewTermvectorsFilterSettings() *TermvectorsFilterSettings
NewTermvectorsFilterSettings creates and initializes a new TermvectorsFilterSettings struct.
func (*TermvectorsFilterSettings) MaxDocFreq ¶
func (fs *TermvectorsFilterSettings) MaxDocFreq(value int64) *TermvectorsFilterSettings
MaxDocFreq ignores terms which occur in more than this many docs.
func (*TermvectorsFilterSettings) MaxNumTerms ¶
func (fs *TermvectorsFilterSettings) MaxNumTerms(value int64) *TermvectorsFilterSettings
MaxNumTerms specifies the maximum number of terms the must be returned per field.
func (*TermvectorsFilterSettings) MaxTermFreq ¶
func (fs *TermvectorsFilterSettings) MaxTermFreq(value int64) *TermvectorsFilterSettings
MaxTermFreq ignores words with more than this frequency in the source doc.
func (*TermvectorsFilterSettings) MaxWordLength ¶
func (fs *TermvectorsFilterSettings) MaxWordLength(value int64) *TermvectorsFilterSettings
MaxWordLength specifies the maximum word length above which words will be ignored.
func (*TermvectorsFilterSettings) MinDocFreq ¶
func (fs *TermvectorsFilterSettings) MinDocFreq(value int64) *TermvectorsFilterSettings
MinDocFreq ignores terms which do not occur in at least this many docs.
func (*TermvectorsFilterSettings) MinTermFreq ¶
func (fs *TermvectorsFilterSettings) MinTermFreq(value int64) *TermvectorsFilterSettings
MinTermFreq ignores words with less than this frequency in the source doc.
func (*TermvectorsFilterSettings) MinWordLength ¶
func (fs *TermvectorsFilterSettings) MinWordLength(value int64) *TermvectorsFilterSettings
MinWordLength specifies the minimum word length below which words will be ignored.
func (*TermvectorsFilterSettings) Source ¶
func (fs *TermvectorsFilterSettings) Source() (interface{}, error)
Source returns JSON for the query.
type TermvectorsResponse ¶
type TermvectorsResponse struct { Index string `json:"_index"` Type string `json:"_type"` Id string `json:"_id,omitempty"` Version int `json:"_version"` Found bool `json:"found"` Took int64 `json:"took"` TermVectors map[string]TermVectorsFieldInfo `json:"term_vectors"` }
TermvectorsResponse is the response of TermvectorsService.Do.
type TermvectorsService ¶
type TermvectorsService struct {
// contains filtered or unexported fields
}
TermvectorsService returns information and statistics on terms in the fields of a particular document. The document could be stored in the index or artificially provided by the user.
See https://www.elastic.co/guide/en/elasticsearch/reference/2.1/docs-termvectors.html for documentation.
func NewTermvectorsService ¶
func NewTermvectorsService(client *Client) *TermvectorsService
NewTermvectorsService creates a new TermvectorsService.
func (*TermvectorsService) BodyJson ¶
func (s *TermvectorsService) BodyJson(body interface{}) *TermvectorsService
BodyJson defines the body parameters. See documentation.
func (*TermvectorsService) BodyString ¶
func (s *TermvectorsService) BodyString(body string) *TermvectorsService
BodyString defines the body parameters as a string. See documentation.
func (*TermvectorsService) Dfs ¶
func (s *TermvectorsService) Dfs(dfs bool) *TermvectorsService
Dfs specifies if distributed frequencies should be returned instead shard frequencies.
func (*TermvectorsService) Do ¶
func (s *TermvectorsService) Do() (*TermvectorsResponse, error)
Do executes the operation.
func (*TermvectorsService) Doc ¶
func (s *TermvectorsService) Doc(doc interface{}) *TermvectorsService
Doc is the document to analyze.
func (*TermvectorsService) FieldStatistics ¶
func (s *TermvectorsService) FieldStatistics(fieldStatistics bool) *TermvectorsService
FieldStatistics specifies if document count, sum of document frequencies and sum of total term frequencies should be returned.
func (*TermvectorsService) Fields ¶
func (s *TermvectorsService) Fields(fields ...string) *TermvectorsService
Fields a list of fields to return.
func (*TermvectorsService) Filter ¶
func (s *TermvectorsService) Filter(filter *TermvectorsFilterSettings) *TermvectorsService
Filter adds terms filter settings.
func (*TermvectorsService) Id ¶
func (s *TermvectorsService) Id(id string) *TermvectorsService
Id of the document.
func (*TermvectorsService) Index ¶
func (s *TermvectorsService) Index(index string) *TermvectorsService
Index in which the document resides.
func (*TermvectorsService) Offsets ¶
func (s *TermvectorsService) Offsets(offsets bool) *TermvectorsService
Offsets specifies if term offsets should be returned.
func (*TermvectorsService) Parent ¶
func (s *TermvectorsService) Parent(parent string) *TermvectorsService
Parent id of documents.
func (*TermvectorsService) Payloads ¶
func (s *TermvectorsService) Payloads(payloads bool) *TermvectorsService
Payloads specifies if term payloads should be returned.
func (*TermvectorsService) PerFieldAnalyzer ¶
func (s *TermvectorsService) PerFieldAnalyzer(perFieldAnalyzer map[string]string) *TermvectorsService
PerFieldAnalyzer allows to specify a different analyzer than the one at the field.
func (*TermvectorsService) Positions ¶
func (s *TermvectorsService) Positions(positions bool) *TermvectorsService
Positions specifies if term positions should be returned.
func (*TermvectorsService) Preference ¶
func (s *TermvectorsService) Preference(preference string) *TermvectorsService
Preference specify the node or shard the operation should be performed on (default: random).
func (*TermvectorsService) Pretty ¶
func (s *TermvectorsService) Pretty(pretty bool) *TermvectorsService
Pretty indicates that the JSON response be indented and human readable.
func (*TermvectorsService) Realtime ¶
func (s *TermvectorsService) Realtime(realtime bool) *TermvectorsService
Realtime specifies if request is real-time as opposed to near-real-time (default: true).
func (*TermvectorsService) Routing ¶
func (s *TermvectorsService) Routing(routing string) *TermvectorsService
Routing is a specific routing value.
func (*TermvectorsService) TermStatistics ¶
func (s *TermvectorsService) TermStatistics(termStatistics bool) *TermvectorsService
TermStatistics specifies if total term frequency and document frequency should be returned.
func (*TermvectorsService) Type ¶
func (s *TermvectorsService) Type(typ string) *TermvectorsService
Type of the document.
func (*TermvectorsService) Validate ¶
func (s *TermvectorsService) Validate() error
Validate checks if the operation is valid.
func (*TermvectorsService) Version ¶
func (s *TermvectorsService) Version(version interface{}) *TermvectorsService
Version an explicit version number for concurrency control.
func (*TermvectorsService) VersionType ¶
func (s *TermvectorsService) VersionType(versionType string) *TermvectorsService
VersionType specifies a version type ("internal", "external", "external_gte", or "force").
type TopHitsAggregation ¶
type TopHitsAggregation struct {
// contains filtered or unexported fields
}
TopHitsAggregation keeps track of the most relevant document being aggregated. This aggregator is intended to be used as a sub aggregator, so that the top matching documents can be aggregated per bucket.
It can effectively be used to group result sets by certain fields via a bucket aggregator. One or more bucket aggregators determines by which properties a result set get sliced into.
func NewTopHitsAggregation ¶
func NewTopHitsAggregation() *TopHitsAggregation
func (*TopHitsAggregation) Explain ¶
func (a *TopHitsAggregation) Explain(explain bool) *TopHitsAggregation
func (*TopHitsAggregation) FetchSource ¶
func (a *TopHitsAggregation) FetchSource(fetchSource bool) *TopHitsAggregation
func (*TopHitsAggregation) FetchSourceContext ¶
func (a *TopHitsAggregation) FetchSourceContext(fetchSourceContext *FetchSourceContext) *TopHitsAggregation
func (*TopHitsAggregation) FieldDataField ¶
func (a *TopHitsAggregation) FieldDataField(fieldDataField string) *TopHitsAggregation
func (*TopHitsAggregation) FieldDataFields ¶
func (a *TopHitsAggregation) FieldDataFields(fieldDataFields ...string) *TopHitsAggregation
func (*TopHitsAggregation) From ¶
func (a *TopHitsAggregation) From(from int) *TopHitsAggregation
func (*TopHitsAggregation) Highlight ¶
func (a *TopHitsAggregation) Highlight(highlight *Highlight) *TopHitsAggregation
func (*TopHitsAggregation) Highlighter ¶
func (a *TopHitsAggregation) Highlighter() *Highlight
func (*TopHitsAggregation) NoFields ¶
func (a *TopHitsAggregation) NoFields() *TopHitsAggregation
func (*TopHitsAggregation) ScriptField ¶
func (a *TopHitsAggregation) ScriptField(scriptField *ScriptField) *TopHitsAggregation
func (*TopHitsAggregation) ScriptFields ¶
func (a *TopHitsAggregation) ScriptFields(scriptFields ...*ScriptField) *TopHitsAggregation
func (*TopHitsAggregation) Size ¶
func (a *TopHitsAggregation) Size(size int) *TopHitsAggregation
func (*TopHitsAggregation) Sort ¶
func (a *TopHitsAggregation) Sort(field string, ascending bool) *TopHitsAggregation
func (*TopHitsAggregation) SortBy ¶
func (a *TopHitsAggregation) SortBy(sorter ...Sorter) *TopHitsAggregation
func (*TopHitsAggregation) SortWithInfo ¶
func (a *TopHitsAggregation) SortWithInfo(info SortInfo) *TopHitsAggregation
func (*TopHitsAggregation) Source ¶
func (a *TopHitsAggregation) Source() (interface{}, error)
func (*TopHitsAggregation) TrackScores ¶
func (a *TopHitsAggregation) TrackScores(trackScores bool) *TopHitsAggregation
func (*TopHitsAggregation) Version ¶
func (a *TopHitsAggregation) Version(version bool) *TopHitsAggregation
type TypeQuery ¶
type TypeQuery struct {
// contains filtered or unexported fields
}
TypeQuery filters documents matching the provided document / mapping type.
For details, see: https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-type-query.html
func NewTypeQuery ¶
type UpdateResponse ¶
type UpdateResponse struct { Index string `json:"_index"` Type string `json:"_type"` Id string `json:"_id"` Version int `json:"_version"` Created bool `json:"created"` GetResult *GetResult `json:"get"` }
UpdateResponse is the result of updating a document in Elasticsearch.
type UpdateService ¶
type UpdateService struct {
// contains filtered or unexported fields
}
UpdateService updates a document in Elasticsearch. See http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/docs-update.html for details.
func NewUpdateService ¶
func NewUpdateService(client *Client) *UpdateService
NewUpdateService creates the service to update documents in Elasticsearch.
func (*UpdateService) ConsistencyLevel ¶
func (b *UpdateService) ConsistencyLevel(consistencyLevel string) *UpdateService
ConsistencyLevel is one of "one", "quorum", or "all". It sets the write consistency setting for the update operation.
func (*UpdateService) DetectNoop ¶
func (b *UpdateService) DetectNoop(detectNoop bool) *UpdateService
DetectNoop will instruct Elasticsearch to check if changes will occur when updating via Doc. It there aren't any changes, the request will turn into a no-op.
func (*UpdateService) Do ¶
func (b *UpdateService) Do() (*UpdateResponse, error)
Do executes the update operation.
func (*UpdateService) Doc ¶
func (b *UpdateService) Doc(doc interface{}) *UpdateService
Doc allows for updating a partial document.
func (*UpdateService) DocAsUpsert ¶
func (b *UpdateService) DocAsUpsert(docAsUpsert bool) *UpdateService
DocAsUpsert can be used to insert the document if it doesn't already exist.
func (*UpdateService) Fields ¶
func (b *UpdateService) Fields(fields ...string) *UpdateService
Fields is a list of fields to return in the response.
func (*UpdateService) Id ¶
func (b *UpdateService) Id(id string) *UpdateService
Id is the identifier of the document to update (required).
func (*UpdateService) Index ¶
func (b *UpdateService) Index(name string) *UpdateService
Index is the name of the Elasticsearch index (required).
func (*UpdateService) Parent ¶
func (b *UpdateService) Parent(parent string) *UpdateService
Parent sets the id of the parent document.
func (*UpdateService) Pretty ¶
func (b *UpdateService) Pretty(pretty bool) *UpdateService
Pretty instructs to return human readable, prettified JSON.
func (*UpdateService) Refresh ¶
func (b *UpdateService) Refresh(refresh bool) *UpdateService
Refresh the index after performing the update.
func (*UpdateService) ReplicationType ¶
func (b *UpdateService) ReplicationType(replicationType string) *UpdateService
ReplicationType is one of "sync" or "async".
func (*UpdateService) RetryOnConflict ¶
func (b *UpdateService) RetryOnConflict(retryOnConflict int) *UpdateService
RetryOnConflict specifies how many times the operation should be retried when a conflict occurs (default: 0).
func (*UpdateService) Routing ¶
func (b *UpdateService) Routing(routing string) *UpdateService
Routing specifies a specific routing value.
func (*UpdateService) Script ¶
func (b *UpdateService) Script(script *Script) *UpdateService
Script is the script definition.
func (*UpdateService) ScriptedUpsert ¶
func (b *UpdateService) ScriptedUpsert(scriptedUpsert bool) *UpdateService
ScriptedUpsert should be set to true if the referenced script (defined in Script or ScriptId) should be called to perform an insert. The default is false.
func (*UpdateService) Timeout ¶
func (b *UpdateService) Timeout(timeout string) *UpdateService
Timeout is an explicit timeout for the operation, e.g. "1000", "1s" or "500ms".
func (*UpdateService) Type ¶
func (b *UpdateService) Type(typ string) *UpdateService
Type is the type of the document (required).
func (*UpdateService) Upsert ¶
func (b *UpdateService) Upsert(doc interface{}) *UpdateService
Upsert can be used to index the document when it doesn't exist yet. Use this e.g. to initialize a document with a default value.
func (*UpdateService) Version ¶
func (b *UpdateService) Version(version int64) *UpdateService
Version defines the explicit version number for concurrency control.
func (*UpdateService) VersionType ¶
func (b *UpdateService) VersionType(versionType string) *UpdateService
VersionType is one of "internal" or "force".
type ValueCountAggregation ¶
type ValueCountAggregation struct {
// contains filtered or unexported fields
}
ValueCountAggregation is a single-value metrics aggregation that counts the number of values that are extracted from the aggregated documents. These values can be extracted either from specific fields in the documents, or be generated by a provided script. Typically, this aggregator will be used in conjunction with other single-value aggregations. For example, when computing the avg one might be interested in the number of values the average is computed over. See: http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/search-aggregations-metrics-valuecount-aggregation.html
func NewValueCountAggregation ¶
func NewValueCountAggregation() *ValueCountAggregation
func (*ValueCountAggregation) Field ¶
func (a *ValueCountAggregation) Field(field string) *ValueCountAggregation
func (*ValueCountAggregation) Format ¶
func (a *ValueCountAggregation) Format(format string) *ValueCountAggregation
func (*ValueCountAggregation) Meta ¶
func (a *ValueCountAggregation) Meta(metaData map[string]interface{}) *ValueCountAggregation
Meta sets the meta data to be included in the aggregation response.
func (*ValueCountAggregation) Script ¶
func (a *ValueCountAggregation) Script(script *Script) *ValueCountAggregation
func (*ValueCountAggregation) Source ¶
func (a *ValueCountAggregation) Source() (interface{}, error)
func (*ValueCountAggregation) SubAggregation ¶
func (a *ValueCountAggregation) SubAggregation(name string, subAggregation Aggregation) *ValueCountAggregation
type WeightFactorFunction ¶
type WeightFactorFunction struct {
// contains filtered or unexported fields
}
WeightFactorFunction builds a weight factor function that multiplies the weight to the score. See https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-function-score-query.html#_weight for details.
func NewWeightFactorFunction ¶
func NewWeightFactorFunction(weight float64) *WeightFactorFunction
NewWeightFactorFunction initializes and returns a new WeightFactorFunction.
func (*WeightFactorFunction) GetWeight ¶
func (fn *WeightFactorFunction) GetWeight() *float64
GetWeight returns the adjusted score. It is part of the ScoreFunction interface. Returns nil if weight is not specified.
func (*WeightFactorFunction) Name ¶
func (fn *WeightFactorFunction) Name() string
Name represents the JSON field name under which the output of Source needs to be serialized by FunctionScoreQuery (see FunctionScoreQuery.Source).
func (*WeightFactorFunction) Source ¶
func (fn *WeightFactorFunction) Source() (interface{}, error)
Source returns the serializable JSON data of this score function.
func (*WeightFactorFunction) Weight ¶
func (fn *WeightFactorFunction) Weight(weight float64) *WeightFactorFunction
Weight adjusts the score of the score function. See https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-function-score-query.html#_using_function_score for details.
type WildcardQuery ¶
type WildcardQuery struct {
// contains filtered or unexported fields
}
WildcardQuery matches documents that have fields matching a wildcard expression (not analyzed). Supported wildcards are *, which matches any character sequence (including the empty one), and ?, which matches any single character. Note this query can be slow, as it needs to iterate over many terms. In order to prevent extremely slow wildcard queries, a wildcard term should not start with one of the wildcards * or ?. The wildcard query maps to Lucene WildcardQuery.
For more details, see https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-wildcard-query.html
Example ¶
// Get a client to the local Elasticsearch instance. client, err := elastic.NewClient() if err != nil { // Handle error panic(err) } // Define wildcard query q := elastic.NewWildcardQuery("user", "oli*er?").Boost(1.2) searchResult, err := client.Search(). Index("twitter"). // search in index "twitter" Query(q). // use wildcard query defined above Do() // execute if err != nil { // Handle error panic(err) } _ = searchResult
Output:
func NewWildcardQuery ¶
func NewWildcardQuery(name, wildcard string) *WildcardQuery
NewWildcardQuery creates and initializes a new WildcardQuery.
func (*WildcardQuery) Boost ¶
func (q *WildcardQuery) Boost(boost float64) *WildcardQuery
Boost sets the boost for this query.
func (*WildcardQuery) QueryName ¶
func (q *WildcardQuery) QueryName(queryName string) *WildcardQuery
QueryName sets the name of this query.
func (*WildcardQuery) Rewrite ¶
func (q *WildcardQuery) Rewrite(rewrite string) *WildcardQuery
func (*WildcardQuery) Source ¶
func (q *WildcardQuery) Source() (interface{}, error)
Source returns the JSON serializable body of this query.
Source Files ¶
- bulk.go
- bulk_delete_request.go
- bulk_index_request.go
- bulk_request.go
- bulk_update_request.go
- canonicalize.go
- clear_scroll.go
- client.go
- cluster_health.go
- cluster_state.go
- cluster_stats.go
- connection.go
- count.go
- decoder.go
- delete.go
- delete_by_query.go
- delete_template.go
- doc.go
- errors.go
- exists.go
- explain.go
- fetch_source_context.go
- geo_point.go
- get.go
- get_mapping.go
- get_template.go
- highlight.go
- index.go
- indices_close.go
- indices_create.go
- indices_delete.go
- indices_delete_template.go
- indices_exists.go
- indices_exists_template.go
- indices_exists_type.go
- indices_flush.go
- indices_forcemerge.go
- indices_get.go
- indices_get_aliases.go
- indices_get_settings.go
- indices_get_template.go
- indices_open.go
- indices_put_alias.go
- indices_put_mapping.go
- indices_put_template.go
- indices_refresh.go
- indices_stats.go
- inner_hit.go
- mget.go
- msearch.go
- nodes_info.go
- optimize.go
- percolate.go
- ping.go
- plugins.go
- query.go
- reindexer.go
- request.go
- rescore.go
- rescorer.go
- response.go
- scan.go
- script.go
- scroll.go
- search.go
- search_aggs.go
- search_aggs_bucket_children.go
- search_aggs_bucket_date_histogram.go
- search_aggs_bucket_date_range.go
- search_aggs_bucket_filter.go
- search_aggs_bucket_filters.go
- search_aggs_bucket_geo_distance.go
- search_aggs_bucket_global.go
- search_aggs_bucket_histogram.go
- search_aggs_bucket_missing.go
- search_aggs_bucket_nested.go
- search_aggs_bucket_range.go
- search_aggs_bucket_significant_terms.go
- search_aggs_bucket_terms.go
- search_aggs_metrics_avg.go
- search_aggs_metrics_cardinality.go
- search_aggs_metrics_extended_stats.go
- search_aggs_metrics_geo_bounds.go
- search_aggs_metrics_max.go
- search_aggs_metrics_min.go
- search_aggs_metrics_percentile_ranks.go
- search_aggs_metrics_percentiles.go
- search_aggs_metrics_stats.go
- search_aggs_metrics_sum.go
- search_aggs_metrics_top_hits.go
- search_aggs_metrics_value_count.go
- search_aggs_pipeline_avg_bucket.go
- search_aggs_pipeline_bucket_script.go
- search_aggs_pipeline_bucket_selector.go
- search_aggs_pipeline_cumulative_sum.go
- search_aggs_pipeline_derivative.go
- search_aggs_pipeline_max_bucket.go
- search_aggs_pipeline_min_bucket.go
- search_aggs_pipeline_mov_avg.go
- search_aggs_pipeline_serial_diff.go
- search_aggs_pipeline_sum_bucket.go
- search_queries_bool.go
- search_queries_boosting.go
- search_queries_common_terms.go
- search_queries_constant_score.go
- search_queries_dis_max.go
- search_queries_exists.go
- search_queries_fsq.go
- search_queries_fsq_score_funcs.go
- search_queries_fuzzy.go
- search_queries_geo_bounding_box.go
- search_queries_geo_distance.go
- search_queries_geo_polygon.go
- search_queries_has_child.go
- search_queries_has_parent.go
- search_queries_ids.go
- search_queries_indices.go
- search_queries_match.go
- search_queries_match_all.go
- search_queries_missing.go
- search_queries_more_like_this.go
- search_queries_multi_match.go
- search_queries_nested.go
- search_queries_not.go
- search_queries_prefix.go
- search_queries_query_string.go
- search_queries_range.go
- search_queries_regexp.go
- search_queries_script.go
- search_queries_simple_query_string.go
- search_queries_template_query.go
- search_queries_term.go
- search_queries_terms.go
- search_queries_type.go
- search_queries_wildcard.go
- search_request.go
- search_source.go
- search_template.go
- sort.go
- suggest.go
- suggest_field.go
- suggester.go
- suggester_completion.go
- suggester_completion_fuzzy.go
- suggester_context.go
- suggester_context_category.go
- suggester_context_geo.go
- suggester_phrase.go
- suggester_term.go
- termvectors.go
- update.go
Directories ¶
Path | Synopsis |
---|---|
Package uritemplates is a level 4 implementation of RFC 6570 (URI Template, http://tools.ietf.org/html/rfc6570).
|
Package uritemplates is a level 4 implementation of RFC 6570 (URI Template, http://tools.ietf.org/html/rfc6570). |