diff options
author | Christopher Speller <crspeller@gmail.com> | 2018-01-29 14:17:40 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-01-29 14:17:40 -0800 |
commit | 961c04cae992eadb42d286d2f85f8a675bdc68c8 (patch) | |
tree | 3408f2d06f847e966c53485e2d54c692cdd037c1 /vendor/gopkg.in/olivere/elastic.v5/search_aggs_pipeline_test.go | |
parent | 8d66523ba7d9a77129844be476732ebfd5272d64 (diff) | |
download | chat-961c04cae992eadb42d286d2f85f8a675bdc68c8.tar.gz chat-961c04cae992eadb42d286d2f85f8a675bdc68c8.tar.bz2 chat-961c04cae992eadb42d286d2f85f8a675bdc68c8.zip |
Upgrading server dependancies (#8154)
Diffstat (limited to 'vendor/gopkg.in/olivere/elastic.v5/search_aggs_pipeline_test.go')
-rw-r--r-- | vendor/gopkg.in/olivere/elastic.v5/search_aggs_pipeline_test.go | 143 |
1 files changed, 22 insertions, 121 deletions
diff --git a/vendor/gopkg.in/olivere/elastic.v5/search_aggs_pipeline_test.go b/vendor/gopkg.in/olivere/elastic.v5/search_aggs_pipeline_test.go index 058257774..24dd4eb0f 100644 --- a/vendor/gopkg.in/olivere/elastic.v5/search_aggs_pipeline_test.go +++ b/vendor/gopkg.in/olivere/elastic.v5/search_aggs_pipeline_test.go @@ -13,20 +13,10 @@ func TestAggsIntegrationAvgBucket(t *testing.T) { //client := setupTestClientAndCreateIndexAndAddDocs(t, SetTraceLog(log.New(os.Stdout, "", log.LstdFlags))) client := setupTestClientAndCreateIndexAndAddDocs(t) - esversion, err := client.ElasticsearchVersion(DefaultURL) - if err != nil { - t.Fatal(err) - } - - if esversion < "2.0" { - t.Skipf("Elasticsearch %s does not have pipeline aggregations.", esversion) - return - } - // Match all should return all documents builder := client.Search(). - Index(testIndexName). - Type("order"). + Index(testOrderIndex). + Type("doc"). Query(NewMatchAllQuery()). Pretty(true) h := NewDateHistogramAggregation().Field("time").Interval("month") @@ -66,20 +56,10 @@ func TestAggsIntegrationDerivative(t *testing.T) { //client := setupTestClientAndCreateIndexAndAddDocs(t, SetTraceLog(log.New(os.Stdout, "", log.LstdFlags))) client := setupTestClientAndCreateIndexAndAddDocs(t) - esversion, err := client.ElasticsearchVersion(DefaultURL) - if err != nil { - t.Fatal(err) - } - - if esversion < "2.0" { - t.Skipf("Elasticsearch %s does not have pipeline aggregations.", esversion) - return - } - // Match all should return all documents builder := client.Search(). - Index(testIndexName). - Type("order"). + Index(testOrderIndex). + Type("doc"). Query(NewMatchAllQuery()). Pretty(true) h := NewDateHistogramAggregation().Field("time").Interval("month") @@ -207,20 +187,10 @@ func TestAggsIntegrationMaxBucket(t *testing.T) { //client := setupTestClientAndCreateIndexAndAddDocs(t, SetTraceLog(log.New(os.Stdout, "", log.LstdFlags))) client := setupTestClientAndCreateIndexAndAddDocs(t) - esversion, err := client.ElasticsearchVersion(DefaultURL) - if err != nil { - t.Fatal(err) - } - - if esversion < "2.0" { - t.Skipf("Elasticsearch %s does not have pipeline aggregations.", esversion) - return - } - // Match all should return all documents builder := client.Search(). - Index(testIndexName). - Type("order"). + Index(testOrderIndex). + Type("doc"). Query(NewMatchAllQuery()). Pretty(true) h := NewDateHistogramAggregation().Field("time").Interval("month") @@ -266,20 +236,10 @@ func TestAggsIntegrationMinBucket(t *testing.T) { //client := setupTestClientAndCreateIndexAndAddDocs(t, SetTraceLog(log.New(os.Stdout, "", log.LstdFlags))) client := setupTestClientAndCreateIndexAndAddDocs(t) - esversion, err := client.ElasticsearchVersion(DefaultURL) - if err != nil { - t.Fatal(err) - } - - if esversion < "2.0" { - t.Skipf("Elasticsearch %s does not have pipeline aggregations.", esversion) - return - } - // Match all should return all documents builder := client.Search(). - Index(testIndexName). - Type("order"). + Index(testOrderIndex). + Type("doc"). Query(NewMatchAllQuery()). Pretty(true) h := NewDateHistogramAggregation().Field("time").Interval("month") @@ -325,20 +285,10 @@ func TestAggsIntegrationSumBucket(t *testing.T) { //client := setupTestClientAndCreateIndexAndAddDocs(t, SetTraceLog(log.New(os.Stdout, "", log.LstdFlags))) client := setupTestClientAndCreateIndexAndAddDocs(t) - esversion, err := client.ElasticsearchVersion(DefaultURL) - if err != nil { - t.Fatal(err) - } - - if esversion < "2.0" { - t.Skipf("Elasticsearch %s does not have pipeline aggregations.", esversion) - return - } - // Match all should return all documents builder := client.Search(). - Index(testIndexName). - Type("order"). + Index(testOrderIndex). + Type("doc"). Query(NewMatchAllQuery()). Pretty(true) h := NewDateHistogramAggregation().Field("time").Interval("month") @@ -378,20 +328,10 @@ func TestAggsIntegrationMovAvg(t *testing.T) { //client := setupTestClientAndCreateIndexAndAddDocs(t, SetTraceLog(log.New(os.Stdout, "", log.LstdFlags))) client := setupTestClientAndCreateIndexAndAddDocs(t) - esversion, err := client.ElasticsearchVersion(DefaultURL) - if err != nil { - t.Fatal(err) - } - - if esversion < "2.0" { - t.Skipf("Elasticsearch %s does not have pipeline aggregations.", esversion) - return - } - // Match all should return all documents builder := client.Search(). - Index(testIndexName). - Type("order"). + Index(testOrderIndex). + Type("doc"). Query(NewMatchAllQuery()). Pretty(true) h := NewDateHistogramAggregation().Field("time").Interval("month") @@ -500,20 +440,10 @@ func TestAggsIntegrationCumulativeSum(t *testing.T) { //client := setupTestClientAndCreateIndexAndAddDocs(t, SetTraceLog(log.New(os.Stdout, "", log.LstdFlags))) client := setupTestClientAndCreateIndexAndAddDocs(t) - esversion, err := client.ElasticsearchVersion(DefaultURL) - if err != nil { - t.Fatal(err) - } - - if esversion < "2.0" { - t.Skipf("Elasticsearch %s does not have pipeline aggregations.", esversion) - return - } - // Match all should return all documents builder := client.Search(). - Index(testIndexName). - Type("order"). + Index(testOrderIndex). + Type("doc"). Query(NewMatchAllQuery()). Pretty(true) h := NewDateHistogramAggregation().Field("time").Interval("month") @@ -650,22 +580,13 @@ func TestAggsIntegrationCumulativeSum(t *testing.T) { } func TestAggsIntegrationBucketScript(t *testing.T) { - client := setupTestClientAndCreateIndexAndAddDocs(t) //, SetTraceLog(log.New(os.Stdout, "", log.LstdFlags))) - - esversion, err := client.ElasticsearchVersion(DefaultURL) - if err != nil { - t.Fatal(err) - } - - if esversion < "2.0" { - t.Skipf("Elasticsearch %s does not have pipeline aggregations.", esversion) - return - } + // client := setupTestClientAndCreateIndexAndAddDocs(t, SetTraceLog(log.New(os.Stdout, "", log.LstdFlags))) + client := setupTestClientAndCreateIndexAndAddDocs(t) // Match all should return all documents builder := client.Search(). - Index(testIndexName). - Type("order"). + Index(testOrderIndex). + Type("doc"). Query(NewMatchAllQuery()). Pretty(true) h := NewDateHistogramAggregation().Field("time").Interval("month") @@ -810,20 +731,10 @@ func TestAggsIntegrationBucketSelector(t *testing.T) { //client := setupTestClientAndCreateIndexAndAddDocs(t, SetTraceLog(log.New(os.Stdout, "", log.LstdFlags))) client := setupTestClientAndCreateIndexAndAddDocs(t) - esversion, err := client.ElasticsearchVersion(DefaultURL) - if err != nil { - t.Fatal(err) - } - - if esversion < "2.0" { - t.Skipf("Elasticsearch %s does not have pipeline aggregations.", esversion) - return - } - // Match all should return all documents builder := client.Search(). - Index(testIndexName). - Type("order"). + Index(testOrderIndex). + Type("doc"). Query(NewMatchAllQuery()). Pretty(true) h := NewDateHistogramAggregation().Field("time").Interval("month") @@ -870,20 +781,10 @@ func TestAggsIntegrationSerialDiff(t *testing.T) { //client := setupTestClientAndCreateIndexAndAddDocs(t, SetTraceLog(log.New(os.Stdout, "", log.LstdFlags))) client := setupTestClientAndCreateIndexAndAddDocs(t) - esversion, err := client.ElasticsearchVersion(DefaultURL) - if err != nil { - t.Fatal(err) - } - - if esversion < "2.0" { - t.Skipf("Elasticsearch %s does not have pipeline aggregations.", esversion) - return - } - // Match all should return all documents builder := client.Search(). - Index(testIndexName). - Type("order"). + Index(testOrderIndex). + Type("doc"). Query(NewMatchAllQuery()). Pretty(true) h := NewDateHistogramAggregation().Field("time").Interval("month") |