Commit Graph

3287 Commits

Author SHA1 Message Date
Adrien Grand a78c7d9911 AggregatorBuilder and PipelineAggregatorBuilder do not need generics. #18368
Similar reasoning as #18133 but for the aggs API. One important change is that
I moved the base PipelineAggregatorBuilder class to the o.e.s.aggregations
package instead of o.e.s.aggregations.pipeline so that the create method does
not need to be public.
2016-06-01 10:19:30 +02:00
Jack Conradson b6e1429760 Merge branch 'master' into each 2016-05-31 09:36:04 -07:00
Robert Muir 2d1eb89aef improve date api for expressions/painless fields 2016-05-31 09:32:33 -04:00
Jack Conradson d1f4e2ef04 Merge branch 'master' into each 2016-05-30 16:22:14 -07:00
Simon Willnauer f74a78940c Improve phrase suggest test speed (#18633)
There is no reason to read the entire marvel hero file to test the features,
it might take several seconds to do so which is unnecessary.
This commit also splits SearchSuggestTests into core and modules/mustache 
also add @Nighlty to forbidden API to make sure we don't use it since they won't run in CI these days.
2016-05-30 17:22:03 +02:00
Robert Muir 7c77c62dbc Merge pull request #18621 from rmuir/java.time
add java.time packages to painless whitelist
2016-05-28 06:51:09 -04:00
Jack Conradson f5be0982d9 Added initial infrastructure to allow for each to be made. 2016-05-27 17:41:31 -07:00
Jack Conradson 2d8030f09f Added foreach in grammar. 2016-05-27 13:50:38 -07:00
Robert Muir aa53285448 add java.time packages to painless whitelist 2016-05-27 15:07:27 -04:00
Martijn van Groningen fbd3f8df2b percolator: Don't bail query term extraction when a must clause contains an unsupported query, if there is at least one other must clause in a boolean query that can be extracted. 2016-05-27 19:57:50 +02:00
Jason Tedor 41710f1028 Upgrade joda-time to 2.9.4
This commit upgrades joda-time to version 2.9.4 to integrate a bug fix
there into Elasticsearch.

Relates #18609
2016-05-27 08:51:19 -04:00
Robert Muir 3f06d9f3b8 Merge pull request #18600 from rmuir/new_script_exception
replace ScriptException with a better one
2016-05-26 17:51:34 -04:00
Jack Conradson cde83e363a Add an update script equivalent test. 2016-05-26 13:16:22 -07:00
Robert Muir f037807117 replace ScriptException with a better one 2016-05-26 11:43:29 -04:00
Jack Conradson f1ccc88f75 Merge pull request #18578 from jdconrad/ref
Add Function Reference Stub to Painless
2016-05-26 08:32:10 -07:00
Tal Levy edfbdf2748 add ability to specify multiple grok patterns (#18074)
- now you can specify a list of grok patterns to match your field with
and the first one to successfully match wins.
- only non-null captures will be inserted into your matched document.

Fixes #17903.
2016-05-25 12:20:39 -07:00
Jack Conradson eefcafd831 Add method reference stub to Painless. 2016-05-25 10:34:21 -07:00
Ryan Ernst a916830ab4 Merge pull request #18560 from rjernst/score_tests
Tests: Make painless score tests unit tests
2016-05-25 08:44:13 -07:00
Tanguy Leroux bdee8c2632 Disable XContent auto closing of object and arrays 2016-05-25 16:46:09 +02:00
Tanguy Leroux bf41ac8bf2 Makes DeleteByQueryRequest implements CompositeIndicesRequest 2016-05-25 09:36:07 +02:00
Ryan Ernst 82ae65bbb5 Tests: Make score tests unit tests
This change simply removes the need for single node tests from score
tests.
2016-05-24 19:53:50 -07:00
Nik Everett 5e81270509 Add retry test case for delete-by-query
Tests that we retry failed searches, scrolls, and bulks.
2016-05-24 12:02:55 -04:00
Martijn van Groningen 27cc2fe4dc Moved the percolator from core to its own module
Significant changes:
* AbstractQueryTestCase has moved to the test framework module, in order for query builder tests in modules and plugins
* Added support to AbstractQueryTestCase to register plugins
* Lift the restriction that only one percolator could be added per index. This validation existed in MapperService, but because the percolator moved to a module it could no longer exist there. Instead of bringing it back it was removed. This validation existed since the percolator cache only supported one percolator query per document, since the percolator cache has been removed this restriction could removed as well.
* While moving percolator tests to the new module, also removed a couple of tests for the deprecated percolate and mpercolate api. These APIs are now sugar  APIs for bwc and rediect to the searvh and msearvh APIs. Some tests were still testing as if percolate and mpercolate API did the percolation, but this no longer the case and these tests could be removed.
2016-05-24 11:01:57 +02:00
Robert Muir a5d0ccf50b painless: add trap tests 2016-05-23 23:36:40 -04:00
Robert Muir 0a9c036c3e Merge branch 'master' into painless_more_whitelisting 2016-05-23 20:35:44 -04:00
Ryan Ernst f6074d383b Merge pull request #18532 from rjernst/less_assert_busy
Tests: Remove unnecessary Callable variant of assertBusy
2016-05-23 17:11:54 -07:00
Jack Conradson 1424f09c02 Remove Painless grammar ambiguities.
Closes #18531
2016-05-23 16:39:52 -07:00
Robert Muir a56a9cb818 improve painless whitelist coverage of java api 2016-05-23 19:35:28 -04:00
Ryan Ernst c7b45b2cc7 Tests: Remove unnecessary Callable variant of assertBusy
The assertBusy method currently has both a Runnable and Callable
version. This has caused confusion with type inference and lambdas
sometimes, in particular with java 9. This change removes the callable
version as nothing was actually using it.
2016-05-23 16:17:43 -07:00
Nik Everett 62ac719a94 Rerwite RetryTests to very carefully block the executors
This reproduces every time. No more randomness! Hurray!
2016-05-23 14:38:40 -04:00
Nik Everett b7817a6306 [reindex] Retry the retry test if it didn't cause retries
The retry test has failed a couple of times in CI because it wasn't able
to cause any retries. Putting it in a bash `while` loop shows that it
eventually does fail that way. The seed "4F6477A9C999CA20" seems especially
good at failing to get retries. It doesn't fail all the time, but more
than most.

This adds a retry to each test case, retrying a maximum of 10 times or
until it causes the retries. I've seen it fail to get retries 7 times
in a row but not go beyond that. Retrying doesn't seem to really hurt
the test runtime all that much. Most of the time is in the startup
cost.

Failing CI build that triggered this:
https://elasticsearch-ci.elastic.co/job/elastic+elasticsearch+master+periodic/852/console
2016-05-23 14:38:40 -04:00
Adrien Grand 459916f5dd Remove custom Base64 implementation. #18413
This replaces o.e.common.Base64 with java.util.Base64.
2016-05-23 11:32:42 +02:00
Tanguy Leroux b0b503035a Update reindex cancel tests 2016-05-23 10:31:14 +02:00
Ryan Ernst 37d36f2f4c Merge branch 'master' into java9 2016-05-21 14:19:58 -07:00
Ryan Ernst 1d40c4bbc1 Make java9 work again
This change makes ES compile with java9 again, build 118.
* There are a handful of changes due to failure to determine types during compile.
* The attachment plugins which use tika needed to have tika upgraded in order to pickup fixes there for java 9.
* azure discovery and s3 repository indirectly depend on jaxb, which is no longer in the default modules. They now add a jaxb dependency externally, and make JarHell allow for this package.
2016-05-21 09:41:51 -07:00
Lee Hinman fdfd2a2f18 Remove ScriptMode class in favor of boolean true/false
This removes the ScriptMode class entirely, which was an enum with two
options (ON and OFF) which essentially boiled down to true and false.
Now the boolean values are used instead.
2016-05-20 15:01:30 -06:00
Robert Muir a2ff002e2b Merge pull request #18463 from rmuir/whitelist_cleanup
painless: steps at definition cleanup
2016-05-20 14:26:41 -04:00
Jack Conradson b156438957 Proxy box method to use valueOf. 2016-05-20 11:22:18 -07:00
Jack Conradson 0e24ed49e6 Use the build-in valueOf method instead of the custom one. 2016-05-20 11:13:43 -07:00
Jack Conradson d836194095 Fixed tests and added a comment to the box method. 2016-05-20 11:04:09 -07:00
Jack Conradson 2b793c1e06 Fix boxing. 2016-05-20 10:38:06 -07:00
Robert Muir c0eb813e10 Merge branch 'clean' into whitelist_cleanup 2016-05-20 10:59:13 -04:00
Robert Muir ce9b36590a simplify tree node use of compiler settings 2016-05-20 09:36:09 -04:00
Martijn van Groningen 80fee8666f percolator: Removed percolator cache
Before 5.0 for it was required that the percolator queries were cached in jvm heap as Lucene queries for two reasons:
1) Performance. The percolator evaluated all percolator queries all the time. There was no pre-selecting queries that are likely to match like we have today.
2) Updates made to percolator queries were visible in realtime, Today these changes are visible in near realtime. So updating no longer requires the percolator to have the queries in jvm heap.

So having the percolator queries in jvm heap via the percolator cache is now less attractive. Especially when there are many percolator queries then these queries can consume many GBs of jvm heap.
Removing the percolator cache does make the percolate query slower compared to how the execution time in 5.0.0-alpha1 and alpha2, but it is still faster compared to 2.x and before.
2016-05-20 14:52:16 +02:00
Robert Muir b3c71c1e3a improve style for these constants 2016-05-20 08:42:29 -04:00
Uwe Schindler 7bc91c00d9 More elegant way to force class initialization 2016-05-20 14:12:15 +02:00
Uwe Schindler 6205f79554 Remove Definitions's copy-ctor; fix RuntimeClass to be unmodifiable
Please note: The maps inside the pirvate singleton instance of Defininition are no longer unmodifiable, but nothing from the outside can modify it! All private :-)
2016-05-20 14:03:46 +02:00
Uwe Schindler 4ffa92c7c1 Remove the Definition instance passed around everywhere 2016-05-20 12:35:08 +02:00
Uwe Schindler 91f4bba042 Make Definition's public API completely static.
TODO: Remove Definition arguments everywhere and hide INSTANCE field!
2016-05-20 11:22:03 +02:00
Uwe Schindler f5fc60ac67 Add utility type constant 2016-05-20 11:05:40 +02:00
Jack Conradson 4e454439bb Fixed bugs in comparison with Def. Fixed may tests.n 2016-05-20 02:04:38 -07:00
Uwe Schindler 87ab39613d more constants 2016-05-20 10:56:50 +02:00
Uwe Schindler 82aed08301 Restore constants as static final (first step) 2016-05-20 10:48:41 +02:00
Jack Conradson 64e2ef5807 Removed transforms. No user-facing boxing. 2016-05-19 23:38:14 -07:00
Jack Conradson 3381f50e07 Merge branch 'master' into clean 2016-05-19 18:52:10 -07:00
Jack Conradson 3962553551 Removed user-facing boxing. 2016-05-19 18:51:55 -07:00
Uwe Schindler cfe555d216 move unused @SuppressWarnings one level up 2016-05-20 00:46:05 +02:00
Nik Everett 223cb6a7f0 [reindex] Mark test awaits fix because it is unstable
Fix coming.
2016-05-19 18:03:36 -04:00
Robert Muir afa9ebad28 dce 2016-05-19 16:03:11 -04:00
Robert Muir 0ee726ed0d nuke eclipse warnings 2016-05-19 15:35:26 -04:00
Robert Muir a569130368 fix typo 2016-05-19 15:28:59 -04:00
Robert Muir b9c7dbcfbd nuke overflow detection as we cannot guarantee for def. simplify life :) 2016-05-19 15:25:31 -04:00
Tanguy Leroux a01ecb20ea Port Delete By Query to Reindex infrastructure
closes #16883
2016-05-19 16:07:50 +02:00
Robert Muir 915ab16176 First steps at whitelist cleanup 2016-05-19 09:29:48 -04:00
Ali Beyad fc6df23fea Rename AggregatorBuilder and all of its subclasses to
AggregationBuilder, in keeping consistent with the Java APIs.

Closes #18377
Closes #18367
2016-05-19 09:25:29 -04:00
Robert Muir 1022123f59 Merge pull request #18400 from uschindler/painless_java9StringConcats
Use Java 9 Indy String Concats, if available
2016-05-18 08:00:20 -04:00
Uwe Schindler ea9026e6d8 painless: fix checkstyle 2016-05-18 00:31:12 +02:00
Uwe Schindler b418d01117 painless: Improve string concat tests; add state machine check after MethodWriter 2016-05-18 00:26:47 +02:00
Jack Conradson 3042a77d2b Merge pull request #18425 from jdconrad/cast
Made def variable casting consistent with invokedynamic rules
2016-05-17 13:29:49 -07:00
Jack Conradson f055ad641a Made def variable casting consistent with invokedynamic rules. 2016-05-17 13:16:49 -07:00
polyfractal 978c1e3e36 [TEST] Add missing sort processor to test
Also fixes the naming of the sort REST test
to follow the numbering convention
2016-05-17 14:52:17 -04:00
Nik Everett cfb06954ba [reindex] Add assertBusy to test
It has timing issues.
2016-05-17 14:05:35 -04:00
Nik Everett fe4823eae0 Reindex should retry on search failures
This uses the same backoff policy we use for bulk and just retries until
the request isn't rejected.

Instead of `{"retries": 12}` in the response to count retries this now
looks like `{"retries": {"bulk": 12", "search": 1}`.

Closes #18059
2016-05-17 13:58:45 -04:00
Uwe Schindler b27b0483d5 Merge branch 'master' into painless_java9StringConcats
# Conflicts:
#	modules/lang-painless/src/test/java/org/elasticsearch/painless/StringTests.java
2016-05-17 18:47:33 +02:00
Uwe Schindler 5622e9c9d3 painless: use Java 9 Indy String Concats, if available 2016-05-17 17:44:46 +02:00
Robert Muir fa5f099486 make semicolons only optional at the end 2016-05-17 10:55:40 -04:00
Robert Muir 92339c4763 painless: add method overloading based on arity
Closes #18385

Squashed commit of the following:

commit b2819df4d392d69b86e5c96d358eb03424e67e02
Author: Robert Muir <rmuir@apache.org>
Date:   Tue May 17 09:15:47 2016 -0400

    add note about tuple

commit 85fcac6a0d0674da24535121eab23e2c407d683f
Author: Robert Muir <rmuir@apache.org>
Date:   Mon May 16 23:39:25 2016 -0400

    painless: add method overloading based on arity
2016-05-17 09:17:43 -04:00
Uwe Schindler 75f27df376 painless: Refactor WriterUtils to extends ASM GeneratorAdapter as "MethodWriter" for easy usage (and more coming later) 2016-05-17 02:25:05 +02:00
Jack Conradson 3fd3d367ef Moved ADefLink to be a marker interface instead. 2016-05-16 15:48:29 -07:00
Jack Conradson 3f23186712 Merge branch 'master' into types 2016-05-16 14:22:59 -07:00
Jack Conradson 95a1b5b2a3 Fixed a casting bug in Painless. 2016-05-16 14:18:05 -07:00
Robert Muir e69305ae21 Merge pull request #18372 from rmuir/painless_whitelist_expansion
painless whitelist expansion
2016-05-16 17:08:49 -04:00
Robert Muir 8d4c1befe5 Merge pull request #18364 from rmuir/nukeRunAsFloat
Remove LeafSearchScript.runAsFloat(): Nothing calls it.
2016-05-16 17:08:25 -04:00
Jack Conradson 1d394868d4 Merge branch 'master' into types 2016-05-16 12:43:24 -07:00
Jack Conradson 43344eee82 Add more def tests including checking bytecode for specific
optimizations.
2016-05-16 12:42:25 -07:00
Jack Conradson f664fa5f33 Merge pull request #18350 from uschindler/painless_isAssignableFrom
Use isAssignableFrom instead of relying on ClassCastException
2016-05-16 12:41:09 -07:00
Jack Conradson a2c2628a78 Merge pull request #18359 from uschindler/painless_removeStoreBoxing
Remove boxing when loading and storing values in "def" fields/arrays, remove boxing onsimple method calls of "def" methods
2016-05-16 12:11:37 -07:00
Uwe Schindler d6cbbdeb98 painless: Some reformatting in EChain to make it clear if "this" or inner "expression" is affected 2016-05-16 21:04:03 +02:00
Uwe Schindler b05ac87a5d painless: Add Jack's test 2016-05-16 20:37:51 +02:00
Uwe Schindler 3a5ef68ad0 painless: Fix issue with dup and cast 2016-05-16 20:31:27 +02:00
Robert Muir 6ac2877c32 Merge pull request #18371 from uschindler/painless_debuggerCleanup
painless: Small cleanup of Debugger class to use StringWriter
2016-05-16 09:58:50 -04:00
Robert Muir 2fc7ca46e1 expand whitelist for basic types 2016-05-16 09:56:29 -04:00
Uwe Schindler 07e4f416e6 painless: Small cleanup of Debugger class to use StringWriter 2016-05-16 15:52:14 +02:00
Nik Everett f569576c5b Switch default batch size for reindex to 1000 2016-05-16 08:19:29 -04:00
Robert Muir 8edf213492 Remove LeafSearchScript.runAsFloat(): Nothing calls it. 2016-05-15 22:59:28 -04:00
Uwe Schindler 65aca4f71c painless: make compound statement like a[1]++ work with def. There was also a bug with the size of LDefArray: fixed 2016-05-15 23:00:32 +02:00
Uwe Schindler d221cd14d2 painless: Also remove boxing for reads and method calls 2016-05-15 19:49:25 +02:00
Uwe Schindler 604bcd9320 painless: Make field stores not box; use GeneratorAdapter.invokeDynmaic for consistency with other method calls 2016-05-15 18:31:53 +02:00
Uwe Schindler 8195ef9e7a painless: Transform more try-catch-ClassCastException to isAssignableFrom 2016-05-15 01:06:29 +02:00
Uwe Schindler 7211017813 painless: Some cleanups 2016-05-14 17:23:29 +02:00
Uwe Schindler c78bf8c867 painless: Use isAssignableFrom instead of relying on ClassCastException 2016-05-14 16:04:18 +02:00
Uwe Schindler c8bd521ed3 painless: restore accidentally removed test 2016-05-14 12:00:30 +02:00
Uwe Schindler ba9dae820a Add test for wrong array index 2016-05-13 23:22:41 +02:00
Uwe Schindler 1a76329d89 Take return type from "after" field. 2016-05-13 23:17:22 +02:00
Uwe Schindler 1b10a14e8d painless: build descriptor of array and field load/store in code; fix array index to adapt type not DEF 2016-05-13 23:04:04 +02:00
Robert Muir 2028691e66 painless: improve exception stacktraces
closes #18319
2016-05-13 15:40:45 -04:00
Uwe Schindler 9731d5d314 painless: Rename the dynamic call site factory to DefBootstrap and make the inner class very short (PIC = Polymorphic Inline Cache) 2016-05-13 19:58:05 +02:00
Lee Hinman 9bcdafedda Allow only a single extension for a scripting engine
Previously multiple extensions could be provided, however, this can lead
to confusion with on-disk scripts (ie, "foo.js" and "foo.javascript")
having different content. Only a single extension is now supported.

The only language currently supporting multiple extensions was the
Javascript engine ("js" and "javascript"). It now only supports the
`.js` extension.

Relates to #10598
2016-05-13 09:54:31 -06:00
Lee Hinman d5b75491dc Merge remote-tracking branch 'dakrone/remove-script-sandbox' 2016-05-13 09:50:39 -06:00
Nik Everett 0a300320cd [test] Set logging to 11 on reindex test
It has failures we can't explain and we need logs to be able to do
anything useful with the failures:
https://elasticsearch-ci.elastic.co/job/elastic+elasticsearch+master+g1gc/359/consoleFull
2016-05-13 11:48:01 -04:00
Lee Hinman efff3918d8 Remove support for mulitple languages per scripting engine 2016-05-13 09:24:31 -06:00
Lee Hinman a4060f7436 Remove vestiges of script engine sandboxing
This removes all the mentions of the sandbox from the script engine
services and permissions model. This means that the following settings
are no longer supported:

```yaml
script.inline: sandbox
script.stored: sandbox
```

Instead, only a `true` or `false` value can be specified.

Since this would otherwise break the default-allow parameter for
languages like expressions, painless, and mustache, all script engines
have been updated to have individual settings, for instance:

```yaml
script.engine.groovy.inline: true
```

Would enable all inline scripts for groovy. (they can still be
overridden on a per-operation basis).

Expressions, Painless, and Mustache all default to `true` for inline,
file, and stored scripts to preserve the old scripting behavior.

Resolves #17114
2016-05-13 09:24:31 -06:00
Adrien Grand 638da06c1d Add back support for `ip` range aggregations. #17859
This commit adds support for range aggregations on `ip` fields. However it will
only work on 5.x indices.

Closes #17700
2016-05-13 17:22:01 +02:00
Robert Muir 520697eb14 Merge pull request #18323 from uschindler/dynamiccallsite_cleanup
painless: cleanup of DynamicCallSite
2016-05-13 11:19:27 -04:00
Uwe Schindler a1d0fb5008 painless: cleanup of DynamicCallSite to have all implementation encapsulated in inner class, outer class only has bootstrap method 2016-05-13 15:50:55 +02:00
Daniel Mitterdorfer ddbfda2c68 Exclude specific transport actions from request size limit check
We add support to explicitly exclude specific transport actions
from the request size limit check.

We also exclude the following request types currently:

*MasterPingRequest
* PingRequest
2016-05-13 14:21:24 +02:00
Jack Conradson 2e25837deb Made line number available in painless nodes for debugging. 2016-05-12 10:32:06 -07:00
Jack Conradson 28164ccf2e Decouple the ANTLR AST from Painless.
Closes #18286
2016-05-12 00:46:48 -07:00
Robert Muir 113e239e0f Merge pull request #18288 from rmuir/painless_debug
painless: add debugging tool to tests
2016-05-12 01:16:32 -04:00
Jack Conradson 8871fddba7 Merge pull request #18282 from jdconrad/longs
Long priority over Float
2016-05-11 21:08:28 -07:00
Robert Muir 930a215b5c add debugger 2016-05-11 23:56:19 -04:00
Robert Muir 25dd64250b painless: remove input, support params instead 2016-05-11 21:32:10 -04:00
Robert Muir c5532d3df0 add a rest test for this that seems to work, fix the documentation. thanks @s1monw 2016-05-11 16:07:08 -04:00
Robert Muir 6b4e47bf96 this makes aggregations per-document _value fast (bypass hash put, hash get, etc) for painless.
but i have no clue how to test it, it seems this feature never worked via REST?

Should we drop the feature instead?
2016-05-11 15:39:00 -04:00
Jack Conradson 20af482dd7 Removed extra branches. Only check for long first where we already know the
second type.
2016-05-11 10:22:40 -07:00
Jack Conradson 2764b47d22 Give long priority over float in Def math calcs. Promotion of types
still works correclty.
2016-05-11 09:32:30 -07:00
Robert Muir d790c76636 painless: _score as double, not float 2016-05-11 11:19:18 -04:00
Tanguy Leroux 6d288dec11 Clean up tests in Reindex module 2016-05-11 09:54:52 +02:00
Robert Muir 7689a1af28 Add 'ctx' keyword to painless. 2016-05-11 02:31:19 -04:00
Jack Conradson d8b373cac6 Fixed an issue related to bracket shortcuts. 2016-05-10 23:11:13 -07:00
Robert Muir 632bb4c720 add reserved word tests for 'doc', too 2016-05-11 00:17:19 -04:00
Robert Muir 389ef462c4 special access to doc 2016-05-10 23:43:57 -04:00
Robert Muir abb015bcb9 add tests for reserved words. ban stores against _score 2016-05-10 22:55:06 -04:00
Robert Muir a63285aaf9 painless: retrieve _score directly from Scorer 2016-05-10 20:53:08 -04:00
Robert Muir 1d80542199 Merge pull request #18247 from rmuir/needsScore
painless: implement needsScore() correctly.
2016-05-10 19:21:09 -04:00
Robert Muir ddc2c1f682 Merge pull request #18234 from rmuir/more_indy_type_data
painless: use better typing for dynamic method calls
2016-05-10 19:17:13 -04:00
Robert Muir 1c2d3b10ef some cleanups suggested by @uschindler and break some long lines 2016-05-10 12:31:02 -04:00
Robert Muir eb1b2cf111 add test and cleanup 2016-05-10 11:34:33 -04:00
Robert Muir 7a47d33a9b Merge branch 'master' into needsScore 2016-05-10 11:23:50 -04:00
Robert Muir 546aed8390 hack 2016-05-10 11:23:24 -04:00
Uwe Schindler 243c9e77fa painless: Add synthetic length property as alias to Lists, so they can really be used like arrays 2016-05-10 15:01:49 +02:00
Uwe Schindler 2e613f49b3 painless: Array load/store and length with invokedynamic 2016-05-10 12:41:27 +02:00
Robert Muir 3aeb66885b painless: use better typing for dynamic method calls 2016-05-10 05:44:16 -04:00
Robert Muir ba2fe156e8 Switch over dynamic method calls, loads and stores to invokedynamic.
Remove performance hack for accessing a document's fields, its not needed.
Add support for accessing is-getter methods like List.isEmpty() as .empty

Closes #18201
2016-05-09 21:44:32 -04:00
Tanguy Leroux 8c52e8814b Remove ReindexResponse in favor of BulkIndexByScrollResponse 2016-05-09 17:03:16 +02:00
Chris Earle 5be79ed02c Add Failure Details to every NodesResponse
Most of the current implementations of BaseNodesResponse (plural Nodes) ignore FailedNodeExceptions.

- This adds a helper function to do the grouping to TransportNodesAction
- Requires a non-null array of FailedNodeExceptions within the BaseNodesResponse constructor
- Reads/writes the array to output
- Also adds StreamInput and StreamOutput methods for generically reading and writing arrays
2016-05-06 14:59:43 -04:00
Adrien Grand 7d8708716e QueryBuilder does not need generics. #18133
QueryBuilder has generics, but those are never used: all call sites use
`QueryBuilder<?>`. Only `AbstractQueryBuilder` needs generics so that the base
class can contain a default implementation for setters that returns `this`.
2016-05-06 08:38:20 +02:00
Robert Muir e3ce6c9048 Painless: add fielddata accessors (.value/.values/.distance()/etc)
This gives better coverage and consistency with the scripting APIs, by
whitelisting the primary search scripting API classes and using them instead
of only Map and List methods.

For example, accessing fields can now be done with `.value` instead of `.0`
because `getValue()` is whitelisted. For now, access to a document's fields in
this way (loads) are fast-pathed in the code, to avoid dynamic overhead.

Access to geo fields and geo distance functions is now supported.

TODO: date support (e.g. whitelist ReadableDateTime methods as a start)
TODO: improve docs (like expressions and groovy have for document's fields)
TODO: remove fast-path hack

Closes #18169

Squashed commit of the following:

commit ec9f24b2424891a7429bb4c0a03f9868cba0a213
Author: Robert Muir <rmuir@apache.org>
Date:   Thu May 5 17:59:37 2016 -0400

    cutover to <Def> instead of <Object> here

commit 9edb1550438acd209733bc36f0d2e0aecf190ecb
Author: Robert Muir <rmuir@apache.org>
Date:   Thu May 5 17:03:02 2016 -0400

    add fast-path for docvalues field loads

commit f8e38c0932fccc0cfa217516130ad61522e59fe5
Author: Robert Muir <rmuir@apache.org>
Date:   Thu May 5 16:47:31 2016 -0400

    Painless: add fielddata accessors (.value/.values/.distance()/etc)
2016-05-05 18:38:41 -04:00
Jack Conradson 2cae575f53 Added single-quoted strings.
Closes #18150
2016-05-05 09:26:02 -07:00
Robert Muir 59c135b58d make internal Def methods private and add basic javadocs 2016-05-05 03:47:56 -04:00