summaryrefslogtreecommitdiff
path: root/core/src/main/java/org/elasticsearch/search
AgeCommit message (Collapse)Author
2017-05-20Scripting: Simplify search method on script service (#24817)Ryan Ernst
This commit is a simple cleanup to remove an unnecessary extra method on ScriptService which was only used in 3 places. There is now only one search method.
2017-05-19Merge branch 'master' into feature/client_aggs_parsingjavanna
2017-05-19Mark SearchSourceBuilder as ToXContentObject (#24795)Luca Cavanna
SearchSourceBuilder#toXContent prints out a complete object, hence it should implement ToXContentObject
2017-05-19Removes parent child fielddata specialization (#24737)Jim Ferenczi
This change removes the field data specialization needed for the parent field and replaces it with a simple DocValuesIndexFieldData. The underlying global ordinals are retrieved via a new function called IndexOrdinalsFieldData#getOrdinalMap. The children aggregation is also modified to use a simple WithOrdinals value source rather than the deleted WithOrdinals.Parent. Relates #20257
2017-05-19Remove compareTerm() method in parsed Significant Terms aggregationsTanguy Leroux
This method has been removed in core (see #24714)
2017-05-19Merge remote-tracking branch 'origin/master' into feature/client_aggs_parsingTanguy Leroux
2017-05-19Remove //norelease and cleans up somet aggregations tests (#24789)Tanguy Leroux
2017-05-18Remove the unused SignificantTerms.compareTerm() method (#24714)Tanguy Leroux
This method is not used and not tested. While it exists it forces implementations of the interface to implement it while it's unused.
2017-05-18DateHistogram: Fix 'extended_bounds' with 'offset' (#23789)Christoph Büscher
This fixes a bug in the 'date_histogram' aggregation that can happen when using 'extended_bounds' together with some 'offset' parameter. Offsets should be applied after rounding the extended bounds and also be applied when adding empty buckets during the reduce phase in InternalDateHistogram. Closes #23776
2017-05-18Merge remote-tracking branch 'origin/master' into feature/client_aggs_parsingTanguy Leroux
2017-05-18Fix checkstyle violation in ParsedScriptedMetricTanguy Leroux
2017-05-18Add parsing method for Top Hits aggregation (#24717)Tanguy Leroux
Related to #23331
2017-05-18Add parsing method for binary range aggregation (#24706)Tanguy Leroux
Related to #23331
2017-05-17Add fromXContent method to SearchResponse (#24720)Luca Cavanna
SearchResponse#fromXContent allows to parse a search response, including search hits, aggregations, suggestions and profile results. Only the aggs that we can parse today are supported (which means all of them but a couple that are left to support). SearchResponseTests reuses the existing test infra to randomize aggregations, suggestions and profile response. Relates to #23331
2017-05-17Allow SearchOperationListeners to validate a search context (#24650)Jay Modi
This commit adds a new method to the SearchOperationListener that allows implementers to validate the SearchContext immediately after it is retrieved from the active contexts. The listener may throw a runtime exception if it deems the SearchContext is not valid and that the use of the context should be terminated.
2017-05-17Add parsing for InternalScriptedMetric aggregation (#24738)Christoph Büscher
2017-05-17Merge branch 'master' into feature/client_aggs_parsingjavanna
2017-05-17Fix Version based BWC and set correct minCompatVersion (#24732)Simon Willnauer
Approaching the release of 6.0 we need to sort out the usage of `Version#minimumCompatibilityVersion` which was still set to 5.0.0. Now this change moves it to the latest released version of 5.x (5.4 at this point) to ensure we are compatible with the latest minor of the previous major. This change also removes all the `_UNRELEASED` from the versions that where released and drops versions that were never released and are not expected to be released (bugfixes in minors that are not the latest in the previous major).
2017-05-17Fix ArrayIndexOutOfBoundsException when no ranges are specified in the query ↵George Papadrosou
(#23241) * Fix ArrayIndexOutOfBoundsException in Range Aggregation when no ranges are specified in the query * Revert "Fix ArrayIndexOutOfBoundsException in Range Aggregation when no ranges are specified in the query" This reverts commit ad57d8feb3577a64b37de28c6f3df96a3a49fe93. * Fix range aggregation out of bounds exception when there are no ranges in a range or date_range query * Fix range aggregation out of bounds exception when there are no ranges in the query This fix is applied to range queries, date range queries, ip range queries and geo distance aggregation queries
2017-05-16Remove script access to term statistics (#19462)Ryan Ernst
In scripts (at least some of the languages), the terms dictionary and postings can be access with the special _index variable. This is for very advanced use cases which want to do their own scoring. The problem is segment level statistics must be recomputed for every document. Additionally, this is not friendly to the terms index caching as the order of looking up terms should be controlled by lucene. This change removes _index from scripts. Anyone using it can and should instead write a Similarity plugin, which is explicitly designed to allow doing the calculations needed for a relevance score. closes #19359
2017-05-16Add parsing to Significant Terms aggregations (#24682)Tanguy Leroux
Related to #23331
2017-05-16Add parsing for InternalAdjacencyMatrix aggregation (#24700)Christoph Büscher
2017-05-16Merge branch 'master' into feature/client_aggs_parsingChristoph Büscher
2017-05-16[Tests] Add unit test for InternalAdjecencyMatrix aggregation (#24698)Christoph Büscher
Adding a unit test to InternalAdjecencyMatrix that extends the shared InternalAggregationTestCase that we use for testing aggregations. Relates to #22278
2017-05-16Scripting: Deprecate index lookup (#24691)Ryan Ernst
This commit adds a deprecation warning if `_index` is used in scripts. It is emitted each time a script is invoked, but not per document. There is no test because constructing a LeafIndexLookup is quite difficult, but the deprecation warning does show up in IndexLookupIT, there is just no way to assert warnings in integ tests. relates #19359
2017-05-15Scripts: Convert template script engines to return String instead of ↵Ryan Ernst
BytesReference (#24447) Template script engines (mustache, the only one) currently return a BytesReference that users must know is utf8 encoded. This commit modifies all callers and mustache to have the template engine return String. This is much simpler, and does not require decoding in order to use (for example, in ingest).
2017-05-15Merge remote-tracking branch 'origin/master' into feature/client_aggs_parsingTanguy Leroux
2017-05-15 Share XContent rendering code in significant terms aggregations (#24677)Tanguy Leroux
The rendering methods in String and Long Significant String aggregations and buckets are very similar. They can be factored out in the InternalSignificantTerms class an InternalMappedSignificantTerms class.
2017-05-15Add parsing for InternalFilters aggregation (#24648)Christoph Büscher
This adds parsing to the InternalFilters aggregation.
2017-05-15Make SignificantTerms.Bucket an interface rather than an abstract class (#24670)Tanguy Leroux
This commit changes SignificantTerms.Bucket so that it is not an abstract class anymore but an interface. It will be easier for the Java High Level Rest Client to provide its own implementation of SignificantTerms and SignificantTerms.Bucket. Also, it is now more coherent with the others aggregations.
2017-05-15Merge branch 'master' into feature/client_aggs_parsingChristoph Büscher
Conflicts: core/src/test/java/org/elasticsearch/search/aggregations/bucket/filter/InternalFilterTests.java core/src/test/java/org/elasticsearch/search/aggregations/bucket/global/InternalGlobalTests.java core/src/test/java/org/elasticsearch/search/aggregations/bucket/missing/InternalMissingTests.java core/src/test/java/org/elasticsearch/search/aggregations/bucket/nested/InternalNestedTests.java core/src/test/java/org/elasticsearch/search/aggregations/bucket/nested/InternalReverseNestedTests.java core/src/test/java/org/elasticsearch/search/aggregations/bucket/sampler/InternalSamplerTests.java modules/parent-join/src/test/java/org/elasticsearch/join/aggregations/InternalChildrenTests.java test/framework/src/main/java/org/elasticsearch/search/aggregations/InternalSingleBucketAggregationTestCase.java
2017-05-15Revert changing the InternalSampler type constant (#24667)Christoph Büscher
2017-05-15Replace manual copying an array or collection with static methods calls (#24657)Koen De Groote
2017-05-12Add parsing methods to Range aggregations (#24583)Tanguy Leroux
2017-05-12Size lists in advance when knownKoen De Groote
When constructing an array list, if we know the size of the list in advance (because we are adding objects to it derived from another list), we should size the array list to the appropriate capacity in advance (to avoid resizing allocations). This commit does this in various places. Relates #24439
2017-05-12Add parent-join module (#24638)Jim Ferenczi
* Add parent-join module This change adds a new module named `parent-join`. The goal of this module is to provide a replacement for the `_parent` field but as a first step this change only moves the `has_child`, `has_parent` queries and the `children` aggregation to this module. These queries and aggregations are no longer in core but they are deployed by default as a module. Relates #20257
2017-05-12Add parsing method to GeoHashGrid aggregation (#24589)Tanguy Leroux
2017-05-12Merge branch 'master' into feature/client_aggs_parsingChristoph Büscher
2017-05-12[Tests] Add unit tests for InternalFilters (#24624)Christoph Büscher
Relates to #22278
2017-05-12Merge branch 'master' into feature/client_aggs_parsingChristoph Büscher
Conflicts: core/src/test/java/org/elasticsearch/search/aggregations/bucket/histogram/InternalHistogramTests.java core/src/test/java/org/elasticsearch/search/aggregations/bucket/terms/DoubleTermsTests.java core/src/test/java/org/elasticsearch/search/aggregations/bucket/terms/LongTermsTests.java core/src/test/java/org/elasticsearch/search/aggregations/bucket/terms/StringTermsTests.java
2017-05-11Make a few class level fields staticKoen De Groote
This commit converts some final constant instance fields to class fields.
2017-05-11Compound order for histogram aggregations. (#22343)qwerty4030
This commit adds support for histogram and date_histogram agg compound order by refactoring and reusing terms agg order code. The major change is that the Terms.Order and Histogram.Order classes have been replaced/refactored into a new class BucketOrder. This is a breaking change for the Java Transport API. For backward compatibility with previous ES versions the (date)histogram compound order will use the first order. Also the _term and _time aggregation order keys have been deprecated; replaced by _key. Relates to #20003: now that all these aggregations use the same order code, it should be easier to move validation to parse time (as a follow up PR). Relates to #14771: histogram and date_histogram aggregation order will now be validated at reduce time. Closes #23613: if a single BucketOrder that is not a tie-breaker is added with the Java Transport API, it will be converted into a CompoundOrder with a tie-breaker.
2017-05-11Add parsing for single bucket aggregations (#24564)Christoph Büscher
This adds parsing to all implementations of SingleBucketAggregations. They are mostly similar, so they share the common base class `ParsedSingleBucketAggregation` and the shared base test `InternalSingleBucketAggregationTestCase`.
2017-05-11inner_hits: Reuse inner hit query weightMartijn van Groningen
Previously query weight was created for each search hit that needed to compute inner hits, with this change the weight of the inner hit query is computed once for all search hits. Closes #23917
2017-05-10Fix merging conflictsTanguy Leroux
2017-05-10Merge remote-tracking branch 'origin/master' into feature/client_aggs_parsingTanguy Leroux
# Conflicts: # core/src/test/java/org/elasticsearch/search/aggregations/bucket/terms/InternalTermsTestCase.java # core/src/test/java/org/elasticsearch/search/aggregations/metrics/InternalExtendedStatsTests.java # core/src/test/java/org/elasticsearch/search/aggregations/metrics/InternalMaxTests.java # core/src/test/java/org/elasticsearch/search/aggregations/metrics/InternalStatsTests.java # core/src/test/java/org/elasticsearch/search/aggregations/metrics/avg/InternalAvgTests.java # core/src/test/java/org/elasticsearch/search/aggregations/metrics/cardinality/InternalCardinalityTests.java # core/src/test/java/org/elasticsearch/search/aggregations/metrics/geobounds/InternalGeoBoundsTests.java # core/src/test/java/org/elasticsearch/search/aggregations/metrics/geocentroid/InternalGeoCentroidTests.java # core/src/test/java/org/elasticsearch/search/aggregations/metrics/min/InternalMinTests.java # core/src/test/java/org/elasticsearch/search/aggregations/metrics/percentiles/InternalPercentilesTestCase.java # core/src/test/java/org/elasticsearch/search/aggregations/metrics/percentiles/hdr/InternalHDRPercentilesRanksTests.java # core/src/test/java/org/elasticsearch/search/aggregations/metrics/percentiles/tdigest/InternalTDigestPercentilesRanksTests.java # core/src/test/java/org/elasticsearch/search/aggregations/metrics/sum/InternalSumTests.java # core/src/test/java/org/elasticsearch/search/aggregations/metrics/valuecount/InternalValueCountTests.java # core/src/test/java/org/elasticsearch/search/aggregations/pipeline/InternalSimpleValueTests.java # core/src/test/java/org/elasticsearch/search/aggregations/pipeline/bucketmetrics/percentile/InternalPercentilesBucketTests.java # core/src/test/java/org/elasticsearch/search/aggregations/pipeline/derivative/InternalDerivativeTests.java # test/framework/src/main/java/org/elasticsearch/test/InternalAggregationTestCase.java
2017-05-10[Test] Add unit tests for Range aggregations (#24569)Tanguy Leroux
Related to #22278
2017-05-10Fix checkstyle violationTanguy Leroux
2017-05-10Add parsing for String/Long/Double Terms aggregations (#24521)Tanguy Leroux
2017-05-09[TEST] Add test for Aggregations#fromXContent (#24524)Luca Cavanna
AggregationsTests#testFromXContent verifies that parsing of aggregations works by combining multiple aggs at the same level, and also adding sub-aggregations to multi bucket and single bucket aggs, up to a maximum depth of 5.