Commit Graph

7501 Commits

Author SHA1 Message Date
uboness 9d0fc76f54 Added support for sorting buckets based on sub aggregations
Supports sorting on sub-aggs down the current hierarchy. This is supported as long as the aggregation in the specified order path are of a single-bucket type, where the last aggregation in the path points to either a single-bucket aggregation or a metrics one. If it's a single-bucket aggregation, the sort will be applied on the document count in the bucket (i.e. doc_count), and if it is a metrics type, the sort will be applied on the pointed out metric (in case of a single-metric aggregations, such as avg, the sort will be applied on the single metric value)

 NOTE: this commit adds a constraint on what should be considered a valid aggregation name. Aggregations names must be alpha-numeric and may contain '-' and '_'.

 Closes #5253
2014-03-06 00:05:27 +01:00
Igor Motov b723ee0d20 [DOCS] Update boolean mapping docs with a full list of values that are treated as false
Closes #5337
2014-03-05 15:33:59 -05:00
Shay Banon 941ffe0bf9 if there is no master node id, make sure not to fail the cat call, and report x 2014-03-05 17:56:27 +00:00
Clinton Gormley 98ecf80f07 [DOCS] Formatting error
Closes #5346
2014-03-05 17:40:51 +01:00
Lee Hinman 60f5cf55f3 Fix issue where circuit breaker was always reset to 80% upon startup 2014-03-05 07:32:17 -07:00
Kevin 2c7a3a49c5 [DOCS] add Elasticsearch Image Plugin 2014-03-05 14:16:56 +01:00
Shay Banon 992747a159 Force merges to not happen when indexing a doc / flush
Today, even though our merge policy doesn't return new merge specs on SEGMENT_FLUSH, merge on the scheduler is still called on flush time, and can cause merges to stall indexing during merges. Both for the concurrent merge scheduler (the default) and the serial merge scheduler. This behavior become worse when throttling kicks in (today at 20mb per sec).

In order to solve it (outside of Lucene for now), we wrap the merge scheduler with an EnableMergeScheduler, where, on the thread level, using a thread local, the call to merge can be enabled/disabled.

A Merges helper class is added where all explicit merges operations should go through. If the scheduler is the enabled one, it will enable merges before calling the relevant explicit method call. In order to make sure Merges is the only class that calls the explicit merge calls, the IW variant of them is added to the forbidden APIs list.

closes #5319
2014-03-05 12:26:26 +00:00
Lee Hinman 23471cd72c Implement custom circuit breaker estimator for parent/child field data 2014-03-04 10:52:19 -07:00
Lee Hinman 2bcede168c check for null term in PagedBytesEstimator.bytesPerValue()
Fixes #5326
2014-03-04 10:18:13 -07:00
Holger Hoffstätte 9c7032c427 Rewrite BytesStreamOutput on top of BigArrays/ByteArray.
Fix for #5159
2014-03-04 14:51:26 +01:00
Adrien Grand 5ae1236857 Fix `metric` impl on unmapped fields. 2014-03-04 11:13:38 +01:00
Adrien Grand 610694446a Fix NPE/AIOOBE when building a bucket which has not been collected.
Close #5048
2014-03-04 09:55:21 +01:00
Adrien Grand 66b589d58e Added unit tests for terms and histogram sorting on sub aggregations that return NaN. 2014-03-04 09:46:13 +01:00
Nils Dijk 0e57915536 Fix sorting of NaN values in terms aggregations.
Closes #5236.
2014-03-04 09:45:53 +01:00
Adrien Grand 5008b04cf4 Terms aggs: only use ordinals on low-cardinality fields by default.
Close #5303
2014-03-04 09:38:20 +01:00
Binh Ly 612e95a321 [DOCS] Java API JSON typo 2014-03-03 18:20:49 -05:00
Adrien Grand 0230ecbeac Fix test bug: a too low compression level can make accuracy terrible. 2014-03-03 20:31:38 +01:00
Zachary Tong 7b16c5857d Percentiles aggregation.
A new metric aggregation that can compute approximate values of arbitrary
percentiles.

Close #5323
2014-03-03 18:06:14 +01:00
Martijn van Groningen dcb590398d [DOCS] Better document the limitation of nested objects. 2014-03-03 14:12:18 +01:00
javanna 7d3cd89207 [TEST] added support for replacing stashed values within objects and lists in our REST tests 2014-03-03 13:34:22 +01:00
Costin Leau 6e955e682b fix typo causing incorrect plugin properties lookup in jars
relates #5261
2014-03-02 21:31:23 +02:00
Costin Leau bf19dc699a fix incorrect array search in test (by sorting it first)
relates to #5621
2014-02-28 23:59:08 +02:00
Adrien Grand 2c5d77cde1 Reuse pages more agressively in BigArrays.
Pages are now going to be reused when the size of the array is greater than
${page_size}/2 (as opposed to ${page_size} currently).

Close #5299
2014-02-28 21:31:10 +01:00
Adrien Grand 5723603987 Prevent page-tracking checks from spreading across tests. 2014-02-28 21:31:10 +01:00
Adrien Grand 7af63700c9 Remove same-thread checks when recycling (see #5254). 2014-02-28 21:31:10 +01:00
Binh Ly 7e49848697 Clarify range aggregations 2014-02-28 14:38:57 -05:00
Lee Hinman f1f3aa3ac7 [TEST] skip explain reroute REST test until param substitution is implemented 2014-02-28 10:39:07 -07:00
Costin Leau e5e8e592d8 make test assertions relative in IsolatedPluginTests
relates to #5621
2014-02-28 19:11:53 +02:00
Clinton Gormley 53ce0e8e27 [DOCS] Fixed added[] tag version number 2014-02-28 15:29:43 +01:00
Costin Leau 95fa42b701 fix failing IsolatedPluginTests (change numNodes to 0)
(cherry picked from commit f26a369a78ade032df44fcf331f378644f74b9ea)
2014-02-28 16:21:11 +02:00
Zachary Tong 0b6c404c51 [TEST] Dynamically extract node ID for test 2014-02-28 08:41:01 -05:00
Zachary Tong 4fe69528d2 [TEST] Add version and master_node parameter to _cluster/state 2014-02-28 08:27:17 -05:00
Costin Leau a19b77484e Add plugin class space isolation
Each plugin is now loaded in its own classloader to prevent class
conflicts when loading different versions of the same library. It
 is enabled by default and is configurable through
 `plugins.isolation` settings .Additionally, each plugin can
change its own isolation through the `isolation` property in
`es-plugin.properties`- if not specified, the global setting in
ES applies.

Closes #5261
2014-02-28 15:05:20 +02:00
javanna 91f5be6816 [TEST] more assertAcked in SharedClusterShapshotRestoreTests 2014-02-28 12:54:10 +01:00
Martijn van Groningen 03f6f523b0 Added more trace and debug logging 2014-02-28 11:19:18 +01:00
Simon Willnauer a1f66daea9 Move ensureEstimatedStats() after index wiping to ensure everything is cleaned up once the index is removed 2014-02-27 23:11:43 +01:00
Adrien Grand a9592e5523 Add assertion to not forget to replace reflection with the new FilterAtomicReader.unwrap. 2014-02-27 22:41:40 +01:00
Adrien Grand f5306ef8c1 Update Eclipse configuration to Java 1.7. 2014-02-27 22:41:40 +01:00
Simon Willnauer 86bfa6ecdc Improve error reporting on breaker stats assertion 2014-02-27 22:39:39 +01:00
Lee Hinman 550c407994 Remove trace logging from testBreakerWithRandomExceptions() 2014-02-27 13:24:11 -07:00
Lee Hinman e53a43800e Add `explain` flag support to the reroute API
By specifying the `explain` flag, an explanation for the reason a
command can or cannot be executed is returned. No allocation commands
are actually performed.

Returns a response similar to:

{
  "state": {...cluster state...},
  "acknowledged": true,
  "explanations" : [ {
    "command" : "cancel",
      "parameters" : {
        "index" : "decide",
        "shard" : 0,
        "node" : "IvpoKRdtRiGrQ_WKtt4_4w",
        "allow_primary" : false
      },
      "decisions" : [ {
        "decider" : "cancel_allocation_command",
        "decision" : "YES",
        "explanation" : "..."
        } ]
     }, {
      "command" : "move",
      "parameters" : {
        "index" : "decide",
        "shard" : 0,
        "from_node" : "IvpoKRdtRiGrQ_WKtt4_4w",
        "to_node" : "IvpoKRdtRiGrQ_WKtt4_4w"
       },
       "decisions" : [ {
         "decider" : "same_shard",
         "decision" : "NO",
         "explanation" : "shard cannot be allocated on same node [IvpoKRdtRiGrQ_WKtt4_4w] it already exists on"
       },
       etc
       ]
  }]
}

also removes AllocationExplanation from cluster state

Closes #2483
Closes #5169
2014-02-27 09:48:51 -07:00
Simon Willnauer 8ceb98752d Move master to Java 1.7
Closes #5267
2014-02-27 15:12:02 +01:00
Simon Willnauer fe9de7fba2 Use FieldMapper to create the low level term queries in CommonTermQuery
Closes #5258
2014-02-27 14:50:42 +01:00
Adrien Grand 3839454168 Add tracking of allocated arrays.
The BigArrays utility class is useful to generate arrays of various sizes: when
small, arrays will be allocated directly on the heap while larger arrays are
going to be paged and to recycle pages through PageCacheRecycler. We already
have tracking for pages but this is not triggered very often since it only
happens on large amounts of data while our tests work on small amounts of data
in order to be fast.

Tracking arrays directly helps make sure that we never forget to release them.

This pull request also improves testing by:

 - putting random content in the arrays upon release: this makes sure that
   consumers don't use these arrays anymore when they are released as their
   content may be subject to use for another purpose since pages are recycled

 - putting random content in the arrays upon creation and resize when
   `clearOnResize` is `false`.

The major difference with `master` is that the `BigArrays` class is now
instanciable, injected via Guice and usually available through the
`SearchContext`. This way, it can be mocked for tests.
2014-02-27 14:01:12 +01:00
Martijn van Groningen d167a0139a estimator#afterLoad should be invoked once only per reader.
It was being invoked once per reader and parent type combination resulting in more memory being reported to the circuit breaker than actually being used in field data.
2014-02-27 13:26:54 +01:00
Simon Willnauer aacc169007 Add RamUsageEstimator assertion to ElasticsearchIntegrationTest 2014-02-27 11:28:27 +01:00
Lee Hinman 9052838656 Enable trace logging for RandomExceptionCircuitBreakerTests.testBreakerWithRandomExceptions 2014-02-26 15:53:53 -07:00
Bill Hwang 7a48d079d3 Moved es download master url from JDK7 to JDK6 2014-02-26 14:18:44 -08:00
Adrien Grand e1634f66bb Improve `arc` geo-distance accuracy.
Close #5192
2014-02-26 22:21:10 +01:00
Simon Willnauer 9160516b28 Expose `filler_token` via ShingleTokenFilterFactory
Lucene 4.7 supports a setter for the `filler_token` that is
inserted if there are gaps in the token stream. This change exposes
this setting.

Closes #4307
2014-02-26 22:21:10 +01:00