Commit Graph

7371 Commits

Author SHA1 Message Date
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
Luca Cavanna 95bf091dd6 [DOCS] unified index settings info and added warmers section in create index docs 2014-01-27 17:10:38 +01: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 da1e3ed8fc [TEST] Added REST tests for create index api 2014-01-27 14:50:04 +01: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 09575eb95f Revert mget yaml test changes
Relative to #4892
2014-01-27 11:28:32 +01:00
David Pilato fdbdb705b9 Revert mget yaml test changes
Relative to #4892
2014-01-27 11:25:39 +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
Costin Leau 2690019e95 update link to Hadoop Snapshot/Restore plugin 2014-01-25 18:27:14 +02: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
Clinton Gormley 1aa1e83e03 [DOCS] Updated the breaking changes for the fields param
Closes #4888
2014-01-25 12:34:15 +01:00
mrsolo 9a37922e57 fix if hook failure when running under jenkins
Local mode modification done previously faulty.  env[‘WORKSPACE’ is not
the sufficient discriminator to see if script is running under Jenkins.
  This fails on the Jenkins parent jobs since those type of jobs don’t
have WORKSPACE set.
2014-01-24 15:59:48 -08: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
Karel Minarik 241bb09db1 [DOCS] More assertive statement about requiring `query` in _count, etc 2014-01-23 20:35:44 +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
Nik Everett 37f80c8d80 Documentation for score_mode
Closes #4742
2014-01-23 16:24:48 +01:00
Simon Willnauer 55e8df40cd Move provided lucene-expression jar below the test-framework
Having a dep that refrences lucene-core before the test framework
confuses some runners.
2014-01-23 16:10:57 +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
Simon Willnauer 416e328cea Mark 'lucene-expression' as 'provided' in pom.xml
We currently pull in the lucene-expression module that is referenced
by lucene-suggest. Yet, we don't make use of this dependency at all
and it pulls in a bunch of unshaded libs like `antlr` and `asm` which
are pretty common in other projects. We should exclude this
dependency since we don't use it at all and it causes problems
when Elasticsearch is used as a node client. (see #4858)

If we mark the dependency as provided it won't be included in the
distribution.

Closes #4859
Closes #4858
2014-01-23 14:23:41 +01:00
Brusic d9b71a8083 [DOCS] various docs fixes
Removed unused misc.asciidoc file
Added plugins directory to directory layout
Fixed transport.tcp.connect_timeout value to match the code found in NetworkService.TcpSettings
Clarified that phrase query does not preserve order of terms
Clarified merge page
Added instructions on how to build documentation to docs/README
2014-01-23 10:52:13 +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