Commit Graph

3621 Commits

Author SHA1 Message Date
Isabel Drost-Fromm 48004ff8a5 Add mustache templating to query execution.
Adds support for storing mustache based query templates that can later be filled
with query parameter values at execution time. Templates may be both quoted,
non-quoted and referencing templates stored in config/scripts/*.mustache by file
name.

See docs/reference/query-dsl/queries/template-query.asciidoc for templating
examples.

Implementation detail: mustache itself is being shaded as it depends directly on
guava - so having it marked optional but included in the final distribution
raises chances of version conflicts downstream.

Fixes #4879
2014-02-20 12:21:59 +01:00
Adrien Grand f5b3c08df2 Make _exists_/_missing_ behave consistently with exists/missing.
`_exists_` and `_missing_` miss field name expansion that `exists` and
`missing` have, which allows these filters to work on `object` fields.

Close #5142
2014-02-20 09:01:56 +01:00
Simon Willnauer d5f1e6f236 [TEST] Update testNGramCopyField to reflect the effect of an index_analyzer 2014-02-19 22:51:34 +01:00
javanna 1bca4971fa [TEST] Added index templates tests for broken mapping and invalid settings scenarios 2014-02-19 20:03:12 +01:00
Simon Willnauer 8fe4d878eb Added tests for empty token chars on ngram tokenizer
This relates to #5120
2014-02-19 19:08:35 +01:00
javanna 1a48c5fc21 [TEST] Initialization errors are checked before returning "no tests to run" error
If there initialization errors and no tests to execute at the same time, better to return the initialization errors, whose check should be first then, as it might be that the "no tests to execute" is caused by the initialization errors.
2014-02-19 19:02:15 +01:00
javanna 1d543432dd [TEST] Added tests for alias filter that is valid json but not a valid filter 2014-02-19 12:42:46 +01:00
javanna d3ed795372 Alias code cleanup
- Renamed IndexMetaData#removerAlias to removeAlias
- Removed IndexTemplateMetaData#fromXContentStandalone unused method (relates to #4511)
- MetaDataIndexAliasesService fix typo in comment
- Alias removed unused constructor that accepts both alias name and filter
2014-02-19 12:04:30 +01:00
Simon Willnauer 4902dd1da6 Add test and randomization for #5165 2014-02-19 11:06:09 +01:00
jayesh.modi 3dec916ef2 Fix SearchContext from being closed prematurely
Fixes SearchContext from being closed during initialization or immediately
after processing is started

Closes #5165
2014-02-19 11:06:09 +01:00
constantijn 369dba126c [DOCS] Javadoc: delete index request does not support empty String
In 0.90.x I was able to delete all my indices from the java api by calling

    client.admin().indices().prepareDelete(new String[] {}).execute().actionGet();

However this fails in 1.0.0 with

org.elasticsearch.action.ActionRequestValidationException: Validation Failed: 1: index / indices is missing;
	at org.elasticsearch.action.ValidateActions.addValidationError(ValidateActions.java:29)
	at org.elasticsearch.action.admin.indices.delete.DeleteIndexRequest.validate(DeleteIndexRequest.java:72)
	*snip long stacktrace*

which points me to

    public ActionRequestValidationException validate() {
        ActionRequestValidationException validationException = null;
        if (indices == null || indices.length == 0) {
            validationException = addValidationError("index / indices is missing", validationException);
        }
        return validationException;
    }

So that's what now throws the error, however the documentation still says:

    /**
     * Deletes an index based on the index name.
     *
     * @param indices The indices to delete. Empty array to delete all indices.
     */
    DeleteIndexRequestBuilder prepareDelete(String... indices);

Closes #5164.
Closes #5167.
Closes #5168.
2014-02-19 10:31:32 +01:00
Shay Banon 86a883b4bf support help as well as h in direct cat call to list all actions 2014-02-18 21:55:08 +02:00
Alexander Reelsen 565c212732 Set permission in debian postinst script correctly
The old post installation script on debian set all data to
644 inside of /etc/elasticsearch, which does not work, when
there are subdirectories

Closes #3820
2014-02-18 13:22:28 +01:00
David Pilato 5d159369ef Source filtering with wildcards broken when given multiple patterns
```
curl -XPUT 'http://localhost:9200/twitter/tweet/1' -d '{
    "user" : "kimchy",
    "post_date" : "2009-11-15T14:12:12",
    "message" : "trying out Elasticsearch", "retweeted": false
}'
```

No source fields delivered:

```
curl -XGET 'http://localhost:9200/twitter/tweet/1?_source=*.id,retweeted&pretty=yes'
```

`retweeted` returned:

```
curl -XGET 'http://localhost:9200/twitter/tweet/1?_source=retweeted,*.id&pretty=yes'
```

Closes #5132.
Closes #5133.
2014-02-17 18:15:30 +01:00
Luca Cavanna 3afdf4a872 Added support for aliases to create index api
It is now possible to specify aliases during index creation:

curl -XPUT 'http://localhost:9200/test' -d '
{
    "aliases" : {
        "alias1" : {},
        "alias2" : {
            "filter" : { "term" : {"field":"value"}}
        }
    }
}'

Closes #4920
2014-02-17 14:54:21 +01:00
Shay Banon 8601529be8 Optimize multiple cluster state processing on receiving nodes
Nodes that receive the cluster state, and they have several of those pending, can optimize and try and process potentially only one of those.
closes #5139
2014-02-17 11:10:49 +01:00
Britta Weber db3c6c2a8e Enable percolation for nested documents
closes #5082
2014-02-14 22:42:33 +01:00
Lee Hinman de91ffd0ce Fix license header for SimpleQueryParser 2014-02-14 11:55:49 -07:00
Lee Hinman c97bcc3602 Add support for `lowercase_expanded_terms` flag to simple_query_string
Default the flag to true, making simple_query_string behave similarly to
query_string

Fixes #5008
2014-02-14 11:51:23 -07:00
Nik Everett 5c3f4ceafb Add preserve original token option to ASCIIFolding
Closes #4931
2014-02-14 19:37:00 +01:00
Martijn van Groningen d8f498226a Fixed issue where highlighting in percolate existing doc api doesn't work (no highlight snippets) 2014-02-14 11:54:25 -05:00
Martijn van Groningen b591d7fef7 Make sure that parent type is created explicitly.
Cleaned up the p/c integration tests to use shorter mapping definition, ensureGreen() and .get()
2014-02-14 11:39:06 -05:00
Brian Yoder 41dba68bda Added the `DistanceUnit.NAUTICALMILES` enumeration
label with the corresponding *NM* and *nmi* unit
suffixes. Update the docs to match.

Closes #5085
2014-02-14 19:48:58 +09:00
Lee Hinman 28c6dc3e19 Allow specifying nested fields in simple_query_string
Fixes #5091
2014-02-13 09:31:33 -07:00
Martijn van Groningen d005a105ac Made highlight query also work in the percolate api. 2014-02-12 10:13:35 -05:00
Simon Willnauer 411af96044 Minor cleanups in ShardsLimitAllocationDecider 2014-02-12 12:50:55 +01:00
Luca Cavanna 129c0a3a3f Improved ClusterSettingsTests
more assertAcked, checked that the `discovery.zen.publish_timeout` has been changed in `DiscoverySettings`, removed restriction on number of nodes, doesn't seem needed.
2014-02-12 10:45:37 +01:00
Simon Willnauer 0b4bf88dae Beefed up DeleteByQueryTests to run not just against a single document 2014-02-11 16:23:16 +01:00
Simon Willnauer a06a00b37e Added test #5078 2014-02-11 15:58:57 +01:00
Simon Willnauer 990ce658a4 [Docs] Remove `custom_score` from documentation and add a migration
section.
2014-02-11 14:59:15 +01:00
Simon Willnauer 006075f01e Remove `custom_score` and `custom_boost_factor` queries
`custom_boost_factor` and `custom_score` were deprecated in `0.90.5`
and their documentation was removed already in `1.0`. This commit
removes all support for those queries since they are supercede by
`function_score`.
2014-02-11 14:59:15 +01:00
Luca Cavanna 766134f3c7 Made possible to dynamically update `discovery.zen.publish_timeout` cluster setting
`discovery.zen.publish_timeout` controls how long the master node is going to try and wait for all the nodes to respond to a cluster state publish before going ahead with the following updates in the queue (default 30s). Up until now changing the settings required restarting each node. The setting is now dynamic and can be changed through the cluster update settings api.

Closes #5063
2014-02-11 12:04:28 +01:00
Alexander Reelsen b02e6dc996 Migrating NodesInfo API to use plugins instead of singular plugin
In order to be consistent (and because in 1.0 we switched from
parameter driven information to specifzing the metrics as part of the URI)
this patch moves from 'plugin' to 'plugins' in the Nodes Info API.
2014-02-11 10:05:10 +01:00
Simon Willnauer 06f8a2e1a3 Fix AndDocIdSet#IteratorBasedIterator to not violate initial doc state
AndDocIdSet#IteratorBasedIterator was potentially initialized with
NO_MORE_DOCS which violates the initial state of DocIdSetIterator and
could lead to undefined behavior when used in a search context.

Closes #5049
2014-02-10 18:14:10 +01:00
Luca Cavanna 1161e0f6f1 more AbstractRestResponseActionListener in RestThreadPoolAction (cat api) 2014-02-10 16:20:04 +01:00
Simon Willnauer dc308db4fe [TEST] Add basic test for /cat/shards/{index}
Basic REST test for rendering the cat/shards endpoint.
2014-02-10 12:23:01 +01:00
Shay Banon e5f43a1867 add version and master_node flags to cluster state 2014-02-10 02:24:03 +01:00
Shay Banon 152edd1804 Bulk process of shard started/failed should not execute on already processed events
closes #5061
2014-02-10 01:21:58 +01:00
uboness b3cb59d024 Fixed parsing time zones as numeric value in DateHistogramParser
Closes #5057
2014-02-09 22:05:36 +01:00
Adrien Grand 6e46ca29d4 Log warning in case of double release of the IndexSearcher instead of throwing an exception. 2014-02-07 15:24:08 +01:00
Adrien Grand 5bff4ec1d5 Add a aggregation test that uses `doc.score` to make sure we don't forget to set the Scorer. 2014-02-07 14:51:15 +01:00
Luca Cavanna a76620e3ac [TEST] run REST tests against multiple nodes (round-robin)
Multiple nodes are now started when running REST tests against the `TestCluster` (default randomized settings are now used instead of the hardcoded `1`)

Added also randomized round-robin based on all available nodes, and ability to provide multiple addresses when running tests against an external cluster to have the same behaviour
2014-02-07 13:52:48 +01:00
David Pilato 8b1c25e11f Upgrading analysis plugins fails
When an analysis plugins provides default index settings using `PreBuiltAnalyzerProviderFactory`,  `PreBuiltTokenFilterFactoryFactory` or `PreBuiltTokenizerFactoryFactory` it fails when upgrading it with elasticsearch superior or equal to 0.90.5.

Related issue: #4936

Fix is needed in core. But, in the meantime, analysis plugins developers can fix that issue by overloading default prebuilt factories.

For example:

```java
public class StempelAnalyzerProviderFactory extends PreBuiltAnalyzerProviderFactory {

    private final PreBuiltAnalyzerProvider analyzerProvider;

    public StempelAnalyzerProviderFactory(String name, AnalyzerScope scope, Analyzer analyzer) {
        super(name, scope, analyzer);
        analyzerProvider = new PreBuiltAnalyzerProvider(name, scope, analyzer);
    }

    @Override
    public AnalyzerProvider create(String name, Settings settings) {
        return analyzerProvider;
    }

    public Analyzer analyzer() {
        return analyzerProvider.get();
    }
}
```

And instead of:

```java
    @Inject
    public PolishIndicesAnalysis(Settings settings, IndicesAnalysisService indicesAnalysisService) {
        super(settings);
        indicesAnalysisService.analyzerProviderFactories().put("polish", new PreBuiltAnalyzerProviderFactory("polish", AnalyzerScope.INDICES, new PolishAnalyzer(Lucene.ANALYZER_VERSION)));
    }
```

do

```java
    @Inject
    public PolishIndicesAnalysis(Settings settings, IndicesAnalysisService indicesAnalysisService) {
        super(settings);
        indicesAnalysisService.analyzerProviderFactories().put("polish", new StempelAnalyzerProviderFactory("polish", AnalyzerScope.INDICES, new PolishAnalyzer(Lucene.ANALYZER_VERSION)));
    }
```

Closes #5030
2014-02-07 12:20:34 +01:00
Simon Willnauer 7a84b94e29 Extend ElasticsearchLuceneTestCase rather than LuceneTestCase
LuceneTestCase misses some thread filters that might fail a test
since a background cluster is still running from a previous test.
2014-02-07 12:02:11 +01:00
tstibbs 8fabd477b8 fixed trace logging hidden by check for isDebugEnabled 2014-02-07 10:38:45 +01:00
Adrien Grand 9cb17408cb Make size=0 return all buckets for the geohash_grid aggregation.
Close #4875
2014-02-07 09:55:10 +01:00
Adrien Grand e1c1120949 Fix BytesRef owning issue in string terms aggregations.
The byte[] array that was used to store the term was owned by the BytesRefHash
which is used to compute counts. However, the BytesRefHash is released at some
point and its content may be recycled.

MockPageCacheRecycler has been improved to expose this issue (putting random
content into the arrays upon release).

Number of documents/terms have been increased in RandomTests to make sure page
recycling occurs.

Close #5021
2014-02-07 09:46:06 +01:00
Simon Willnauer 0fb8d982be Use patched version of ReferenceManager to prevent infinite loop in
RefrenceManager#accquire()

See LUCENE-5436
2014-02-06 21:45:38 +01:00
Adrien Grand aab2c7a444 Be paranoid about double release. 2014-02-06 21:00:56 +01:00
Lee Hinman d2078a5e28 Add fuzzy/slop support to `simple_query_string`
Ports the change from https://issues.apache.org/jira/browse/LUCENE-5410
2014-02-06 10:05:10 -07:00
Simon Willnauer 162ca99376 Added `cross_fields` mode to multi_match query
`cross_fields` attemps to treat fields with the same analysis
configuration as a single field and uses maximum score promotion or
combination of the scores based depending on the `use_dis_max` setting.
By default scores are combined. `cross_fields` can also search across
fields of hetrogenous types for instance if numbers can be part of
the query it makes sense to search also on numeric fields if an analyzer
is provided in the reqeust.

Relates to #2959
2014-02-06 17:15:55 +01:00
Adrien Grand 728e0e2a2e Ignore case when parsing `script_values_sorted|unique` in aggregations.
Close #5009
2014-02-06 12:01:00 +01:00
Adrien Grand 4e9fa5c9f4 Add Version.1_1_0 (missing in master but already in 1.x). 2014-02-05 11:47:07 +01:00
Adrien Grand 6777be60ce Add script support to value_count aggregations.
Close #5001
2014-02-04 14:29:32 +01:00
Adrien Grand 9333a3c28a Fix hashCode values of aggregations' BytesValues.
This commit removes FilterBytesValues which is very trappy as the default
implementation forwards all method calls to the delegate. So if you do any
non-trivial modification to the terms or to the order of the terms, you need
to remember to override currentValueHash, copyShared, and this is very
error-prone.

FieldDataSource.WithScript.BytesValues and ScriptBytesValues now return correct
hash codes, future bugs here would be catched by the new assertion in
SortedUniqueBytesValues.

This bug was causing performance issues with scripts as all terms were assumed
to have the same hash code.

Close #5004
2014-02-04 14:16:09 +01:00
Luca Cavanna 56f4fcb5df [TEST] thrown error when there are no REST tests to run 2014-02-04 13:05:49 +01:00
Simon Willnauer bd8cb4eb1b Add [0.90.11] version as a constant 2014-02-03 16:27:02 +01:00
Shay Banon d591972c18 Remove the in memory buffer Lucene store/directory
closes #4994
2014-02-03 09:52:19 -05:00
Luca Cavanna 56d3e98fff [TEST] added ability to filter REST test sections to run
Added `tests.rest.section` parameter that allows to filter the test sections that get executed via regex (case insensitive)
2014-02-03 15:30:58 +01:00
Simon Willnauer f0774eb5d1 Added dedicated test for MultiMatchQuery 2014-02-03 13:04:33 +01:00
markharwood 82c7c81653 Added tests for match/multimatch queries with invalid “type” JSON param 2014-02-03 11:51:31 +00:00
Luca Cavanna 88771fdf99 [TEST] Added ability to test apis that don't return json
The last response body gets now always stashed in the REST tests and can be retrieved via `$body`. This implies that not only expected values can be retrieved from the stashed values, but actual values as well.

Added support for regular expressions to `match` assertion, using `Pattern.COMMENTS` flag for better readability through new custom hamcrest matcher (adopted in do section as well). Functionality added through new feature called `regex` that needs to be mentioned in the skip sections whenever needed till all the runners support it.

Added also example tests for cat count api
2014-02-03 11:26:38 +01:00
markharwood 5f8dbeaa8e Added exception if passed an invalid type param
Closes #4964
2014-02-03 10:09:38 +00:00
Luca Cavanna 1ca565cf9f [TEST] Added check that yaml REST test suites always end with \n
Our yaml parser seems to be too tolerant in some cases, e.g. it properly parses yaml suites when they don't end with a line feed, whereas other clients tests break due to that. We should try to do the same to keep consistency across runners.
2014-02-03 10:05:35 +01:00
George P. Stathis 74dd33689e Parent / child queries should work with non-default similarities 2014-02-02 09:23:12 +01:00
Martijn van Groningen 244723d401 Added `fields` support to `geo_point` and `completion` field type.
Upgrading 0.90.x `multi_field` type that has a `geo_point` or `completion` field type as default field would otherwise fail.
Also it make sense to support these field types, because both support specifying the actual values as string.
2014-02-02 07:16:36 +01:00
Simon Willnauer 9cf8251a0d Add RamUsageEstimator#sizeOf(Object) to forbidden APIs
This method can be a performance trap since it traverse the
entire object tree that is referenced by the provided object.
See LUCENE-5373
2014-01-31 21:43:20 +01:00
Simon Willnauer 6e18a8945d Prevent usage of object based RamUsageEstimator in Completion090PostingsFormat 2014-01-31 21:16:38 +01:00
Simon Willnauer 3e3170278e Don't load CompetionTerms if lookupFactory is null
Closes #4970
Closes #4788
2014-01-31 21:16:38 +01:00
Igor Motov 90da268237 Remove support for boost in copy_to field
Currently, boosting on `copy_to` is misleading and does not work as originally specified in #4520. Instead of boosting just the terms from the origin field, it boosts the whole destination field.  If two fields copy_to a third field, one with a boost of 2 and another with a boost of 3, all the terms in the third field end up with a boost of 6.  This was not the intention.

  The alternative: to store the boost in a payload for every term, results in poor performance and inflexibility. Instead, users should either (1) query the common field AND the field that requires boosting, or (2) the multi_match query will soon be able to perform term-centric cross-field matching that will allow per-field boosting at query time (coming in 1.1).
2014-01-31 14:34:01 -05:00
Lee Hinman 5448477c54 Add explanations for all AllocationDeciders
Relates to #4380
Relates to #2483
2014-01-31 10:47:23 -07:00
Luca Cavanna d68d8fbf11 [TEST] clarified skip features usage 2014-01-31 18:03:24 +01:00
Luca Cavanna 33d5a722b3 [TEST] Added ability to skip REST test suite/sections based on their required features
As we have different runners for the REST tests we need a mechanism that allows us to add features to any of them without breaking all others builds.
The idea is to name a feature and temporarily use skip sections that mention the required new features, so that runners that don't support it will skip the test.

Added support for `features` field in skip section.
Added `Features` class that contains a static list of the features supported by the runner. If a feature mentioned in a skip section is not listed here, the test will be skipped.
2014-01-31 16:47:40 +01:00
Martijn van Groningen f60f72f19b Added missing licence header 2014-01-31 10:19:32 +01:00
Martijn van Groningen 0d9197a1d3 The binary field shouldn't be stored by default, because it is already available in the _source. 2014-01-31 10:15:51 +01:00
Martijn van Groningen b9707b395d Added benchmark for scroll searches. 2014-01-31 10:12:32 +01:00
Shay Banon ae3e8beca4 filtered query parses _name incorrectly
fixes #4960
2014-01-30 21:32:52 +01:00
Simon Willnauer dddfe23bed Randomized number of shards / replicas & add mapping for numeric fields 2014-01-30 20:42:31 +01:00
Mark Conlin cd9be4364f Improve boolean handling in snapshot/restore request parsing
Fixes #4949
2014-01-30 13:16:53 -05:00
Martijn van Groningen 7e1eed9814 The forceful no cache behaviour for range filter with now date match expression should only be active if no rounding has been specified for `now` in the date range range expression (for example: `now/d`).
Also the automatic now detection in range filters is overrideable by the `_cache` option.

 Closes #4947
 Relates to #4846
2014-01-30 15:51:33 +01:00
David Pilato abf9a86678 Add version to plugins
Plugin developpers can now add a version number to their es-plugin.properties file:

```properties
plugin=org.elasticsearch.test.integration.nodesinfo.TestPlugin
version=0.0.7-SNAPSHOT
```

Also, for site plugins, it's recommended to add a `es-plugin.properties` file in root site directory with `description` and `version` properties:

```properties
description=This is a description for a dummy test site plugin.
version=0.0.7-BOND-SITE
```

When running Nodes Info API, you will get information on versions:

```sh
$ curl 'http://localhost:9200/_nodes?plugin=true&pretty'
```

```javascript
{
  "ok" : true,
  "cluster_name" : "test-cluster-MacBook-Air-de-David.local",
  "nodes" : {
    "RHMsToxiRcCXwHiS6mEaFw" : {
      "name" : "node2",
      "transport_address" : "inet[/192.168.0.15:9301]",
      "hostname" : "MacBook-Air-de-David.local",
      "version" : "0.90.0.Beta2-SNAPSHOT",
      "http_address" : "inet[/192.168.0.15:9201]",
      "plugins" : [ {
        "name" : "dummy",
        "version" : "0.0.7-BOND-SITE",
        "description" : "This is a description for a dummy test site plugin.",
        "url" : "/_plugin/dummy/",
        "site" : true,
        "jvm" : false
      } ]
    },
    "IKiUOo-LSCq1Km1GUhBwPg" : {
      "name" : "node3",
      "transport_address" : "inet[/192.168.0.15:9302]",
      "hostname" : "MacBook-Air-de-David.local",
      "version" : "0.90.0.Beta2-SNAPSHOT",
      "http_address" : "inet[/192.168.0.15:9202]",
      "plugins" : [ {
        "name" : "test-plugin",
        "version" : "0.0.7-SNAPSHOT",
        "description" : "test-plugin description",
        "site" : false,
        "jvm" : true
      } ]
    },
    "H64dcSF2R_GNWh6XRCYZJA" : {
      "name" : "node1",
      "transport_address" : "inet[/192.168.0.15:9300]",
      "hostname" : "MacBook-Air-de-David.local",
      "version" : "0.90.0.Beta2-SNAPSHOT",
      "http_address" : "inet[/192.168.0.15:9200]",
      "plugins" : [ ]
    },
    "mGEZcYl8Tye0Rm5AACBhPA" : {
      "name" : "node4",
      "transport_address" : "inet[/192.168.0.15:9303]",
      "hostname" : "MacBook-Air-de-David.local",
      "version" : "0.90.0.Beta2-SNAPSHOT",
      "http_address" : "inet[/192.168.0.15:9203]",
      "plugins" : [ {
        "name" : "test-plugin",
        "version" : "0.0.7-SNAPSHOT",
        "description" : "test-plugin description",
        "site" : false,
        "jvm" : true
      }, {
        "name" : "test-no-version-plugin",
        "version" : "NA",
        "description" : "test-no-version-plugin description",
        "site" : false,
        "jvm" : true
      }, {
        "name" : "dummy",
        "version" : "NA",
        "description" : "No description found for dummy.",
        "url" : "/_plugin/dummy/",
        "site" : true,
        "jvm" : false
      } ]
    }
  }
}
```

Relative to #2668.
Closes #2784.
2014-01-30 14:13:46 +01:00
Alexander Reelsen 2c67ba8f1a REST Get Field Mapping API: Fix NPE if field not existent
When fixing #4738, a small issue leaked into the implementation.
The equals check in the RestAction only applied when the master node
returned the rest request, otherwise the object equality would not hold
due to being transferred over the wire and being deserialized into
another object (from and an equality point of view) than the
FieldMappingMetaData.NULL object - this could result in serialization
exceptions as an empty length bytes reference is used in toXContent.
2014-01-30 12:02:52 +01:00
uboness 79d1633dd6 fixed a bug where when executing on a single shard and sorting terms agg based on sub metric agg, the order (asc/desc) is not respected
- fixed tests for terms order

Closes #4951
2014-01-30 06:54:25 +01:00
Lee Hinman 4c06c533e8 Fix javadocs for DeleteResponse.isFound() 2014-01-29 22:29:05 -07:00
Igor Motov 2755eecf65 Add throttling to snaphost and restore operations
Closes #4855
2014-01-29 10:33:59 -05:00
David Pilato 0541456b34 scroll REST API should support source parameter
As stated in documentation, we should support `?source=` parameter in `/_search/scroll` REST operations.

This is how to reproduce it:

```sh
curl -XDELETE "http://localhost:9200/test"
curl -XPOST "http://localhost:9200/test/type/1" -d'
{
    "foo": "bar"
}'

# This one works
curl -XPOST "http://localhost:9200/_search/scroll" -d "FAKESCROLLID"

# This one gives: {"error":"Failed to derive xcontent from org.elasticsearch.common.bytes.BytesArray@0"}
curl -XGET "http://localhost:9200/_search/scroll/?source=FAKESCROLLID"
```

Closes #4941.
2014-01-29 14:43:36 +01:00
Igor Motov 2b80c752df Remove waiting for green in CopyToMapperIntegrationTests 2014-01-29 07:29:35 -05:00
Martijn van Groningen c82f27577b Added dedicated thread pool cat api, that can show all thread pool related statistic (size, rejected, queue etc.) for all thread pools (get, search, index etc.)
By default active, rejected and queue thread statistics are included for the index, bulk and search thread pool.
Other thread statistics of other thread pools can be included via the `h` query string parameter.

Closes #4907
2014-01-29 13:25:06 +01:00
Igor Motov a0e381ad3a Improve test stability 2014-01-29 07:14:27 -05:00
Martijn van Groningen 2de0e60342 Wait for green after indexing doc, so that the mapping update is always after the index operation on replica has completed. (replica shard may needed to catch up) 2014-01-29 12:10:17 +01:00
David Pilato d621ab9958 Fix potential NPE when no source and no body
In recent changes, we added missing support for `source` parameter in some REST APIs:

* #4892 : mget
* #4900 : mpercolate
* #4901 : msearch
* #4902 : mtermvectors
* #4903 : percolate

```java
        BytesReference content = null;
        if (request.hasContent()) {
            content = request.content();
        } else {
            String source = request.param("source");
            if (source != null) {
                content = new BytesArray(source);
            }
        }
```

It's definitely better to have:

```java
        BytesReference content = request.content();
        if (!request.hasContent()) {
            String source = request.param("source");
            if (source != null) {
                content = new BytesArray(source);
            }
        }
```

That said, it could be nice to have a single method to manage it for various REST actions.

Closes #4924.
2014-01-28 18:15:27 +01:00
uboness dd389d1cc5 Made all multi-bucket aggs return consistent response format
Closes #4926
2014-01-28 17:46:57 +01:00
Simon Willnauer f9d1552282 Use #ensureSearchable() in GeoHashGridTests 2014-01-28 15:11:49 +01:00
Simon Willnauer 25f0bba30c Use num of actual threads if busiestThreads is larger
We currently use the number of hot threads that we are
interested in as the value for iterating over the actual
hot threads which can lead to AIOOB is the actual number
of threads is less than the given number.

Closes #4927
2014-01-28 14:23:42 +01:00
uboness 2ba2fb193d fixed compilation error on jdk7 2014-01-28 14:12:51 +01:00
Simon Willnauer b21b7ac40f Make test more reliable 2014-01-28 13:32:34 +01:00
uboness fc6bc4c477 cleanup of aggregations api
- add javadocs
- remove Iterable from all multi-bucket aggregations
- all single-bucket aggregations should have getDocCount() and getAggregations()
- all multi-bucket aggregations should have getBuckets() that returns Collection
- every multi-bucket aggregation should have these methods:
 - getBuckets() : Collection
 - getBucketByKey(String) : Bucket
 - getBucketByKey(Number) : Bucket (only for numeric buckets)
 - getBucketByKey(DateTime) : Bucket (only for date buckets)
 - getBucketByKey(GeoPoint) : Bucket (only for geohash_grid)
- every bucket in all multi-bucket aggregations should have these methods:
 - getKey() : String
 - getKeyAsText() : Text
 - getKeyAsNumber() : Number (if the key can be numeric value, eg. range & histograms)
 - getKeyAsGeoPoint() : GeoPoint (in case of the geohash_grid agg)

 Closes #4922
2014-01-28 13:28:04 +01:00
Luca Cavanna b61ca9932a [DOCS] Clarified docs for cluster.routing.allocation.same_shard.host cluster setting
Clarified also javadocs for SameShardAllocationDecider
2014-01-28 12:32:37 +01:00
Martijn van Groningen cb75830c68 Fixed failure for testDeletePercolatorType where the .percolator mapping hasn't propagated to master that was dynamically created via an index call, which made the delete mapping call fail. 2014-01-28 11:19:57 +01:00
Simon Willnauer b5a6a5a6ed Ignore internal errors if JVM can't find the memory pool 2014-01-28 11:11:41 +01:00
Simon Willnauer 91acca7836 Upgrade to Lucene 4.6.1
This upgrade includes a fix for RAM estimation on IndexReader
that allows to expose the amount of used bytes per segment now
as a setting in Elasticsearch. (LUCENE-5373)

Additionally this bugfix release contained a small fix for highlighting
that was already ported to Elasticsearch when reported (LUCENE-5361)

Closes #4897
2014-01-28 10:35:39 +01:00
David Pilato 1da5f3af67 Fix for #4902 2014-01-28 10:12:32 +01:00
Martijn van Groningen 6aaddb03f1 Changed p/c benchmarks to use random generated parent ids, index parent and its children in a non deterministic order and let query values match with multiple child / parent documents. 2014-01-28 10:11:00 +01:00
David Pilato 8706cf610a percolate REST API should support source parameter
As stated in documentation, we should support `?source=` parameter in percolate REST operations.

This is how to reproduce it:

```sh
curl -XDELETE "http://localhost:9200/test"

curl -XPUT "http://localhost:9200/test/.percolator/1" -d'
{
    "query" : {
        "match" : {
            "foo" : "bar"
        }
    }
}'

# This one works
curl -XPOST "http://localhost:9200/test/message/_percolate" -d '{
  "doc" : {
    "foo" : "bar is in foo"
  }
}'

# This one gives: BroadcastShardOperationFailedException[[test][2] ]; nested: PercolateException[failed to percolate]; nested: ElasticsearchIllegalArgumentException[Nothing to percolate];
curl -XGET "http://localhost:9200/test/message/_percolate?source=%7B%22doc%22%3A%7B%22foo%22%3A%22bar%20is%20in%20foo%22%7D%7D"
```

Closes #4903.
2014-01-28 09:43:28 +01:00
David Pilato 71b8876d83 mtermvectors REST API should support source parameter
As stated in documentation, we should support `?source=` parameter in msearch REST operations.

This is how to reproduce it:

```sh
curl -XDELETE "http://localhost:9200/test"

curl -XPOST "http://localhost:9200/test/type/1?refresh" -d'{
    "foo": "bar"
}'

# This one works
curl -XPOST "http://localhost:9200/test/type/_mtermvectors" -d'
{
    "ids" : ["1"]
}'

# This one gives: "ActionRequestValidationException[Validation Failed: 1: multi term vectors: no documents requested;]"
curl -XGET "http://localhost:9200/test/type/_mtermvectors?source=%7B%22ids%22%3A%5B%221%22%5D%7D"
```

Closes #4902.
2014-01-28 09:40:35 +01:00
David Pilato bf3d20eb05 msearch REST API should support source parameter
As stated in documentation, we should support `?source=` parameter in msearch REST operations.

This is how to reproduce it:

```sh
curl -XDELETE "http://localhost:9200/test"

curl -XPOST "http://localhost:9200/test/type/1?refresh" -d'{
    "foo": "bar"
}'

cat requests
{}
{"query" : {"match_all" : {}}}

# This one works
curl -XGET localhost:9200/_msearch --data-binary @requests

# This one gives: {"error":"Failed to derive xcontent from org.elasticsearch.common.bytes.BytesArray@0"}
curl -XGET "http://localhost:9200/test/type/_mget?source=%7B%7D%0A%7B%22query%22%3A%7B%22match_all%22%3A%7B%7D%7D%7D%0A"
```

Closes #4901.
2014-01-28 09:39:44 +01:00
David Pilato 03c02143dd mpercolate REST API should support source parameter
As stated in documentation, we should support `?source=` parameter in mpercolate REST operations.

This is how to reproduce it:

```sh
curl -XDELETE "http://localhost:9200/test"

curl -XPUT "http://localhost:9200/test/.percolator/1" -d'
{
    "query" : {
        "match" : {
            "foo" : "bar"
        }
    }
}'

# This one works
curl -XPOST "http://localhost:9200/test/message/_mpercolate" -d '
{"percolate" : {}}
{"doc" : {"foo" : "bar is in foo"}}
'

# This one gives: BroadcastShardOperationFailedException[[test][2] ]; nested: PercolateException[failed to percolate]; nested: ElasticsearchIllegalArgumentException[Nothing to percolate];
curl -XGET "http://localhost:9200/test/message/_mpercolate?source=%7B%22percolate%22%3A%7B%7D%7D%0A%7B%22doc%22%3A%7B%22foo%22%3A%22bar is in foo%22%7D%7D%0A"
```

Closes #4900.
2014-01-28 09:38:30 +01:00
Alexander Reelsen 5e58f4066e REST API: Consistent get field mapping response
If a get field mapping request is issued, and all but the field can be
found, the response should return an empty JSON object instead of a 404.

Closes #4738
2014-01-28 08:12:53 +01:00
markharwood d9699e02f4 Changed GeoEncodingTests to ensure accuracy always >1mm due to rounding errors with very small numbers 2014-01-27 17:05:19 +00:00
Martijn van Groningen f38296da61 Percolator response now always returns the `matches` key.
Closes #4881
2014-01-27 16:37:09 +01:00
Lee Hinman 04c41fe349 Add missing PHRASE flag for simple_query_string
Closes #4911
2014-01-27 07:18:32 -07:00
Luca Cavanna 2ad7f2b8a6 Improved CreateIndexRequest and CreateIndexRequestBuilder javadocs 2014-01-27 14:50:04 +01:00
Luca Cavanna c4edf15633 [TEST] Improved IndexAliasesTests
more assertAcked, removed TODO and needless sleep
2014-01-27 14:50:04 +01:00
Shay Banon c1c2d343c4 move msearch to use atomic array instead of synchronize 2014-01-27 13:22:49 +01:00
Alexander Reelsen 24abb6cf3f Cluster state toXContent serialization only returns needed data
In order to make sure, that only the requested data is returned to the client,
a couple of fixes have been applied in the ClusterState.toXContent() method.
Also some tests were added to the yaml test suite

Closes #4885
2014-01-27 12:04:57 +01:00
Alexander Reelsen 35e5432354 Bulk: Failed preparsing does not fail whole bulk request
If a preparsing of the source is needed (due to mapping configuration,
which extracts the routing/id value from the source) and the source is not
valid JSON, then the whole bulk request is failed instead of a single
BulkRequest.

This commit ensures, that a broken JSON request is not forwarded to the
destination shard and creates an appropriate BulkItemResponse, which
includes a failure.

This also implied changing the BulkItemResponse serialization, because one
cannot be sure anymore, if a response includes an ID, in case it was not
specified and could not be extracted from the JSON.

Closes #4745
2014-01-27 11:33:41 +01:00
David Pilato 4c50770a89 mget REST API should support source parameter
As stated in documentation, we should support `?source=` parameter in mget REST operations.

This is how to reproduce it:

```sh
curl -XDELETE "http://localhost:9200/test"

curl -XPOST "http://localhost:9200/test/type/1?refresh" -d'{
    "foo": "bar"
}'

curl -XPOST "http://localhost:9200/test/type/_mget" -d'{
    "ids": ["1"]
}'

curl -XGET "http://localhost:9200/test/type/_mget?source=%7B%22ids%22%3A%20%5B%221%22%5D%7D"
```

Closes #4892.
2014-01-27 11:05:50 +01:00
Simon Willnauer 1ffdd2ae3f Fix test to use at least one document 2014-01-27 10:42:07 +01:00
Shay Banon b66885dab3 Don't throttle the translog stage of recovery
After copying the index files (which are throttled), we currently throttle the translog as well. The translog phase3 part is performed under a lock, so its better not to throttle it at all, and move it as fast as possible.
2014-01-25 15:47:58 +01:00
Andrew Raines d4f0323917 _cat/allocation: disk.avail can be zero, if so, want to show 100%
Closes #4835
2014-01-24 16:24:45 -06:00
Andrew Raines 92d4cc13c0 _cat/allocation: Guaranteed to have at least zero shards 2014-01-24 16:24:45 -06:00
Simon Willnauer 25b49dd50b Install SecurityManager inside ElasticsearchTestCase for easier randomization
We currently run always with SecurityManager installed. To make sure we
work also without we should randomly swap it out ie. run without the
security manager.
2014-01-24 22:18:05 +01:00
Andrew Raines 4533462025 Add tera and peta to RestTable.renderValue()
Closes #4871
2014-01-24 11:16:11 -06:00
Andrew Raines 4f442497bf Normalize cat headers, add aliases
Closes #4852.
2014-01-24 10:27:03 -06:00
Andrew Raines b34f259313 Remove duplicate cache columns 2014-01-24 10:27:02 -06:00
Luca Cavanna 61158387fe Removed redundant version checks in transport serialization (#4731 leftover) 2014-01-24 16:12:52 +01:00
Luca Cavanna 107a242d38 Removed put/delete warmer tests that were meant to test that the serialization was bw compatible after adding support for acks 2014-01-24 16:05:02 +01:00
Luca Cavanna 1ef3a4a868 Removed duplicated registration of warmers as custom metadata type
Already done in a static block within IndexMetaData
2014-01-24 15:59:07 +01:00
Martijn van Groningen b18ae14555 Removed old serialization logic (<= 1.0-RC1) in readFrom and writeTo methods. 2014-01-24 15:44:40 +01:00
Simon Willnauer 22eb6ba09d Re-Sort config/names 2014-01-24 14:32:50 +01:00
Adrien Grand 9d10c2fca8 Use different field names based on the data type in aggregations tests.
Tests fail once in a while because of a ClassCastException at the mvel level.
We suspect that this happens because a script that is JIT-ed on a specific
data type cannot later be used with another one, but we didn't manage to
reproduce in our development environments, so let's try to change the field
names to see if this error keeps occurring.
2014-01-24 13:48:43 +01:00
Simon Willnauer 663e25ae63 Throw exception if `cluster.name` is specified in TestCluster node settings
We rely on the `cluster.name` setting to be the same across all nodes
and transport clients etc. If a node setting contains `cluster.name`
the test might not work if a random transport client is swapped
in. Passing such a configuration should result in an exception since
it's clearly an illegal state.
2014-01-24 12:11:29 +01:00
Martijn van Groningen 2d58603e81 Added more unit like test that verifies that has_child is never cached even if wrapped by another filter. 2014-01-24 12:03:00 +01:00
uboness 2f32908193 fixed the reduce of InternalGeoHashGrid when executing on a single shard 2014-01-23 21:09:19 +01:00
David Pilato f4411e697e Serving _site plugins do not pick up on index.html for sub directories
If one asks for `http://es:9200/_plugin/PLUGIN_NAME/` and the the plugin's _site directory contains an index.html file, it will be correctly served.

This is not the case for sub directories: a _site/folder/index.html is not served when requesting  `http://es:9200/_plugin/PLUGIN_NAME/folder/` but one gets a 403 Forbidden response as if trying to browse the folder.

Closes #4845.
2014-01-23 20:40:16 +01:00
uboness 56a14e6194 fixed license header indentation 2014-01-23 19:37:08 +01:00
uboness da953700f4 Fixed an issue where there are sug aggregations executing on a single shard, the reduce call was not propagated properly down the agg hierarchy.
Closes #4843
2014-01-23 19:19:55 +01:00
Nik Everett 93a8e80aff Support multiple rescores
Detects if rescores arrive as an array instead of a plain object.  If so
then parse each element of the array as a separate rescore to be executed
one after another.  It looks like this:
   "rescore" : [ {
      "window_size" : 100,
      "query" : {
         "rescore_query" : {
            "match" : {
               "field1" : {
                  "query" : "the quick brown",
                  "type" : "phrase",
                  "slop" : 2
               }
            }
         },
         "query_weight" : 0.7,
         "rescore_query_weight" : 1.2
      }
   }, {
      "window_size" : 10,
      "query" : {
         "score_mode": "multiply",
         "rescore_query" : {
            "function_score" : {
               "script_score": {
                  "script": "log10(doc['numeric'].value + 2)"
               }
            }
         }
      }
   } ]

Rescores as a single object are still supported.

Closes #4748
2014-01-23 16:29:07 +01:00
Simon Willnauer 592a411b2c Make shard balancing deterministic if weights are identical
It happens to be the case that the iteration order of a HashMaps
keyset might be different across runs. This can cause undeterministic
results in shard balancing if weights are identical and multiple shards
of the same index are eligable for relocation. This commit adds
a tie-breaker based on the shard ID to prioritise the lowest shard
ID. This also makes `AddIncrementallyTests#testAddNodesAndIndices`
reproducible.

Closes #4867
2014-01-23 15:57:49 +01:00
Luca Cavanna 3158776438 Parallelized rivers creation in RiverTests#testMultipleRiversStart
Rivers are now registered concurrently from separate threads, one per river.
2014-01-23 15:39:48 +01:00
Luca Cavanna 2058edc117 Made sure rivers _meta documents are retrieved via get with preference _primary
Closes #4864
2014-01-23 15:01:28 +01:00
Simon Willnauer a7a2d9f806 Remove listeners after suite completes in RestTestSuiteRunner
We need to remove the reproduce info printer after the suite
returns otherwise it might print a bogus line if a subsequent
non-rest test fails. The `RunNotifier` is used across suites in
the same JVM and the listener sticks to it.
2014-01-23 14:49:16 +01:00
Paul Horn ed4b15fb4c ClearScrollRequest should set a type parameter
Since ActionRequest requires a bounded type parameter.
2014-01-23 10:49:23 +01:00
Luca Cavanna 922f51fdd5 Added log line to better debug where rivers will get allocated 2014-01-22 23:26:16 +01:00
Simon Willnauer 0a97134757 Add unit tests for NoCache filter infrastructure
If a filter implements `NoCacheFilter` itself and it's
parents should never be cached even if `_cache` is set
to `true` on the parents explicitly.
2014-01-22 14:56:40 +01:00
uboness e9b41c92a4 Added missing support for min_doc_count in DateHistogramBuilder
Closes: #4848
2014-01-22 14:26:28 +01:00
Martijn van Groningen 6cdbdaf388 Added test that verifies that p/c filters never cache.
Made the has_parent & has_child filterbuilder's cache options a noop as well, like it is in the related parsers.

Relates to #4757
2014-01-22 13:35:52 +01:00
Adrien Grand f466b8f292 Add a basic test for date math in date ranges. 2014-01-22 13:30:09 +01:00
Martijn van Groningen f002d39544 Never cache a range filter that uses the `now` date expression.
Closes #4846
2014-01-22 13:28:08 +01:00
Simon Willnauer 1615aba114 Replace Version checks against 1.0 with 1.0RC2 2014-01-22 12:02:37 +01:00
Simon Willnauer d49f099fdb Added tests that ensures all version are in the Version#fromId(int) switch statement 2014-01-22 11:29:29 +01:00
Simon Willnauer 994ad77032 Add 1.0.0RC2 to the version table 2014-01-22 11:29:28 +01:00
Adrien Grand 080ce71d54 Make all aggregators reader-context-aware.
This removes the overhead of polling a Bytes/Double/Long-Values instance in
every call to collect.

Additionally, the AggregationsCollector has been changed to wrap a simple array
instead of an ArrayList.

Close #4841
2014-01-22 11:05:55 +01:00
Adrien Grand 9282ae4ffd Terms aggregations: make size=0 return all terms.
Terms aggregations return up to `size` terms, so up to now, the way to get all
matching terms back was to set `size` to an arbitrary high number that would be
larger than the number of unique terms.

Terms aggregators already made sure to not allocate memory based on the `size`
parameter so this commit mostly consists in making `0` an alias for the
maximum integer value in the TermsParser.

Close #4837
2014-01-22 11:05:10 +01:00
Lee Hinman 2f910fbf7e Accept `defaultOperator` in addition to `default_operator` for simple_query_string 2014-01-21 15:51:06 -07:00
Adrien Grand 1047267021 HistogramAggregator: Finer-grained rounding.
The way `HistogramAggregator` works is that for every value, it is going to
compute a rounded value, that basically looks like
`(value / interval) * interval` and use it as a key in a hash table to
aggregate counts.

However, the exact rounded value is not needed yet at that stage, all we need
is a value that uniquely identifies the bucket, such as `(value / interval)`.
We could only multiply with `interval` again when building the bucket: this way
the second step is only performed once per bucket instead of once per value.

Although this looks like a micro optimization for the case that was just
decribed, it makes more sense with the date rounding implementations that we
have that are more CPU-intensive.

Close #4800
2014-01-21 17:39:01 +01:00
Adrien Grand 92a026b3b9 Throw an ElasticsearchIllegalArgumentException when allocating on a non-data node.
Today, it would fail with a NullPointerException.

Close #4833
2014-01-21 17:31:12 +01:00
Lee Hinman 510fbf12c3 Fix formatting of license header 2014-01-21 09:24:56 -07:00
Lee Hinman 2c289fb538 Add the ability to retrieve fields from field data
Adds a new FetchSubPhase, FieldDataFieldsFetchSubPhase, which loads the
field data cache for a field and returns an array of values for the
field.

Also removes `doc['<field>']` and `_source.<field>` workaround no longer
needed in field name resolving.

Closes #4492
2014-01-21 09:13:32 -07:00
Simon Willnauer 53192919c6 Move to [2.0] snap 2014-01-21 17:07:39 +01:00
Adrien Grand 50174d1790 SearchType randomization in integration tests.
Issue #4754 showed that using DFS_QUERY_THEN_FETCH instead of QUERY_THEN_FETCH
might expose interesting bugs.

Close #4793
2014-01-21 14:31:14 +01:00
Adrien Grand 728a5647c3 Allow to configure indices.fielddata.breaker.limit with a ratio of the heap size.
Close #4616
2014-01-21 13:55:58 +01:00
Luca Cavanna 8f96930638 Deprecated ToXContent.Params#paramAsBooleanOptional in favour of paramAsBoolean
Closes #4817
2014-01-21 11:05:11 +01:00
Luca Cavanna 93d4582641 Deprecated use of partial fields in Java API, was already deprecated in the docs for the search API
Closes #4118
2014-01-21 10:35:52 +01:00
Britta Weber cae5eb479a [SPEC,TEST,FIX] add spec and tests for termvector api and fix inconsistencies
- index and type were not read from the uri with the _mtermvectors api
- ids were not read from the uri parameters with the _mtermvectors api
2014-01-21 10:03:25 +01:00
Martijn van Groningen f2fb114a3e Only refresh id_cache if the parent field is active. 2014-01-21 09:31:45 +01:00
Shay Banon e29659e36d add internal force local flag, used by tribe node
tribe node to set it to true so all master read operations will automatically execute on the local tribe node
2014-01-20 22:40:26 +01:00
Martijn van Groningen 78590a8b6b Removed redundant statements. 2014-01-20 22:32:36 +01:00
Martijn van Groningen efebb8d515 [TESTS] Added percolator rest tests. 2014-01-20 18:18:27 +01:00
Igor Motov 406762f775 Ignore empty config paths 2014-01-20 12:05:05 -05:00
David Pilato 48aaf34f4f River does not start when using config/templates files
From elasticsearch 0.90.6, when you have templates files defined in `config/templates` dir, rivers don't start anymore.

Steps to reproduce:

Create `config/templates/default.json`:

```javascript
{
  default:
  {
    "template" : "*",
    "mappings" : {
      "_default_" : {
      }
    }
  }
}
```

Start a dummy river:

```sh
curl -XPUT 'localhost:9200/_river/my_river/_meta' -d '{ "type" : "dummy" }'
```

It gives:

```
[2014-01-01 22:08:38,151][INFO ][cluster.metadata         ] [Forge] [_river] creating index, cause [auto(index api)], shards [1]/[1], mappings [_default_]
[2014-01-01 22:08:38,239][INFO ][river.routing            ] [Forge] no river _meta document found, retrying in 1000 ms
[2014-01-01 22:08:38,245][INFO ][cluster.metadata         ] [Forge] [_river] update_mapping [my_river] (dynamic)
[2014-01-01 22:08:38,250][INFO ][river.routing            ] [Forge] no river _meta document found, retrying in 1000 ms
[2014-01-01 22:08:39,244][INFO ][river.routing            ] [Forge] no river _meta document found, retrying in 1000 ms
[2014-01-01 22:08:39,252][INFO ][river.routing            ] [Forge] no river _meta document found, retrying in 1000 ms
[2014-01-01 22:08:40,246][INFO ][river.routing            ] [Forge] no river _meta document found, retrying in 1000 ms
[2014-01-01 22:08:40,254][INFO ][river.routing            ] [Forge] no river _meta document found, retrying in 1000 ms
[2014-01-01 22:08:41,246][INFO ][river.routing            ] [Forge] no river _meta document found, retrying in 1000 ms
[2014-01-01 22:08:41,255][INFO ][river.routing            ] [Forge] no river _meta document found, retrying in 1000 ms
[2014-01-01 22:08:42,249][WARN ][river.routing            ] [Forge] no river _meta document found after 5 attempts
[2014-01-01 22:08:42,257][WARN ][river.routing            ] [Forge] no river _meta document found after 5 attempts
```

With elasticsearch 0.90.2 or with no template file in `config/templates` dir, it gives:

```
[2014-01-01 22:22:32,096][INFO ][cluster.metadata         ] [Forge] [_river] creating index, cause [auto(index api)], shards [1]/[1], mappings []
[2014-01-01 22:22:32,221][INFO ][cluster.metadata         ] [Forge] [_river] update_mapping [my_river] (dynamic)
[2014-01-01 22:22:32,228][INFO ][river.dummy              ] [Forge] [dummy][my_river] create
[2014-01-01 22:22:32,228][INFO ][river.dummy              ] [Forge] [dummy][my_river] start
[2014-01-01 22:22:32,234][INFO ][cluster.metadata         ] [Forge] [_river] update_mapping [my_river] (dynamic)
```

Closes #4577.
Closes #4656.
2014-01-20 17:56:39 +01:00
Igor Motov 649f1b13da Initial implementation of custom _all field
Closes #4520
2014-01-20 10:44:33 -05:00
Adrien Grand af1513f908 Add page tracking to MockPageCacheRecycler.
This found an issue in BytesRefHash that forgot to release the start offsets.

Close #4814
2014-01-20 16:23:37 +01:00
Adrien Grand 3586157467 Make StringFieldMapper.toXContent aware of defaults for not_analyzed fields.
StringFieldMapper.toXContent uses the defaults for analyzed fields in order to
know which options to add to the builder. This means that if the field is not
analyzed and has norms enabled, it will omit to emit `norms.enabled: true`.
Parsing the mapping again will result in a StringFieldMapper that has norms
disabled.

The same fix applies to index options.

Close #4760
2014-01-20 16:15:30 +01:00
Adrien Grand 6469f6ef06 Return a conflict when trying to enable/disable norms.
Close #4761
2014-01-20 16:13:58 +01:00
Simon Willnauer f0bce08c30 Return `MatchNoDocsQuery` if query string is emtpy
Closes #3952
2014-01-20 16:08:57 +01:00
Luca Cavanna c8d661608c Follow-up of #4808, same fix applied to ToXContent.MapParams 2014-01-20 15:40:40 +01:00
Alexander Reelsen 53dab85fa2 Fix logging on immediate exit on start
If elasticsearch was started in the foreground an immediate exit on startup
led to logging in the logfile, where as when starting in the background,
an immediate exit logged to stdout.

Closes #4805
2014-01-20 15:31:54 +01:00
Luca Cavanna 32428bf683 Accept the same boolean values in RestRequest
Added `no` as a possible value to `paramBooleanAsOptional`, also reused existing code from `Booleans.parseBoolean`

Closes #4808
2014-01-20 14:27:35 +01:00
Luca Cavanna 55a247e257 master_timeout parameter is now taken into account when calling cluster pending tasks api through the REST layer
Closes #4806
2014-01-20 12:53:55 +01:00
Luca Cavanna 3a558972b2 Added base Request class for read operations that usually happen on the master but can be executed locally.
Added base TransportAction class for master read operations that execute locally or not depending on the request class (local flag).

Added support for local flag where missing, in a backwards compatible manner:
     - IndicesExistsRequest
     - GetAliasesRequest (get alias api, aliases exist api)
     - TypesExistsRequest
     - GetIndexTemplatesRequest (get template, template exists)
     - GetSettingsRequest
     - GetRepositoriesRequest
     - PendingClusterTasks

 Added parsing of the local flag where missing in Rest*Action.

 Updated SPEC adding local flag param where missing and added REST tests that contain use of the local flag where it was just added.

Closes #3345
2014-01-20 12:35:48 +01:00
Luca Cavanna 8b2fe44fe3 [TEST] Better fix for missing create spec
create is a shortcut to index with op_type=create that the clients support
2014-01-20 12:10:43 +01:00
Adrien Grand 62b044697a Fix test bug: test expects at least one child document. 2014-01-20 11:56:27 +01:00
Luca Cavanna 3d0c06e2f4 [TEST] Added create api (hardcoded) to REST tests suite as it has no spec but it's just a variation of the index api 2014-01-20 11:51:23 +01:00
Martijn van Groningen 5bc2a39763 [TESTS] Mapping update might get applied before the first document is indexed on replica, so it is better not to check if the new field isn't available before re-indexing first document. 2014-01-20 11:49:52 +01:00
Matthias Wahl c42f7708be fix IndexOutOfBoundsException on _all field without tokens and keyword analyzer
fix AllEntries to only compute boost when there are actually some Entries available for the _all field

Closes #4771
2014-01-20 11:27:58 +01:00
Martijn van Groningen a7a2f4747d Consume the entire weight and pre compute the DocIdSets for all segments instead of keeping the weight around and build a DocIdSet when a segment is being processed. This fixes issues where the has_child / has_parent filter produce no results or errors on subsequent scan requests.
Also made CustomQueryWrappingFilter implement Releasable in order to cleanup the pre-computed DocIdSets.

Closes #4703
2014-01-20 11:08:29 +01:00
Martijn van Groningen db394117c4 Made sure that any filter that wraps a p/c filter (has_child & has_parent) either directly or indirectly will never be cached by making CustomQueryWrappingFilter extend from NoCacheFilter.
Closes #4757
2014-01-20 10:54:09 +01:00
Simon Willnauer 0e418d18a4 Added no-cache infrastucture the the filter cache.
During query parsing if a filter is encountered that extends from NoCacheFilter then the filter will not be given to the filter cache (also not wrapped in FilterCacheFilterWrapper).
Also if a filter directly or indirectly wraps a NoCacheFilter then that filter will also not be cached.

Relates to #4757
2014-01-20 10:45:13 +01:00
Alexander Reelsen e34a35244c [DOCS] Added documentation for CAT Aliases API
Added asciidoc. Added new lines in java class.
2014-01-20 09:23:00 +01:00
Simon Willnauer 67efe8777a Remove unnecessary optimize call that destabelizes test 2014-01-18 20:06:55 +01:00
Adrien Grand 6159343c61 Fix HistogramAggregationSearchBenchmark. 2014-01-17 22:29:27 +01:00
Andy Goldstein b674827eb6 Add transport.publish_port setting
Add transport.publish_port setting to allow users to specify the port
other cluster members should use when connecting to an instance. This
is needed for systems such as OpenShift, where cluster communication
needs to use a publicly accessibly proxy port, because the normal port
(9300) is bound to a private loopback IP address.
2014-01-17 22:06:22 +01:00
Costin Leau 16a70d6005 apply line ending fix only on Windows
fix for #4785
2014-01-17 20:03:31 +02:00
Luca Cavanna de893d80de [SPEC] Removed _source endpoint from get api spec, as the get_source is a different api already
Also removed custom code that was required in the REST tests due to this.
2014-01-17 18:05:07 +01:00
Simon Willnauer 42377db084 Check ThreadInfo[] for null element if thread are not alive.
If a thread is not alive getting ThreadMXBean#getThreadInfo(long[], int)
places null elemnents in the returned array which are not repected
in the HotTheards API.

Closes #4775
2014-01-17 17:14:19 +01:00
Luca Cavanna 3ac2f8c789 [TEST] fixed error message in REST tests runner 2014-01-17 16:41:19 +01:00
Luca Cavanna 841db7c295 Removed double masterNodeTimeout set in RestPutRepositoryAction 2014-01-17 15:39:42 +01:00
Andrew Raines 3f14725057 Use millis for joda DateTimeFormatter.print()
Fixes #4782.
2014-01-17 08:37:23 -06:00
Simon Willnauer 7f51fbc5ab Add SecurityManger / policy when running tests.
This commit adds a security manager to the test JVMs
that prevents mainly writing files outside of the JVMs
current test directory.
2014-01-17 15:15:10 +01:00
Simon Willnauer da707b6f32 Remove `omit_term_freq_and_positions` for new indices
`omit_term_freq_and_positions` was deprecated in `0.20` and
is not documented anymore. We should reject indices that are
created with this option in the future.

Closes #4722
2014-01-17 14:46:48 +01:00
Simon Willnauer 0d8330b50a Cleanup tests - using assert method instead of assert keyword 2014-01-17 14:13:26 +01:00
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