Commit Graph

9191 Commits

Author SHA1 Message Date
Alexander Reelsen 6023a3a1a1 Plugins: Add executable flag to every file in bin/ after install
The PluginManager does not preserve permissions on install. This patch
sets the executable flag on every file in bin/ on plugin install.

Closes #7177
2014-08-14 10:53:08 +02:00
javanna 4d05d1d7b0 Internal: adjusted BroadcastShardOperationResponse subclasses visibility
Also replaced int,String pair with ShardId that holds the same info and serializes it the same way.
Replaced shardId and index getters in BroadcastOperationRequest with a single ShardId getter.

Closes #7255
2014-08-13 17:38:18 +02:00
Areek Zillur 0b6734aa40 [DOCS] Clarify Completion Suggester output deduplication 2014-08-13 11:09:18 -04:00
Ryan Ernst 98063ba244 Add [1.3.3] and [1.2.5] version constants. 2014-08-13 08:03:52 -07:00
Lee Hinman fe86eddecb Forbid index names over 100 characters in length
Fixes #4417
2014-08-13 14:51:21 +02:00
Lee Hinman 4dc060527c Add GroovyCollections to the sandbox whitelist
Also clarify in the docs that changing the whitelist/blacklist settings
replace the list, they don't add to it.

Fixes #7089
Fixes #7088
2014-08-13 14:47:49 +02:00
Thomas Peuss 089658a36f A content decompressor that throws a human readable message when
compression is disabled and the user sends compressed content.
2014-08-13 12:25:11 +02:00
javanna ba8df3b5ba Update api & Indices stats: fixed version checks for no-op updates which got in after 1.3 was released
Also added basic bw comp test for indices stats api.

Relates to #6822
2014-08-13 11:45:09 +02:00
David Pilato 90dfb350e0 Tests: move plugin dir to plugins dir
We should be consistent in our naming for classes and resources.
2014-08-13 11:42:05 +02:00
David Pilato 02a90f3684 Fix: VerboseProgress(PrintWriter) does not set the writer 2014-08-13 11:37:05 +02:00
Lee Hinman 59c1e94d90 [DOCS] mention the type of caches that warmers load 2014-08-13 11:23:51 +02:00
David Pilato 655282a2c6 Remove `numeric_range` filter
As done with #4034, `numeric_range` filter has been deprecated since 1.0.0.

Closes #7108.
2014-08-13 10:19:45 +02:00
javanna 270b109e65 Internal: adjusted visibility to package private for BroadcastShardOperationRequest subclasses and their constructors
Also replaced the String,int pair for index and shard_id with ShardId object that holds the same info and serialized it the same way too.

Closes #7235
2014-08-13 09:51:51 +02:00
Colin Goodheart-Smithe cd4aea841a Geo: fixes computation of geohash neighbours
The geohash grid it 8 cells wide and 4 cells tall. GeoHashUtils.neighbor(String,int,int.int) set the limit of the number of cells in y to < 3 rather than <= 3 resulting in it either not finding all neighbours or incorrectly searching for a neighbour in a different parent cell.

Closes #7226
2014-08-13 08:38:44 +01:00
Colin Goodheart-Smithe 2906d3e6dc Core: Store index creation time in index metadata
This change stores the index creation time in the index metadata when an index is created.  The creation time cannot be changed but can be set as part of the create index request to allow for correct creation times for historical data.

Closes #7119
2014-08-12 21:34:50 +01:00
mikemccand 8e35e921f7 Java client API: CreateIndexRequestBuilder.addMapping throws IllegalStateException if you add same type more than once
Previously, it would silently overwrite the previous mapping, which was trappy.

Closes #7231

Closes #7243
2014-08-12 14:32:38 -04:00
Alexander Reelsen e689a0ad71 Test: Allow CliTool to write out stacktraces
In order to have the possibility of debugging on the command line, the user
now can either set the es.cli.debug system property
which results in stack traces being written to to the terminal.

Closes #7222
2014-08-12 17:43:36 +02:00
David Pilato 9e6868733c Query DSL: Cache range filter on date field by default
A range filter on a date field with a numeric `from`/`to` value is **not** cached by default:

    DELETE /test

    PUT /test/t/1
    {
      "date": "2014-01-01"
    }

    GET /_validate/query?explain
    {
      "query": {
        "filtered": {
          "filter": {
            "range": {
              "date": {
                "from": 0
              }
            }
          }
        }
      }
    }

Returns:

    "explanation": "ConstantScore(no_cache(date:[0 TO *]))"

This patch fixes as well not caching `from`/`to` when using `now` value not rounded.
Previously, a query like:

    GET /_validate/query?explain
    {
      "query": {
        "filtered": {
          "filter": {
            "range": {
              "date": {
                "from": "now"
                "to": "now/d+1"
              }
            }
          }
        }
      }
    }

was cached.

Also, this patch does not cache anymore `now` even if the user asked for caching it.
As it won't be cached at all by definition.

Added as well tests for all possible combinations.

Closes #7114.
2014-08-12 15:27:02 +02:00
David Pilato b72f44b93a [Test] fix plugins: `bin` and `config` only plugins do not install correctly
Related to #7152.
2014-08-12 14:59:22 +02:00
David Pilato 14a028d62c plugins: `bin` and `config` only plugins do not install correctly
When installing a bin only plugin, it is identified as a site plugin.

A current workaround would be to create in the zip file another empty dir. So if you have:

* `bin/myfile.sh`
* `empty/empty.txt`

the `bin` content will be extracted as expected.

Closes #7152.
2014-08-12 14:40:51 +02:00
javanna 0ec7aa4492 [TEST] don't use multiple names (e.g. aliases) pointing to the same concrete index when using indexRandom
indexRandom will try to delete bogus documents multiple times since they get tracked by indexOrAlias/id, and after the actual deletion any other attempt throws error and fails the test
2014-08-12 14:34:11 +02:00
javanna 5d987ad5e2 Internal: changed every single index operation to not replace the index within the original request
An anti-pattern that we have in our code, noticeable for java API users, is that we modify incoming requests by replacing the index or alias with the concrete index. This way not only the request has changed, but all following communications that use that request will lose the information on whether the original request was performed against an alias or an index.

Refactored the following base classes: `TransportShardReplicationOperationAction`, `TransportShardSingleOperationAction`, `TransportSingleCustomOperationAction`, `TransportInstanceSingleOperationAction` and all subclasses by introduced an InternalRequest object that contains the original request plus additional info (e.g. the concrete index). This internal request doesn't get sent over the transport but rebuilt on each node on demand (not different to what currently happens anyway, as concrete index gets set on each node). When the request becomes a shard level request, instead of using the only int shardId we serialize the ShardId that contains both concrete index name (which might then differ ffrom the original one within the request) and shard id.

Using this pattern we can move get, multi_get, explain, analyze, term_vector, multi_term_vector, index, delete, update, bulk to not replace the index name with the concrete one within the request. The index name within the original request will stay the same.

Made it also clearer within the different transport actions when the index needs to be resolved and when that's not needed (e.g. shard level request), by exposing `resolveIndex` method. Moved check block methods to parent classes as their content was always the same on every subclass.

Improved existing tests by randomly introducing the use of an alias, and verifying that the responses always contain the concrete index name and not the original one, as that's the expected behaviour.

Added backwards compatibility tests to make sure that the change is applied in a backwards compatible manner.

Closes #7223
2014-08-12 13:25:23 +02:00
Colin Goodheart-Smithe 371d6021e7 Fix for failing BasePolygonBuilder 2014-08-12 11:04:07 +01:00
Colin Goodheart-Smithe 128b83e4a5 Geo: Better error for invalid multipolygon
Closes #7126
2014-08-12 10:30:26 +01:00
Colin Goodheart-Smithe 7c5a954b93 Geo: fixes geo_shapes which intersect dateline
If a geo_shape had edges which either ran vertically along the dateline or touched the date line but did not cross it they would fail to parse.  This is because the code which splits a polygon along the dateline did not take into account the case where the polygon touched but did not cross the dateline.  This PR fixes those issues and provides tests for them.

Close #7016
2014-08-12 09:54:16 +01:00
javanna 98fa8f9ba4 Internal: adjusted TermVectorRequest serialization to not serialize and de-serialize the index twice
Closes #7221
2014-08-12 10:33:09 +02:00
mikemccand 983c14b41a Test: don't need to wait for concrete mappings since we map both fields when we create the index 2014-08-12 04:24:10 -04:00
Martijn van Groningen a40cb169b6 Mappings: Make sure that multi fields are serialized in alphabetic order to ensure that the source is always the same.
Closes #7215
2014-08-11 18:45:02 +02:00
Martijn van Groningen 565dd90860 Core: Avoid null references that may be returned due to concurrent changes or inconsistent cluster state
Closes #7181
2014-08-11 18:32:26 +02:00
javanna ca5a17e4ba [DOCS] fixed DeleteIndexedScriptResponse javadocs 2014-08-11 17:55:31 +02:00
javanna c2594c0d3b Internal: adjusted visibility of GetRequest members (from protected to private) and resolved warning 2014-08-11 17:55:30 +02:00
Martijn van Groningen 2801d06aee Core: Pass down the types from the delete mapping request to the delete by query request.
The `.percolator` type is a hidden type and therefor the types from the delete mapping request should passed down to the delete by query request, otherwise the percolator type gets ignored and the percolator queries don't get deleted from disk (only unregistered).

Closes #7087
2014-08-11 17:19:03 +02:00
Ryan Ernst c1b6e53cbb Internal: Fix a very rare case of corruption in compression used for
internal cluster communication.

See CorruptedCompressorTests for details on how this bug can be hit.
This change also removes the ability to use the unsafe variant of
ChunkedEncoder, removing support for the compress.lzf.decoder setting.
2014-08-11 07:26:09 -07:00
Adrien Grand e61e21ef4d [Build] Make Eclipse aware of Elasticsearch's Nullable annotation for null pointer dereference analysis. 2014-08-11 15:28:41 +02:00
Adrien Grand bc41190dba [Build] @Nullable annotation is not applied to primitive types. 2014-08-11 15:28:41 +02:00
Colin Goodheart-Smithe 5349ecdb77 Mapping: fixes dynamic mapping of geo_point fields
If a dynamic mapping for a geo_point field is defined and the first document specifies the value of the field as a geo_point array, the dynamic mapping throws an error as the array is broken into individual number before consulting the dynamic mapping configuration.  This change adds a check of the dynamic mapping before the array is split into individual numbers.

Closes #6939
2014-08-11 13:08:32 +01:00
Adrien Grand 1210b08ecb [TEST] Fix SimpleQueryTests.testRangeQuery assumptions.
This test assumed that the `num` field was mapped as an integer on all shards
and thus that all of them should fail when providing a timezone. However, since
it used dynamic mappings, some shards might have this field not mapped, as a
consequence they didn't fail.
2014-08-11 14:00:49 +02:00
Colin Goodheart-Smithe 36083cb27f [DOCS] Added section describing how to return only agg results
Closes #5875
2014-08-11 11:31:01 +01:00
javanna a03860970b Internal: refactored TransportSingleCustomOperationAction, subclasses and requests
TransportSingleCustomOperationAction is subclassed by two similar, yet different transport action: TransportAnalyzeAction and TransportGetFieldMappingsAction. Made their difference and similarities more explicit by sharing common code and moving specific code to subclasses:
- moved index field to the parent SingleCustomOperationAction class
- moved the common check blocks code to the parent transport action class
- moved the main transport handler to the TransportAnalyzeAction subclass as it is only used to receive external requests through clients. In the case of the TransportGetFieldMappingsIndexAction instead, the action is internal and executed only locally as part of the user facing TransportGetFieldMappingsAction. The corresponding request gets sent over the transport though as part of the related shard request
- removed the get field mappings index action from the action names mapping as it is not a transport handler anymore. It was before although never used.

Closes #7214
2014-08-11 11:08:38 +02:00
olivier bourgain ac40eae3e3 Core: Improve XContentBuilder API. 2014-08-11 10:40:10 +02:00
javanna c7a9b3da5b Internal: removed needless serialization code from TransportIndexReplicationAction and corresponding request object
TransportIndexReplicationAction is always executed locally, as an internal action that is part of either delete by query or delete (when routing is required but not specified). Only the corresponding shard level requests get sent over the transport, hence no transport endpoint is needed for the index version, nor the index request itself is supposed to be sent over the transport.

Moved classes from org.elasticsearch.action.delete.index to org.elasticsearch.action.delete and adjusted visibility so that internal requests are not public anymore.

Also removed serialization code from IndexDeleteResponse as it never gets sent over transport either.

Closes #7211
2014-08-11 10:02:04 +02:00
Alexander Reelsen fbd337921f Test: Improved CLI testing infrastructure
Added a CaptureOutputTerminal class to the infrastructure, which can be used
in tests, to make sure that CLI commands write out the right data
2014-08-11 09:52:55 +02:00
javanna d01e79429a [TEST] moved testUpdateRequest unit test method to a proper unit test class 2014-08-08 23:26:06 +02:00
Areek Zillur 99ae3066de Suggester: add suggestRequest to Requests and fix broken javadocs in client
closes #7206
2014-08-08 12:09:28 -04:00
mikemccand 5335e3d22d Test: make sure mappings are on all shards to prevent false test failures 2014-08-08 10:51:23 -04:00
Robert Muir 1a09e7180a vary offset/length (i hope) in compressed stream test 2014-08-08 09:54:46 -04:00
Clinton Gormley 34830368d9 Update clearcache.asciidoc
Changed `field_data` to `fielddata` to be consistent with the indices stats output

Closes #2888
2014-08-08 13:03:59 +02:00
javanna 6d3bcc4451 Java API: add index, type and id to ExplainResponse
Index, type and id were returned as part of the REST explain api response, but not through java api. That info was read out of the request, relying on the fact that the index would get overridden with the concrete one within that same request.

Closes #7201
2014-08-08 12:52:03 +02:00
Clinton Gormley f28ada6416 Docs: Made config comment about min_master_nodes more explicit
Closes #2818
2014-08-08 12:44:01 +02:00
javanna 7f2b18864c Java API: fixed warnings in TermVectorRequest, also called super.validate for index not null check 2014-08-08 12:05:29 +02:00