Commit Graph

7004 Commits

Author SHA1 Message Date
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
Clinton Gormley 0751f0b7c6 [DOCS] Fixed link to tribe.asciidoc 2014-01-13 22:01:12 +01:00
Clinton Gormley 2e79246c1a [DOCS] Added docs for tribe node
Related #4708
2014-01-13 21:53:53 +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
Andrew Raines e13f55dfca [DOCS] Update cat/indices to reflect ?pri flag 2014-01-13 14:18:27 -06: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
Clinton Gormley 2c647b3a82 Revert "[SPEC] Added level param to cluster.state"
This reverts commit 06e5f3dd6f.
2014-01-13 18:07:12 +01:00
Clinton Gormley 06e5f3dd6f [SPEC] Added level param to cluster.state 2014-01-13 18:05:38 +01:00
Clinton Gormley 7779196c8a [SPEC] Updated cluster.state spec 2014-01-13 18:02:15 +01:00
Clinton Gormley b7cddea495 [SPEC] Added level param to cluster.node_stats and indices.stats 2014-01-13 17:40:27 +01: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 f2f4b72a12 Add missing closing '}' to indices.stats.json 2014-01-13 17:19:13 +01: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
Clinton Gormley b866c381d5 [TEST] Updated cluster.node_stats test 2014-01-13 17:06:29 +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
Clinton Gormley ed254b56e0 [SPEC] Updated cluster.node_stats and indices.stats 2014-01-13 16:54:51 +01: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
LightGuard e89d5d0d86 Fixing up code block delimeters for asciidoctor
You can now successfully run the docs through asciidoctor
2014-01-13 15:26:53 +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
Clinton Gormley 0916372520 Fix YAML in test/indices.open/20_multiple_indices.yaml 2014-01-13 13:17:30 +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
David Pilato c386155a73 add MockPageCacheRecycler in test jar
MockPageCacheRecycler is missing in test jar which makes failing tests when using
test jar in plugins:

```
1> [2014-01-11 10:51:30,531][ERROR][test                     ] FAILURE  : testWikipediaRiver(org.elasticsearch.river.wikipedia.WikipediaRiverTest)
  1> REPRODUCE WITH  : mvn test -Dtests.seed=5DAFD4FBAE587363 -Dtests.class=org.elasticsearch.river.wikipedia.WikipediaRiverTest -Dtests.method=testWikipediaRiver -Dtests.prefix=tests -Dtests.network=true -Dfile.encoding=MacRoman -Duser.timezone=Europe/Paris -Des.logger.level=INFO -Des.node.local=true -Dtests.cluster_seed=134842C2D806FFC0
  1> Throwable:
  1> java.lang.NoClassDefFoundError: org/elasticsearch/cache/recycler/MockPageCacheRecycler
  1>     org.elasticsearch.test.cache.recycler.MockPageCacheRecyclerModule.configure(MockPageCacheRecyclerModule.java:30)
  1>     org.elasticsearch.common.inject.AbstractModule.configure(AbstractModule.java:60)
```

Closes #4694.
2014-01-13 09:06:59 +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
Shay Banon ffe3537285 no need for the mvn repository anymore 2014-01-12 00:26:34 +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
mrsolo 2df42e4460 Added licene-maven-plugin to build
The plugin adds basic checks for license headers. At
this stage we only enable checks for java source files.
Other files are omitted at this point.
2014-01-10 22:04:48 +01:00
Simon Willnauer be2d02492e Reformat license header for consistency 2014-01-10 21:41:45 +01:00
Boaz Leskes f58ad85335 ClusterStatsTests.testValuesSmokeScreen: replace greaterThan with greaterOrEqualThan 2014-01-10 18:04:08 +01:00
Boaz Leskes b0f73d2625 ClusterStats tests should allow for open file descriptors to be -1 (which they are on windows)
Also made some other small tweaks for that case.
2014-01-10 17:52:43 +01:00
Adrien Grand 6be2066bd3 Cutover to Guava's Longs.compare. 2014-01-10 12:34:29 +01:00
Boaz Leskes 5ac7bd83ad Expose min/max open file descriptors in Cluster Stats API
Also changes the response format of that section to:

```
 "open_file_descriptors": {
      "min": 200,
      "max": 346,
       "avg": 273
 }
```

Closes #4681

Note: this is an aggregate of 3 commits in the 0.90 branch
2014-01-10 12:15:56 +01:00
Simon Willnauer fcdafaddd9 Add 0.90.10 to master 2014-01-10 11:39:13 +01:00
Luca Cavanna c27c93c5bc Removed needless TestRiver used in RiverTests
DummyRiver can be used instead, no need for TestRiver
2014-01-10 10:37:55 +01:00