3219 Commits

Author SHA1 Message Date
Luca Cavanna
37faddcafa [TEST] Wipe templates is now done in a single call using wildcards (compared to cluster state + delete each template) 2014-01-16 21:59:37 +01:00
Luca Cavanna
ee1e5660e1 [TEST] Removed TODO and custom code now that ping and info are two different apis in the REST spec 2014-01-16 21:17:29 +01:00
Luca Cavanna
81846151f7 [TEST] Added params validation according to REST spec and check whether body is supported or required 2014-01-16 21:09:56 +01:00
Luca Cavanna
92a5d6a8af [TEST] Replaced File.separator with '/' as REST test suites can be loaded from classpath, where '/' is needed 2014-01-16 21:09:56 +01:00
Luca Cavanna
06057c6c39 [TEST] Added check: test section names must be unique in the same REST test suite
Fixed also three duplicates found
2014-01-16 21:09:55 +01:00
Luca Cavanna
b5f4b2444c [TEST] Left '.' as it is in REST suites and sections titles (was previously replaced with '_')
With JUnit up to 4.10 there's no way to distinguish between what's shown in IDEs and test ids that need to be unique. A test Description is identified by just a string, that needs to be unique and is shown by IDEs. IDEs have slightly different behaviours when it comes to showing tests and suites titles. Some IDE (e.g. IntelliJ) strips the description on '.', which is why the '.' was replaced in the first place, in order to obtain the same behaviour on all IDEs. On the other hand the information printed out by RestReproduceInfoPrinter was wrong as the file path contained a '_' instead of a '.', which made the string to reproduce a failure useless in some cases. At the end of the day it seems better to just keep the dots and accept slightly different behaviours that are IDE dependent.
2014-01-16 21:09:55 +01:00
Alexander Reelsen
1b8e1f5595 RPMs: Add timeout to shutdown with KILL signal
If the thread pools of an elasticsearch node cannot be shutdown
immediately, a wait of 10 seconds is added. This clashes with the
RPM scripts, as by default the init functions wait for 3 seconds
for a service to shutdown before a KILL signal is sent, resulting
in an unclean shutdown - not from an elasticsearch point of view,
but from init system point of view, as some lock files are left
around.

In order to prevent this the init script as well as the systemd
configuration now feature the same timeout than the debian package,
which is 20 seconds.

The await statement, which causes the 10 second delay can be found in
InternalNode.close()
2014-01-16 16:14:25 +01:00
Simon Willnauer
85ca6c6762 move to [1.0.0] SNAP 2014-01-16 10:28:38 +01:00
Martijn van Groningen
6dd5c80f04 Fixed test bug, was using value that wasn't generated. 2014-01-16 10:26:48 +01:00
Alexander Reelsen
c6155c5142 release [1.0.0.RC1] 2014-01-15 17:02:22 +00:00
David Pilato
baf3bd9224 Don't fail plugin manager test when downloading an actual plugin 2014-01-15 17:10:11 +01:00
Alexander Reelsen
353d599d05 Increased max map pages for systemd to align with init.d settings in packages 2014-01-15 14:57:00 +01:00
Britta Weber
6389432b28 Use most recent cluster state to find types in delete mapping
Previously, the cluster state before flushing was used to check which
types map the given types pattern. However, this state might not be
up to date. Instead use the more recent cluster state from clusterState.state()
This fixes a test failure of PercolatorTests.testDeletePercolatorType

Other changes:

- use BoolFilter instead of OrFilter, because it is faster
- throw exception immediately when no type matching the given patterns
  was found in cluster state
2014-01-14 23:06:11 +01:00
Alexander Reelsen
a3abcdc93a Consistent APIs: Get field mapping API includes 'mappings'
The get field mapping API now includes a mappings element after the index in its JSON

Added more consistent endpoint /{index}/_mapping/{type}/field/{fields}
and added endpoint /_mapping/{type}/field/{fields}
which are also used in tests

Added rest spec tests for wildcards and _all

Relates #4071

NOTE: This is not yet complete for 1.0. We need to return an empty JSON document instead
of a 404 if the field of an existing index and type is not found. However this is not
possible with the current data structure being returned. Needs to be finished for 1.0.
2014-01-14 22:42:27 +01:00
Alexander Reelsen
349a8be4fd Consistent REST API changes for GETting data
* Made GET mappings consistent, supporting
  * /{index}/_mappings/{type}
  * /{index}/_mapping/{type}
  * /_mapping/{type}
  * Added "mappings" in the JSON response to align it with other responses
* Made GET warmers consistent, support /{index}/_warmers/{type} and /_warmer, /_warner/{name}
  as well as wildcards and _all notation
* Made GET aliases consistent, support /{index}/_aliases/{name} and /_alias, /_aliases/{name}
  as well as wildcards and _all notation
* Made GET settings consistent, added /{index}/_setting/{name}, /_settings/{name}
  as well as supportings wildcards in settings name
* Returning empty JSON instead of a 404, if a specific warmer/
  setting/alias/type is missing
* Added a ton of spec tests for all of the above
* Added a couple of more integration tests for several features

Relates #4071
2014-01-14 22:33:52 +01:00
Andrew Raines
b35ca1aa75 Fix disk percent used calc in cat/allocation
Closes #4670.
2014-01-14 15:23:19 -06:00
Andrew Raines
158483554d Shorten epoch to second precision.
Closes #4696.
2014-01-14 15:23:19 -06:00
Simon Willnauer
fb3ea1feb0 Use assertThat instead of plain asserts in MemoryCircuitBreakerTests 2014-01-14 20:38:03 +01:00
Britta Weber
411739fe3b Make PUT and DELETE consistent for _mapping, _alias and _warmer
See issue #4071

PUT options for _mapping:

Single type can now be added with

`[PUT|POST] {index|_all|*|regex|blank}/[_mapping|_mappings]/type`

and

`[PUT|POST] {index|_all|*|regex|blank}/type/[_mapping|_mappings]`

PUT options for _warmer:

PUT with a single warmer can now be done with

`[PUT|POST] {index|_all|*|prefix*|blank}/{type|_all|*|prefix*|blank}/[_warmer|_warmers]/warmer_name`

PUT options for _alias:

Single alias can now be PUT with

`[PUT|POST] {index|_all|*|prefix*|blank}/[_alias|_aliases]/alias`

DELETE options _mapping:

Several mappings can be deleted at once by defining several indices and types with

`[DELETE] /{index}/{type}`

`[DELETE] /{index}/{type}/_mapping`

`[DELETE] /{index}/_mapping/{type}`

where

`index= * | _all | glob pattern | name1, name2, …`

`type= * | _all | glob pattern | name1, name2, …`

Alternatively, the keyword `_mapings` can be used.

DELETE options for  _warmer:

Several warmers can be deleted at once by defining several indices and names with

`[DELETE] /{index}/_warmer/{type}`

where

`index= * | _all | glob pattern | name1, name2, …`

`type= * | _all | glob pattern | name1, name2, …`

Alternatively, the keyword `_warmers` can be used.

DELETE options for _alias:

Several aliases can be deleted at once by defining several indices and names with

`[DELETE] /{index}/_alias/{type}`

where

`index= * | _all | glob pattern | name1, name2, …`

`type= * | _all | glob pattern | name1, name2, …`

Alternatively, the keyword `_aliases` can be used.
2014-01-14 20:02:43 +01:00
Simon Willnauer
d1a4f889ae Fix DestructiveOperationsIntegrationTests to wait for index to be allocated before closing 2014-01-14 19:38:39 +01:00
Igor Motov
9440655ab9 Fix possible race condition in the restoreIndexWithMissingShards test
Due to a race condition the index creation operation might still try to create an index on the closing node.
2014-01-14 11:05:02 -05:00
Rob Cherry
f2710c16eb excluding all fields of an object should not remove parent.
When excluding '*.f1' from `{ "obj": { "f1": 1, "f2": 2 } }` XContentMapValues.filter returns `{ "obj": { "f2": 2}}`. When run on `{ "obj": { "f1" : 1 }}` we should return `{ "obj": { }}` to maintain object structure. People currently need to always check whether `obj` is there or not.

Closes #4715
Closes #4047
Related to #4491
2014-01-14 08:04:09 -08:00
Igor Motov
b987615f5e Improve support for partial snapshots
Fixes #4701. Changes behavior of the snapshot operation. The operation now fails if not all primary shards are available at the beginning of the snapshot operation. The restore operation no longer tries to restore indices with shards that failed or were missing during snapshot operation.
2014-01-13 16:59:21 -05:00
Lee Hinman
b379bf5668 Default to not accepting type wrapper in indexing requests
Currently it is possible to index a document as:

```
POST /myindex/mytype/1
{ "foo"...}
```

or as:

```
POST /myindex/mytype/1
{
    "mytype": {
        "foo"...
    }
}
```

This makes indexing non-deterministic and fields can be misinterpreted
as type names.

This changes makes Elasticsearch accept only the first form by default,
ie without the type wrapper. This can be changed by setting
`index.mapping.allow_type_wrapper` to `true`` when creating the index.

Closes #4484
2014-01-13 14:37:00 -07:00
Simon Willnauer
a1efa1f7aa Remove ElasticsearchInterruptedException and handle interrupt state
correctly.

InterruptedExceptions should be handled by either rethrowing or
restoring the interrupt state (i.e. calling
`Thread.currentThread().interrupt()`). This is important since the
caller of the is method or subequent method calls might also be
interested in this exception. If we ignore the interrupt state the
caller might be left unaware of the exception and blocks again on
a subsequent method.

Closes #4712
2014-01-13 22:17:11 +01:00
Shay Banon
7e5f51d4b1 clean the params before running the next test 2014-01-13 12:28:44 -08:00
Shay Banon
e8781d67da add similar concrete path trie tests resolution 2014-01-13 12:27:46 -08:00
Shay Banon
7427ac206c apply comments on tribe code 2014-01-13 12:26:59 -08:00
Shay Banon
76319b0cd2 Tribe Node
The tribes feature allowed to create a tribe node that can act as a federated client across multiple clusters.

The tribe node configuration looks something like this:

```
tribe.t1.cluster.name: cluster1
tribe.t2.cluster.name: cluster2
```

The configuration above configure connections to 2 clusters, named `t1`, `t2`. It creates a "node" client to each (so by default, above, multicast discovery is used). The settings for each node client is extracted from the `tribe.[tribe_name]` prefix.

The way the tribe node works is by merging the cluster state from each cluster, and creating a merged view of all clusters. This means all operations work the same, distributed search, suggest, percolation, indexing, ... .

The merged view drops conflicted indices and picks one of them if there are 2 indices with the same name across multiple clusters.

By default, read and write operations are allowed. Master level read operations (cluster state for example), require setting the local flag to true (since there is no elected master). Master level write operations are not allowed (create index, ...).

The tribe node can be configured to block write operations `tribe.blocks.write` to `true`, and metadata operations by setting `tribe.blocks.metadata` to `true`.
closes #4708
2014-01-13 11:08:18 -08:00
markharwood
541059a4d1 Adds a new coerce flag for numeric field mappings which is defaulted to true.
When set to false a new strict mode of parsing is employed which
a) does not permit numbers to be passed as JSON strings in quotes
b) rejects numbers with fractions that are passed to integer, short or long fields.

Closes #4117
2014-01-13 17:58:18 +00:00
Lee Hinman
2341825358 Make type wrapping optional for PUT Mapping API request
Put mapping now supports either of these formats:

POST foo/doc/_mapping
{
  "doc": {
    "_routing": {"required": true},
    "properties": {
      "body": {"type": "string"}
    }
  }
}

or

POST foo/doc/_mapping
{
  "_routing": {"required": true},
  "properties": {
    "body": {"type": "string"}
  }
}

Closes #4483
2014-01-13 09:26:09 -07:00
Simon Willnauer
a66aead54a Add better error reporting if a json spec can not be parsed 2014-01-13 17:19:13 +01:00
Simon Willnauer
268c2e2563 Fix RandomExceptionCircuitBreakerTests
RandomExceptionCircuitBreakerTests never actually installed
the FilteredAtomicReader that should throw random exceptions
when field data is loaded.
2014-01-13 17:19:13 +01:00
Simon Willnauer
ea9e095b57 Encapsulate Operations on SegmentReader in a utils class
This commit adds support to extract SegmentReader instances from
FilteredAtomicReader instances to support reader wrapping in
caches as well.
2014-01-13 17:19:13 +01:00
Simon Willnauer
20f9c96ad2 Add missing #setBreaker setter to NodesStatsRequestBuilder 2014-01-13 17:19:13 +01:00
markharwood
2795f4e55d Standardized use of “*_length” for parameter names rather than “*_len”.
Java Builder apis drop old “len” methods in favour of new “length”
Rest APIs support both old “len: and new “length” forms using new ParseField class to a) provide compiler-checked consistency between Builder and Parser classes and
b) a common means of handling deprecated syntax in the DSL.
Documentation and rest specs only document the new “*length” forms
Closes #4083
2014-01-13 15:59:15 +00:00
Martijn van Groningen
2dbda7b157 remove System.out.println 2014-01-13 16:53:57 +01:00
Martijn van Groningen
c4c918b3a5 Check if entry value can be cast to a Map, if not fail with a better error. 2014-01-13 16:47:35 +01:00
Martijn van Groningen
2ea93a6ad9 CompletionFieldMapper.Builder should make a copy of the default FieldType and set the builder field. 2014-01-13 16:47:35 +01:00
Andrew Raines
2c8baeaa4a Support sibling columns, with _cat/indices?pri as first go.
% curl localhost:9200/_cat/indices\?h=health,index,rep,docs.count,ss,cs,fm\&v\&pri
health index   rep docs.count      ss  pri.ss cs pri.cs     fm pri.fm
green  wiki      1       6401 302.9mb 151.4mb 0b     0b 25.1mb     0b
green  twitter   1      11434    64mb    32mb 0b     0b     0b     0b

Closes #4689.
2014-01-13 09:45:26 -06:00
Simon Willnauer
24a52f155d Remove ancient engine.robin.refresh_interval
Closes #4706
2014-01-13 16:30:15 +01:00
Martijn van Groningen
4754a83571 Added test with awaits annotation that exposes a merge mapping issue.
If the path_type is set to `just_name` in a multi_field typed field and that field is updated (for example another multi field is added) then if the path isn't specified again the path_type isn't taken into account and full path names are generated.
2014-01-13 16:29:13 +01:00
Simon Willnauer
8247e4beae Rename RobinEngine and friends to InternalEngine
Closes #4633
2014-01-13 15:49:10 +01:00
Simon Willnauer
7f63ddf94e Default stopwords list should be _none_ for all but language-specific analyzers
`standard_html_strip` and `pattern` analyzer support stopwords which are
set to the default `english` stopwords by default. Those analyzers
should not use stopwords by default since they are language neutral

Closes #4699
2014-01-13 14:44:10 +01:00
Adrien Grand
5c237fe834 Add new option min_doc_count to terms and histogram aggregations.
`min_doc_count` is the minimum number of hits that a term or histogram key
should match in order to appear in the response.

`min_doc_count=0` replaces `compute_empty_buckets` for histograms and will
behave exactly like facets' `all_terms=true` for terms aggregations.

Close #4662
2014-01-13 10:09:38 +01:00
Martijn van Groningen
943b62634c Replaced the multi-field type in favour for the multi fields option that can be set on any core field.
When upgrading to ES 1.0 the existing mappings with a multi-field type automatically get replaced to a core field with the new `fields` option.

If a `multi_field` type-ed field doesn't have a main / default field, a default field will be chosen for the multi fields syntax. The new main field type
will be equal to the first `multi_field` fields' field or type string if no fields have been configured for the `multi_field` field and in both cases
the default index will not be indexed (`index=no` is set on the default field).

If a `multi_field` typed field has a default field, that field will replace the `multi_field` typed field.

Closes to #4521
2014-01-13 09:21:53 +01:00
Luca Cavanna
0e7f6b1b1a [REST tests] Improved DoSection behaviour
No error wa previously thrown when a catch section was specified and a the rest call returned no error
Also, moved the catch:request on top to avoid even sending requests in that case
2014-01-12 12:44:39 +01:00
Florian Schilling
464037e0c1 Geo clean Up
============
The default unit for measuring distances is *MILES* in most cases. This commit moves ES
over to the *International System of Units* and make it work on a default which relates
to *METERS* . Also the current structures of the `GeoBoundingBox Filter` changed in
order to define the *Bounding* by setting abitrary corners.

Distances
---------
Since the default unit for measuring distances has changed to a default unit
`DistanceUnit.DEFAULT` relating to *meters*, the **REST API** has changed at the
following places:

  * `ScriptDocValues.factorDistance()` returns *meters* instead of *miles*
  * `ScriptDocValues.factorDistanceWithDefault()` returns *meters* instead of *miles*
  * `ScriptDocValues.arcDistance()` returns *meters* instead of *miles*
        one might use `ScriptDocValues.arcDistanceInMiles()`
  * `ScriptDocValues.arcDistanceWithDefault()` returns *meters* instead of *miles*
  * `ScriptDocValues.distance()` returns *meters* instead of *miles*
        one might use `ScriptDocValues.distanceInMiles()`
  * `ScriptDocValues.distanceWithDefault()` returns *meters* instead of *miles*
        one might use `ScriptDocValues.distanceInMilesWithDefault()`
  * `GeoDistanceFilter` default unit changes from *kilometers* to *meters*
  * `GeoDistanceRangeFilter` default unit changes from *miles* to *meters*
  * `GeoDistanceFacet` default unit changes from *miles* to *meters*

Geo Bounding Box Filter
-----------------------
The naming of the GeoBoundingBoxFilter properties allows to set arbitrary corners
(see #4084) namely `top_right`, `top_left`, `bottom_right` and `bottom_left`. This
change also includes the fields `topRight` and `bottomLeft` Also it is be possible to
set the single values by using just `top`, `bottom`, `left` and `right` parameters.

Closes #4515, #4084
2014-01-11 21:30:29 +09:00
Shay Banon
a500ba752e REST Update Settings API should not take timeout and master_timeout as index parameters
closes #4692
2014-01-11 02:05:28 +01:00
Martijn van Groningen
b7ad04a531 Fixes NPE in bool filter, when an empty should filter clause returns a DocIdSet, but null as iterator.
Closes #4685
2014-01-10 22:52:10 +01:00