summaryrefslogtreecommitdiff
path: root/core/src/test/java/org/elasticsearch/search/aggregations/bucket
AgeCommit message (Collapse)Author
2017-04-26[percolator] Fix memory leak when percolator uses bitset or field data cache.Martijn van Groningen
The percolator doesn't close the IndexReader of the memory index any more. Prior to 2.x the percolator had its own SearchContext (PercolatorContext) that did this, but that was removed when the percolator was refactored as part of the 5.0 release. I think an alternative way to fix this is to let percolator not use the bitset and fielddata caches, that way we prevent the memory leak. Closes #24108
2017-04-18[Test] Use appropriate DocValueFormats in Aggregations tests (#24155)Tanguy Leroux
Some aggregations (like Min, Max etc) use a wrong DocValueFormat in tests (like IP or GeoHash). We should not test aggregations that expect a numeric value with a DocValueFormat like IP. Such wrong DocValueFormat can also prevent the aggregation to be rendered as ToXContent, and this will be an issue for the High Level Rest Client tests which expect to be able to parse back aggregations.
2017-04-18Tests: Fixing typo in class name of InternalGlobalTestsChristoph Büscher
Renaming from InternalGlogbalTests -> InternalGlobalTests
2017-04-18Upgrade to a Lucene 7 snapshot (#24089)Adrien Grand
We want to upgrade to Lucene 7 ahead of time in order to be able to check whether it causes any trouble to Elasticsearch before Lucene 7.0 gets released. From a user perspective, the main benefit of this upgrade is the enhanced support for sparse fields, whose resource consumption is now function of the number of docs that have a value rather than the total number of docs in the index. Some notes about the change: - it includes the deprecation of the `disable_coord` parameter of the `bool` and `common_terms` queries: Lucene has removed support for coord factors - it includes the deprecation of the `index.similarity.base` expert setting, since it was only useful to configure coords and query norms, which have both been removed - two tests have been marked with `@AwaitsFix` because of #23966, which we intend to address after the merge
2017-04-18[TEST] Added unittests for InternalSamplerMartijn van Groningen
2017-04-12Add unit tests for NestedAggregator (#24054)Zachary Tong
Add unit tests for NestedAggregator, change class visibilities Relates to #22278
2017-04-11Removes version 2.x constants from Version (#24011)Colin Goodheart-Smithe
* Removes version 2.x constants from Version Closes #21887 * Addresses review comments
2017-04-10Move getProperty method out of MultiBucketsAggregation.Bucket interface (#23988)Luca Cavanna
The getProperty method is an internal method needed to run pipeline aggregations and retrieve info by path from the aggs tree. It is not needed in the MultiBucketsAggregation.Bucket interface, which is returned to users running aggregations from the transport client. The method is moved to the InternalMultiBucketAggregation class as that's where it belongs.
2017-04-07Move getProperty method out of Aggregation interface (#23949)Luca Cavanna
The `getProperty` method is an internal method needed to run pipeline aggregations and retrieve info by path from the aggs tree. It is not needed in the `Aggregation` interface, which is returned to users running aggregations from the transport client. The method is moved to the InternalAggregation class as that's where it belongs.
2017-04-05The `filter` and `significant_terms` aggregations should parse the `filter` ↵Adrien Grand
as a filter, not as a query. (#23797) This is important for some queries like `bool`, which are parsed differently depending on whether we want to get a query or a filter.
2017-04-04Rename random ASCII helper methodsJason Tedor
This commit renames the random ASCII helper methods in ESTestCase. This is because this method ultimately uses the random ASCII methods from randomized runner, but these methods actually only produce random strings generated from [a-zA-Z]. Relates #23886
2017-04-04Add unit tests for the missing aggregator (#23895)Jim Ferenczi
* Add unit tests for the missing aggregator Relates #22278
2017-04-03Adds tests for cardinality and filter aggregationsColin Goodheart-Smithe
Relates to #22278
2017-04-03Revert "Adds tests for cardinality and filter aggregations (#23826)"Colin Goodheart-Smithe
This reverts commit 058869ed549deb080522d873e3891425d377cc48.
2017-04-03Adds tests for cardinality and filter aggregations (#23826)Colin Goodheart-Smithe
* Adds tests for cardinality and filter aggregations Relates to #22278 * addresses review comments
2017-03-21Add unit tests for ReverseNestedAggregator (#23651)Christoph Büscher
Relates to #22278
2017-03-15Fix num docs to be positive in bucket deferring collector testRyan Ernst
2017-03-13Tests: fix GeoHashGridAggregatorTests expectations (#23556)Christoph Büscher
Currently GeoHashGridAggregatorTests#testWithSeveralDocs increases the expected document count per hash for each geo point added to a document. When points added to the same doc fall into one bucket (one hash cell) the document should only be counted once. Closes #23555
2017-03-12[TEST] Added unit tests for diversified sampler aggregator.Martijn van Groningen
2017-03-02 Tests: Add unit test for SignificantLongTerms and SignificantStringTerms ↵Tanguy Leroux
(#23428) Relates to #22278
2017-03-01Tests InternalSingleBucketAggregation subclasses (#23388)Nik Everett
Adds a common base class for testing subclasses of `InternalSingleBucketAggregation`. They are so similar they call into question the utility of having all of these classes. We maybe could just use `InternalSingleBucketAggregation` in all those cases.... But for now, let's test the classes! Relates to #22278
2017-03-01 Tests: Add unit test for InternalDateHistogram (#23402)Tanguy Leroux
Relates to #22278
2017-03-01[TEST] Added unit tests for GeoHashGridAggregator and InternalGeoHashGridMartijn van Groningen
Part of #22278
2017-02-27Fixes terms error count for multiple reduce phasesColin Goodheart-Smithe
Previously when multiple reduces occured for the terms aggregation we would add up the errors for the aggregations but would not take into account the errors that had already been calculated for the previous reduce phases. This change corrects that by adding the previously created errors to the new error value. Closes #23286
2017-02-24Add unit tests for ParentToChildAggregator (#23305)Christoph Büscher
Adds unit tests for the `children` aggregation. This change also add the ability to mock Mapperservice in subtests of AggregatorTestCase.
2017-02-23Fix SamplerAggregatorTests to have stable and predictable docIdsSimon Willnauer
Closes #23315
2017-02-21Adds unit test for sampler aggregation (#23243)Nik Everett
* Adds unit test for sampler aggregation Relates to #22278
2017-02-21Expose `batched_reduce_size` via `_search` (#23288)Simon Willnauer
In #23253 we added an the ability to incrementally reduce search results. This change exposes the parameter to control the batch since and therefore the memory consumption of a large search request.
2017-02-21Remove closeAggNik Everett
2017-02-21First step towards incremental reduction of query responses (#23253)Simon Willnauer
Today all query results are buffered up until we received responses of all shards. This can hold on to a significant amount of memory if the number of shards is large. This commit adds a first step towards incrementally reducing aggregations results if a, per search request, configurable amount of responses are received. If enough query results have been received and buffered all so-far received aggregation responses will be reduced and released to be GCed.
2017-02-20Fix for IpRangeAggregatorTests#testRangesJim Ferenczi
Handle null from/to ranges. Closes #23272
2017-02-20Mark IP range aggregator test as awaits fixJason Tedor
This test reliably fails with the seed 4AC319F8A6B0329B.
2017-02-20Tests: Add unit test for InternalChildren (#23261)Christoph Büscher
Relates to #22278
2017-02-20Add unit tests for BinaryRangeAggregator/InternalBinaryRange (#23255)Jim Ferenczi
* Add unit tests for BinaryRangeAggregator/InternalBinaryRange Relates #22278
2017-02-17Adds unit test for sampler aggregationNik Everett
Relates to #22278
2017-02-17Enforce Content-Type requirement on the rest layer and remove deprecated ↵Jay Modi
methods (#23146) This commit enforces the requirement of Content-Type for the REST layer and removes the deprecated methods in transport requests and their usages. While doing this, it turns out that there are many places where *Entity classes are used from the apache http client libraries and many of these usages did not specify the content type. The methods that do not specify a content type explicitly have been added to forbidden apis to prevent more of these from entering our code base. Relates #19388
2017-02-17Add unit tests for terms aggregation objects. (#23149)Adrien Grand
Relates #22278
2017-02-14Detach SearchPhases from AbstractSearchAsyncAction (#23118)Simon Willnauer
Today all search phases are inner classes of AbstractSearchAsyncAction or one of it's subclasses. This makes unit testing of these classes practically impossible. This commit Extracts `DfsQueryPhase` and `FetchSearchPhase` or of the code that composes the actual query execution types and moves most of the fan-out and collect code into an `InitialSearchPhase` class that can be used to build initial search phases (phases that retry on shards). This will make modification to these classes simpler and allows to easily compose or add new search phases down the road if additional roundtrips are required.
2017-02-09Add parameter to prefix aggs name with type in search responses (#22965)Tanguy Leroux
This pull request adds a new parameter to the REST Search API named `typed_keys`. When set to true, the aggregation names in the search response will be prefixed with a prefix that reflects the internal type of the aggregation. Here is a simple example: ``` GET /_search?typed_keys { "aggs": { "tweets_per_user": { "terms": { "field": "user" } } }, "size": 0 } ``` And the response: ``` { "aggs": { "sterms:tweets_per_user": { ... } } } ``` This parameter is intended to make life easier for REST clients that could parse back the prefix and could detect the type of the aggregation to parse. It could also be implemented for suggesters.
2017-02-08Fold InternalSearchHits and friends into their interfaces (#23042)Simon Willnauer
We have a bunch of interfaces that have only a single implementation for 6 years now. These interfaces are pretty useless from a SW development perspective and only add unnecessary abstractions. They also require lots of casting in many places where we expect that there is only one concrete implementation. This change removes the interfaces, makes all of the classes final and removes the duplicate `foo` `getFoo` accessors in favor of `getFoo` from these classes.
2017-02-06Make dates be ReadableDateTimes in scripts (#22948)Nik Everett
Instead of longs. If you want millis since epoch you can call doc.date_field.value.millis. Relates to #22875
2017-02-06Add unit tests to histogram aggregations. (#22961)Adrien Grand
2017-02-06Remove QUERY_AND_FETCH search type (#22996)Simon Willnauer
`QUERY_AND_FETCH` has been treated as an internal optimization for 2 major versions. This commit removes the search type and it's implementation details and folds the optimization in the case of a single shard into the search controller such that every search with a single shard (non DFS) will receive this optimization.
2017-02-03Upgrade checkstyle to version 7.5Jason Tedor
This commit upgrades the checkstyle configuration from version 5.9 to version 7.5, the latest version as of today. The main enhancement obtained via this upgrade is better detection of redundant modifiers. Relates #22960
2017-02-02Optionally require a valid content type for all rest requests with content ↵Jay Modi
(#22691) This change adds a strict mode for xcontent parsing on the rest layer. The strict mode will be off by default for 5.x and in a separate commit will be enabled by default for 6.0. The strict mode, which can be enabled by setting `http.content_type.required: true` in 5.x, will require that all incoming rest requests have a valid and supported content type header before the request is dispatched. In the non-strict mode, the Content-Type header will be inspected and if it is not present or not valid, we will continue with auto detection of content like we have done previously. The content type header is parsed to the matching XContentType value with the only exception being for plain text requests. This value is then passed on with the content bytes so that we can reduce the number of places where we need to auto-detect the content type. As part of this, many transport requests and builders were updated to provide methods that accepted the XContentType along with the bytes and the methods that would rely on auto-detection have been deprecated. In the non-strict mode, deprecation warnings are issued whenever a request with body doesn't provide the Content-Type header. See #19388
2017-01-20New AdjacencyMatrix aggregationmarkharwood
Similar to the Filters aggregation but only supports "keyed" filter buckets and automatically "ANDs" pairs of filters to produce a form of adjacency matrix. The intersection of buckets "A" and "B" is named "A&B" (the choice of separator is configurable). Empty intersection buckets are removed from the final results. Closes #22169
2017-01-20Add unit tests for DateHistogramAggregator (#22714)Tanguy Leroux
Adds unit tests for the date histogram aggregator. Relates #22278
2017-01-19Fix incorrect args order passed to createAggregatorTim Brooks
This commit fixes a compile issue where the arguments are passed to createAggregator in the incorrect order.
2017-01-19Add unit tests for FiltersAggregator (#22678)Jim Ferenczi
Adds unit tests for the `filters` aggregation. This change also adds an helper to search and reduce any aggregator in a unit test. This is done by dividing a single searcher in sub-searcher, one for each segment. Relates #22278
2017-01-18Improve unit test coverage of aggs (#22668)Nik Everett
Add tests for `GlobalAggregator`, `MaxAggregator`, and `InternalMax`. Relates to #22278