Commit Graph

23875 Commits

Author SHA1 Message Date
Ali Beyad 04e8272607 Fixes netty4 module's CORS config to use defaults (#19874)
Fixes netty4 CORS config to use defaults for `http.cors.allow-methods`
and `http.cors.allow-headers` when none are specified.
2016-08-10 16:47:21 -04:00
Luca Cavanna 8a0d71924c Merge pull request #19926 from javanna/enhancement/threadcontext_cleanup
Reduce ThreadContext's inner classes visibility
2016-08-10 20:38:33 +02:00
Jun Ohtani f63fcefbd0 Stop using cached component in _analyze API
Stop calling tokenizer/tokenFilters/chaFilter method of IndexService
Add some getAnalysisProvider methods
Change SynonymTokenFilterFactory constructor

Closes #19827
2016-08-11 02:41:34 +09:00
Christoph Büscher 563bf0154c Merge pull request #19920 from cbuescher/remove-SuggestUtil
Remove SuggestUtil helper class
2016-08-10 19:22:22 +02:00
David Pilato acc50d5817 Update documentation after merge with master 2016-08-10 19:07:22 +02:00
David Pilato 42f851cf49 Merge branch 'master' into fix/19924-attachment 2016-08-10 19:05:22 +02:00
David Pilato 905684fe73 Adds content-length as number
If you run Elasticsearch with the ingest-attachment plugin:

```sh
gradle plugins:ingest-attachment:run
```

And then you use it on a document:

```js
 PUT _ingest/pipeline/attachment
 {
   "description" : "Extract attachment information",
   "processors" : [
     {
       "attachment" : {
         "field" : "data"
       }
     }
   ]
 }
 PUT my_index/my_type/my_id?pipeline=attachment
 {
   "data": "e1xydGYxXGFuc2kNCkxvcmVtIGlwc3VtIGRvbG9yIHNpdCBhbWV0DQpccGFyIH0="
 }
 GET my_index/my_type/my_id
```

 You were getting this back:

```js
 # PUT _ingest/pipeline/attachment
 {
   "acknowledged": true
 }

 # PUT my_index/my_type/my_id?pipeline=attachment
 {
   "_index": "my_index",
   "_type": "my_type",
   "_id": "my_id",
   "_version": 2,
   "result": "updated",
   "_shards": {
     "total": 2,
     "successful": 1,
     "failed": 0
   },
   "created": false
 }

 # GET my_index/my_type/my_id
 {
   "_index": "my_index",
   "_type": "my_type",
   "_id": "my_id",
   "_version": 2,
   "found": true,
   "_source": {
     "data": "e1xydGYxXGFuc2kNCkxvcmVtIGlwc3VtIGRvbG9yIHNpdCBhbWV0DQpccGFyIH0=",
     "attachment": {
       "content_type": "application/rtf",
       "language": "ro",
       "content": "Lorem ipsum dolor sit amet",
       "content_length": "28"
     }
   }
 }
```

With this commit you are now getting:

```
 # GET my_index/my_type/my_id
 {
   "_index": "my_index",
   "_type": "my_type",
   "_id": "my_id",
   "_version": 2,
   "found": true,
   "_source": {
     "data": "e1xydGYxXGFuc2kNCkxvcmVtIGlwc3VtIGRvbG9yIHNpdCBhbWV0DQpccGFyIH0=",
     "attachment": {
       "content_type": "application/rtf",
       "language": "ro",
       "content": "Lorem ipsum dolor sit amet",
       "content_length": 28
     }
   }
 }
```

Closes #19924
2016-08-10 18:31:16 +02:00
Nik Everett f204ad026c Add complete examples to some ingest docs
These examples should make it more clear what the plugins do and they
test that the snippets actually work.

Relates to #18160
2016-08-10 12:09:25 -04:00
javanna ea6b7b46c9 reduce ThreadContext's inner classes visibility 2016-08-10 18:06:35 +02:00
Christoph Büscher d11521318d Renaming method according to review comments 2016-08-10 18:03:39 +02:00
Adrien Grand 0d6ac57acf Collapse o.e.index.mapper packages. #19921
I also reduced the visibility of a couple classes and renamed/consolidated some
test classes for consistency, eg. removing the `Simple` prefix or using the
`<Type>FieldMapperTests` convention for testing field mappers.
2016-08-10 17:51:11 +02:00
Jason Tedor e899e8b4e0 Reword expect header bug notice
This commit rewords the expect header bug notice to provide the precise
details for the bug arising. In particular, the bug does not impact any
request over 1024 bytes, but instead impacts any request with a body
that is sent in two requests, the first with an Expect: 100-continue
header. The size is irrelevant, and requests with bodies larger than
1024 bytes are okay as long as the Expect: 100-continue header is not
also sent.

Relates #19911
2016-08-10 10:42:58 -04:00
Jason Tedor 1e91f3b779 Disable all annotation processors
Some unused annotation processors caused build-time failures. Instead,
we should just be explicit about which annotation processors we will use
(if any) with additional command-line flags.

Relates #19919
2016-08-10 10:42:28 -04:00
Christoph Büscher 9c91ced029 Removing use of ParseFields where we have alternative in other classes already 2016-08-10 16:20:34 +02:00
Christoph Büscher e6d57af0c5 Moving join() helper function to WordScorer 2016-08-10 16:20:33 +02:00
Christoph Büscher cdc77648a1 Move analysis helper methods to DirectCandidateGenerator 2016-08-10 16:20:29 +02:00
Christoph Büscher d6e16b6e74 Move getDirectSpellChecker to DirectSpellcheckerSettings 2016-08-10 16:06:05 +02:00
Luca Cavanna 05d0402fae Merge pull request #19914 from javanna/enhancement/suggestutils_cleanup
Move SuggestUtils methods to their respective caller classes
2016-08-10 16:01:28 +02:00
Thomas Decaux bf2e5cb988 [docs] Remove extra "s" at buckets_path snippet
Closes #19907
2016-08-10 08:56:00 -04:00
Tanguy Leroux cefc346d37 [Test] Add test for Netty4 HTTP support of header 100-continue (#19908)
* [Test] Add test for Netty4 HTTP support of header 100-continue

Related to #19904

* Update after David comments
2016-08-10 07:22:18 -04:00
Jason Tedor f025c83a17 Fix expect 100 continue header handling
Due to a misordering of the HTTP handlers, the Netty 4 HTTP server
mishandles Expect: 100-continue headers from clients. This commit fixes
this issue by ordering the handlers correctly.

Relates #19904
2016-08-10 07:21:22 -04:00
javanna a13dbc12e2 SuggestUtils#analyze: assign success variable a value 2016-08-10 12:57:24 +02:00
javanna a0e32e9dfe move SuggestUtils methods to their respective callers
These methods are called only once, they are then moved to the classes that call them, and become private.
2016-08-10 12:54:38 +02:00
Luca Cavanna 4ed7c2bd35 Merge pull request #19906 from javanna/enhancement/suggest_utils_unused_methods
Remove unused methods from SuggestUtils
2016-08-10 12:36:25 +02:00
javanna ae78394c03 Remove redundant generics type declaration 2016-08-10 12:28:06 +02:00
javanna 297b2d6739 remove unused methods from SuggestUtils
Parsing code was moved to the builder objects, these methods were left behind unused
2016-08-10 12:28:06 +02:00
Luca Cavanna 615daa10d8 Merge pull request #19864 from javanna/enhancement/query_parse_unknown_objects
[TEST] make AbstractQueryTestCase#testUnknownObjectException more accurate
2016-08-10 12:26:13 +02:00
javanna 7d4a6499e1 [TEST] add inline comments to AbstractQueryTestCase#unknownObjectExceptionTest 2016-08-10 12:21:25 +02:00
javanna 8391e6de37 [TEST] enable testUnknownObjectException for alternate query versions too 2016-08-10 12:21:25 +02:00
javanna 2c44278ce8 [TEST] use ParseField instead of plain strings in query tests 2016-08-10 12:21:25 +02:00
javanna 0a98b5e56e [TEST] make AbstractQueryTestCase#testUnknownObjectException more accurate
testUnknownObjectException used to generate malformed json objects in some cases, due to the existence of arrays as it was not closing the injected object correctly. That is why the test was catching JsonParseException among the exception that are expected to be thrown. That is fixed by tracking where the new object is placed and placing its end object marker to the right level rather than always at the end.

Also introduced a mechanism to explicitly declare objects that won't cause any exception when they get additional objects injected, so that there is no need to override the method anymore as that caused copy pasting of the whole test method. This also makes sure that changes are reflected in tests, as those inner objects are not skipped but we actually check that what is declared is true (no exceptions get thrown when an additional object is added within them.
2016-08-10 11:48:51 +02:00
javanna f221b0ce52 [TEST] inner_hits is now parsed on the coord node, no need to skip such objects in testUnknownObjectException 2016-08-10 11:48:51 +02:00
javanna 57b90cb6ce rename local loop variable ingore->ignore 2016-08-10 10:17:54 +02:00
Clinton Gormley 83532ac377 Documented netty4 Expect bug in release notes and breaking changes 2016-08-10 10:16:25 +02:00
Adrien Grand 42725e9339 Fix expectations of GeoPointFieldMapperTests.
Closes #19895
2016-08-10 09:30:39 +02:00
Pius 5f3883ed11 Merge pull request #19902 from elastic/ppf2-doc-snapshot-restore-to-newer-cluster-1
Clarified statement on restoring a snapshot to a cluster on a newer version.
2016-08-09 20:44:05 -07:00
Pius 40f3b5ab76 Update snapshots.asciidoc
>However, the version of the new cluster should be the same or newer than the cluster that was

Afaik, you can't restore a snapshot to a newer cluster that is not consecutively newer (i.e. can't restore 1.x snapshot to a 5.x cluster).  This is to clarify the statement above moving forward.
2016-08-09 18:22:29 -07:00
Deb Adair c522568d1b Docs: Fixed typos in example buckets_paths > buckets_path. 2016-08-09 14:37:37 -07:00
Ryan Ernst 38d4382565 Mappings: Support dots in field names in mapping parsing
This change adds support for treating dots in field names found in
mappings as path separators, like was previously done for dynamic
mappings and document parsing.

closes #19443
2016-08-09 14:35:35 -07:00
Ryan Ernst 6efbe54255 Remove alpha5 bwc indexes
We don't have bwc indexes for alpha releases.
2016-08-09 13:25:16 -07:00
Ali Beyad 601602b364 Check restores in progress before deleting a snapshot (#19853)
Currently, when attempting to delete a snapshot, we check
if a snapshot is in progress before proceeding with the
delete. However, we do not check if a restore is taking
place before deleting. This can lead to concurrency issues
where a restore is in progress but the snapshotted files
for the restore are being deleted underneath.

This commit first checks if a restore is in progress and
if so, it prevents the deletion of a snapshot with an
exception.

Note that this is not a complete solution because it is
still possible that a restore of the same snapshot is
started after the deletion commenced but before the
deletion finished. But there is a much smaller window
for this to occur and this commit is a quick way to
check for the common case.
2016-08-09 15:07:09 -05:00
Areek Zillur 16d93e5a53 Merge pull request #19877 from areek/fix/remove_completion_payload
Remove payload option from completion suggester
2016-08-09 15:27:29 -04:00
David Pilato 90dbce9682 Merge branch 'fix/19772-toString' 2016-08-09 20:37:27 +02:00
Lee Hinman 5849c488b5 Merge remote-tracking branch 'dakrone/compliation-breaker' 2016-08-09 11:57:26 -06:00
Ali Beyad d915230a06 Clarifies the documentation for the `http.cors.enabled` setting (#19890)
Clarifies the documentation for the `http.cors.enabled` setting
2016-08-09 12:54:38 -05:00
David Pilato 8bc15039cd Fix after review 2016-08-09 19:44:42 +02:00
Clinton Gormley 0dd6f63c49 Fixed missing changes in the version bump to alpha6 2016-08-09 18:52:03 +02:00
Clinton Gormley eac14f6e3d Bumped version to 5.0.0-alpha6 and added bwc indices for alpha5 2016-08-09 18:31:27 +02:00
Lee Hinman 2be52eff09 Circuit break the number of inline scripts compiled per minute
When compiling many dynamically changing scripts, parameterized
scripts (<https://www.elastic.co/guide/en/elasticsearch/reference/master/modules-scripting-using.html#prefer-params>)
should be preferred. This enforces a limit to the number of scripts that
can be compiled within a minute. A new dynamic setting is added -
`script.max_compilations_per_minute`, which defaults to 15.

If more dynamic scripts are sent, a user will get the following
exception:

```json
{
  "error" : {
    "root_cause" : [
      {
        "type" : "circuit_breaking_exception",
        "reason" : "[script] Too many dynamic script compilations within one minute, max: [15/min]; please use on-disk, indexed, or scripts with parameters instead",
        "bytes_wanted" : 0,
        "bytes_limit" : 0
      }
    ],
    "type" : "search_phase_execution_exception",
    "reason" : "all shards failed",
    "phase" : "query",
    "grouped" : true,
    "failed_shards" : [
      {
        "shard" : 0,
        "index" : "i",
        "node" : "a5V1eXcZRYiIk8lecjZ4Jw",
        "reason" : {
          "type" : "general_script_exception",
          "reason" : "Failed to compile inline script [\"aaaaaaaaaaaaaaaa\"] using lang [painless]",
          "caused_by" : {
            "type" : "circuit_breaking_exception",
            "reason" : "[script] Too many dynamic script compilations within one minute, max: [15/min]; please use on-disk, indexed, or scripts with parameters instead",
            "bytes_wanted" : 0,
            "bytes_limit" : 0
          }
        }
      }
    ],
    "caused_by" : {
      "type" : "general_script_exception",
      "reason" : "Failed to compile inline script [\"aaaaaaaaaaaaaaaa\"] using lang [painless]",
      "caused_by" : {
        "type" : "circuit_breaking_exception",
        "reason" : "[script] Too many dynamic script compilations within one minute, max: [15/min]; please use on-disk, indexed, or scripts with parameters instead",
        "bytes_wanted" : 0,
        "bytes_limit" : 0
      }
    }
  },
  "status" : 500
}
```

This also fixes a bug in `ScriptService` where requests being executed
concurrently on a single node could cause a script to be compiled
multiple times (many in the case of a powerful node with many shards)
due to no synchronization between checking the cache and compiling the
script. There is now synchronization so that a script being compiled
will only be compiled once regardless of the number of concurrent
searches on a node.

Relates to #19396
2016-08-09 10:26:27 -06:00
Lee Hinman 2f8e3db1e8 Add quotes to prevent shell globbing in TESTING.asciidoc 2016-08-09 09:11:45 -06:00