3430 Commits

Author SHA1 Message Date
uboness
164f7b981e Fixed an issue where and IndexOutOfBoundsException was thrown when a date_/histogram aggregation was defined on unmapped field and also had a sub aggregation. The root cause there was that in such case, the estimated bucket count was 0, and the code was not designed to handle that well.
Closes #5179
2014-02-21 02:51:46 +01:00
Benjamin Devèze
57fcd761f2 Fix possible exception in toCamelCase method 2014-02-21 00:08:13 +01:00
Benjamin Devèze
bb219eff8d Remove useless URL instanciation 2014-02-21 00:07:48 +01:00
Kelsey Francis
55101edb46 Fix yamlBuilder() to return YAML builder instead of SMILE
Closes #5185
2014-02-21 00:00:28 +01:00
Lee Hinman
8f8cc7205d Add "locale" parameter to query_string and simple_query_string
Fixes #5128

Remove java 7 specific Locale functions, add "coming[1.1.0]" to documentation

add LocaleUtils utility class for dealing with Locale functions
2014-02-20 15:53:08 -07:00
Adrien Grand
96d028e721 Disable RAM usage estimation on Lucene 3.x segments.
Close #5201
2014-02-20 23:45:22 +01:00
uboness
428080b49a Changed the caching of FieldDataSource in aggs to be based on field name + required Value Source type as a combi key (used to be only field name). This fixes a problem where multiple aggregations where defined on the same field, yet require different types of value sources.
Closes #5190
2014-02-20 22:33:32 +01:00
David Pilato
ecb3df6f4c Wait for REST Service to start
When running tests for site plugins, it could happen that the REST Service is not fully started and not ready immediately to serve HTTP requests.
It gives `503 Service Unavailable` error in that case.

This patch will gives 5 seconds before failing the test.
2014-02-20 17:57:58 +01:00
Isabel Drost-Fromm
ff7a9ff1fd Fixing license headers. 2014-02-20 14:35:57 +01:00
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