Commit Graph

26914 Commits

Author SHA1 Message Date
Adrien Grand a969dad43e Integrate IndexOrDocValuesQuery. (#23119)
This gives Lucene the choice to use index/point-based queries or
doc-values-based queries depending on which one is more efficient. This commit
integrates this feature for:
 - long/integer/short/byte/double/float/half_float/scaled_float ranges,
 - date ranges,
 - geo bounding box queries,
 - geo distance queries.
2017-02-14 15:57:12 +01:00
Jun Ohtani 12bbe6e660 Merge pull request #23161 from johtani/support_keyword_to_analyze_api
[Analyze]Support Keyword type in Analyze API
2017-02-14 23:22:32 +09:00
Christoph Büscher abc8cd6c5f Remove unused sourceAsBytes field in SearchHit 2017-02-14 14:08:38 +01:00
Boaz Leskes 70a3ac1767 Add a note about `cluster.routing.allocation.node_concurrent_recoveries` (#23160)
Closes #23152
2017-02-14 14:14:41 +02:00
Simon Willnauer aef0665ddb Detach SearchPhases from AbstractSearchAsyncAction (#23118)
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-14 12:34:25 +01:00
Christoph Büscher 5b459a0bdc [Tests] increase minimal field name when creating random objects
I encountered several cases of duplicate field names when generating random
fields using the RandomObjects helper. This leads to invalid json in some tests,
so increasing the minimum field name length to four to make this less likely to
happen.
2017-02-14 11:31:37 +01:00
Jun Ohtani 34ebb88650 [Analyze]Support Keyword type in Analyze API
Add comment and clarify
2017-02-14 17:56:36 +09:00
Jun Ohtani 4d823d69f4 [Analyze]Support Keyword type in Analyze API 2017-02-14 16:41:16 +09:00
Jason Tedor 5343b87502 Handle bad HTTP requests
When Netty decodes a bad HTTP request, it marks the decoder result on
the HTTP request as a failure, and reroutes the request to GET
/bad-request. This either leads to puzzling responses when a bad request
is sent to Elasticsearch (if an index named "bad-request" does not exist
then it produces an index not found exception and otherwise responds
with the index settings for the index named "bad-request"). This commit
addresses this by inspecting the decoder result on the HTTP request and
dispatching the request to a bad request handler preserving the initial
cause of the bad request and providing an error message to the client.

Relates #23153
2017-02-13 17:39:25 -05:00
Uwe Schindler 82613198fe Update to forbiddenapis 2.3 (improves Gradle configuration time) (#23154) 2017-02-13 14:30:08 -08:00
Jay Modi 61e383813d Make the version of the remote node accessible on a transport channel (#23019)
This commit adds a new method to the TransportChannel that provides access to the version of the
remote node that the response is being sent on and that the request came from. This is helpful
for serialization of data attached as headers.
2017-02-13 15:15:57 -05:00
Lee Hinman b42d47770c Fix total disk bytes returning negative value (#23093)
* Fix total disk bytes returning negative value

This adds a workaround for JDK-8162520 -
https://bugs.openjdk.java.net/browse/JDK-8162520

Some filesystems can be so large that they return a negative value for their
free/used/available disk bytes due to being larger than `Long.MAX_VALUE`.

This adds protection for our `FsProbe` implementation and adds a test that it
does the right thing.
2017-02-13 11:20:15 -07:00
jaymode d8d03f45c2
Fix communication with 5.3.0 nodes
This commit fixes communication with 5.3.0 nodes to send XContentType to these nodes since #22691 was backported to the
5.3 branch.
2017-02-13 13:15:51 -05:00
Loek van Gool 214a3536aa Update redirects.asciidoc (#23148) 2017-02-13 16:23:25 +01:00
Jason Tedor 9dff5e2af7 Properly encode location header
Today when trying to encode the location header to ASCII, we rely on the
Java URI API. This API requires a proper URI which blows up whenever the
URI contains, for example, a space (which can happen if the type, ID, or
routing contain a space). This commit addresses this issue by properly
encoding the URI. Additionally, we remove the need to create a URI
simplifying the code flow.

Relates #23133
2017-02-13 09:34:52 -05:00
Tanguy Leroux 072748cd67 [Tests] Fix msearch/typed_keys test
This test uses index_patterns which has been introduced in 6.0 and does not exist in 5.4.0, making the Bwc test fails. Instead of using index templates, it now uses explicitly create the required indices. Also, it fixes unmapped aggregations tests.
2017-02-13 13:39:11 +01:00
Giuseppe ecbeffcb1e Add note about min_score filtering efficiency (#23109)
* Add note about min_score filtering efficiency

* Reword to mention 'HAVING'

* Remove reference to HAVING
2017-02-13 12:15:01 +01:00
Adrien Grand f3509b8003 Consolify docs/reference/analysis/tokenfilters/pattern-capture-tokenfilter.asciidoc. (#23050) 2017-02-13 11:00:12 +01:00
Tanguy Leroux de94c1253a Expose WriteRequest.RefreshPolicy string representation (#23106)
This commit changes the RefreshPolicy enum so that string representation are exposed. This will help the high level rest client to simply use  refreshPolicy.getValue() to get the corresponding parameter value of a given refresh policy.
2017-02-13 10:49:46 +01:00
Boaz Leskes 95eafe07f6 back wards tests should run against 5.4.0-SNAP 2017-02-13 10:54:08 +02:00
Boaz Leskes 29ea3059fc Allow a cluster state applier to register an observer and wait for a better state (#23132)
#21817 introduced the notion of a cluster state applier and banned those for sampling the cluster state directly (as it is not applied yet). Testing has exposed one exceptional use case - if the appliers want to spawn off a follow up it may require waiting for specific new cluster state (for example, the shard started action, called by the IndicesClusterStateService, may run into trouble connecting to the master and wait for a new master to be elected). This requires creating an observer which, in turn, samples the cluster state. 

An example failure can be seen at https://elasticsearch-ci.elastic.co/job/elastic+elasticsearch+master+periodic/1701/console

This commit allows creating an observer from a cluster state applier. The observer is adapted to exclude any potential old cluster state in its logic.
2017-02-12 14:58:22 +02:00
Boaz Leskes 6a8ef0ea74 Traces in testAdapterSendReceiveCallbacks should only listen the relevant actions
The traces callback is only called after responses are set. This can lead to concurrent issues where the trace is notified of previously sent responses if it was added after the response was sent (enabling further execution of the test) but before the tracer call backs are called.
2017-02-12 09:20:18 +02:00
Jason Tedor 0f21ed5b70 Fix template HEAD requests
Template HEAD requests incorrectly return a content-length header of
0. This commit addresses this by removing the special handling for
template HEAD requests, and just relying on the general mechanism that
exists for handling HEAD requests in the REST layer.

Relates #23130
2017-02-11 18:30:16 -05:00
Boaz Leskes c2494bbaed log extra information on failure of testAdapterSendReceiveCallbacks 2017-02-11 19:41:19 +02:00
Ryan Ernst c91848e6a7 Docs: Consoleify cluster and indices settings docs (#23030)
relates #23001
2017-02-10 14:57:43 -08:00
Lee Hinman 13446937a5 Remove action.allow_id_generation setting (#23120)
This was an undocumented and unsettable setting that allowed id generation.

Resolves #23088
2017-02-10 14:04:40 -07:00
Jim Ferenczi 1ba73d9797 Fix GraphQuery expectation after Lucene upgrade to 6.5 (#23117)
GraphQueries are now generated as simple clauses in BooleanQuery. So for instance a multi terms synonym will generate
 a GraphQuery but only for the side paths, the other part of the query will not be impacted. This means that we cannot apply
 `minimum_should_match` or `cutoff_frequency` on GraphQuery anymore (only ES 5.3 does that because we generate all possible paths if a query has at least one multi terms synonym).
Starting in 5.4 multi terms synonym will now be treated as a single term when `minimum_should_match` is computed and will be ignored when `cutoff_frequency` is set.
Fixes #23102
2017-02-10 18:20:00 +01:00
sabi0 09c7c5c82f Limit IndexRequest toString() length (#22832)
Limits the length of `IndexRequest#toString` which also limits the size of the task description generated for `IndexRequest`s. If the document being written is larger than 2kb we skip logging the _source entirely. This is because truncating the source is tricky and it isn't worth it.
2017-02-10 10:42:08 -05:00
Sebastian 976da87e8f Fix some Javadoc typos (#23111) 2017-02-10 15:53:30 +01:00
Jason Tedor a6158398dd Fix index HEAD requests
Index HEAD requests incorrectly return a content-length header of
0. This commit addresses this by removing the special handling for index
HEAD requests, and just relying on the general mechanism that exists for
handling HEAD requests in the REST layer.

Relates #23112
2017-02-10 09:44:01 -05:00
Jim Ferenczi 5808aea265 Temporary disable bwc tests on field collapsing that fail because snapshot build of 5.3 is broken 2017-02-10 15:42:58 +01:00
Jason Tedor 7ac44656df Fix alias HEAD requests
Alias HEAD requests incorrectly return a content-length header of
0. This commit addresses this by removing the special handling for alias
HEAD requests, and just relying on the general mechanism that exists for
handling HEAD requests in the REST layer.

Relates #23094
2017-02-10 09:19:35 -05:00
Adrien Grand 709cc9ba65 Upgrade to lucene-6.5.0-snapshot-f919485. (#23087) 2017-02-10 15:08:47 +01:00
Jay Modi 7018b6ac6f Add BulkProcessor methods with XContentType parameter (#23078)
This commit adds methods to the BulkProcessor that accept bytes and a XContentType to avoid content type detection. The
methods that do not accept XContentType with bytes have been deprecated by this commit.

Relates #22691
2017-02-10 08:59:37 -05:00
Jason Tedor 4f2b4724be Cleanup RestGetAliasesAction.java
This commit is just a code cleanup of RestGetAliasesAction.java. For
example, we remove an unnecessary class, simplify a convenience method,
and simplify some code flow.

Relates #23095
2017-02-10 08:37:05 -05:00
Tanguy Leroux e2e5937455 Use `typed_keys` parameter to prefix suggester names by type in search responses (#23080)
This pull request reuses the typed_keys parameter added in #22965, but this time it applies it to suggesters. When set to true, the suggester names in the search response will be prefixed with a prefix that reflects their type.
2017-02-10 10:53:38 +01:00
Tanguy Leroux 63ea6f7168 [Docs] Remove unnecessary // TEST[continued] in search-template doc
It has been explained in e39b96f257
2017-02-10 10:08:24 +01:00
Nik Everett 0250c7ab18 Fix reindex test after toString change
Weakens the assertion on wait_for_active_shards so that we don't
check the toString of the bulk request because it isn't important.

Relates to #22900
2017-02-09 16:48:40 -05:00
Nik Everett e39b96f257 Fix confusing section in docs/README
It looked like it was telling you to add both `// TEST[continued]`
and `// TESTRESPONSE` to the same snippet which doesn't do anything.
Instead it was trying to say that you can have many snippets included
into the same test by doing:

```
request1
```
// CONSOLE

```
response1
```
// TESTRESPONSE

``
request2
```
// CONSOLE
// TEST[continued]

```
response2
```
// TESTRESPONSE
2017-02-09 16:17:14 -05:00
Boaz Leskes e0c8a6a3eb Relax WaitActiveShardCountIT check of exception messages
So ti wouldn't depend on BulkShardRequest.toString()
2017-02-09 23:14:09 +02:00
Clinton Gormley d43417ef47 Docs: Deleted redundant word in scripting 2017-02-09 22:02:42 +01:00
Areek Zillur 990918a655 fix failing tests for BulkShardRequest.tostring 2017-02-09 15:34:22 -05:00
Jonathan D Strootman cb35b3785a Adding `ansible-elasticsearch` to list of CM tools (#23058) 2017-02-09 21:14:30 +01:00
Clinton Gormley 78d3028bb7 Fixed bad asciidoc in delete-by-query 2017-02-09 20:14:56 +01:00
Boaz Leskes 033defee9a fix BulkShardRequestTests after changes to BulkShardRequest.toString 2017-02-09 21:05:21 +02:00
Boaz Leskes cd1cb41603 Move EvilPeerRecoveryIT to a unit test in RecoveryDuringReplicationTests (#22900)
EvillPeerRecoveryIT checks scenario where recovery is happening while there are on going indexing operation that already have been assigned a seq# . This is fairly hard to achieve and the test goes through a couple of hoops via the plugin infra to achieve that. This PR extends the unit tests infra to allow for those hoops to happen in unit tests. This allows the test to be moved to RecoveryDuringReplicationTests

Relates to #22484
2017-02-09 20:14:03 +02:00
Jim Ferenczi 94087b3274 Removes ExpandCollapseSearchResponseListener, search response listeners and blocking calls
This changes removes the SearchResponseListener that was used by the ExpandCollapseSearchResponseListener to expand collapsed hits.
The removal of SearchResponseListener is not a breaking change because it was never released.
This change also replace the blocking call in ExpandCollapseSearchResponseListener by a single asynchronous multi search request. The parallelism of the expand request can be set via CollapseBuilder#max_concurrent_group_searches

Closes #23048
2017-02-09 18:06:10 +01:00
Boaz Leskes 33915aefd8 Improve BulkShardRequest.toString when it has only 1 internal request
Now that we use bulk for single item indexing, this is often the case. Having an indicator of the id of the indexed document helps debugging.

It now looks like this `BulkShardRequest to [[test][0]] containing [index {[test][type][AVojzy9ZxfWASZ-ysmN7], source[{"auto":true}]}]`
2017-02-09 18:59:49 +02:00
Luca Cavanna 90ea778c17 Cluster allocation explain to never return empty response body (#23054)
Empty response bodies should only be sent for HEAD requests, otherwise we should always send back info about the exception that was thrown. Removed some manual exception handling in the REST action that should be rather bubbled up and handled by our rest action infra like every other rest action does.
2017-02-09 17:46:39 +01:00
Tim Brooks a331405aff Isolated SocketPermissions to Netty (#23057)
Netty 4.1.8 wraps connect and accept operations in doPrivileged blocks.
This means that we not need to give permissions to the entire transport
module. Additionally this commit deletes the privileged socket channel
and privileged server socket chanel.
2017-02-09 10:00:25 -06:00