Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Scripting cleanup, removed ScriptFile #1364

Merged
merged 1 commit into from
Aug 30, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@ All notable changes to this project will be documented in this file based on the
- In QueryString is not allowed to use fields parameters in conjunction with default_field parameter. This is not well documented, it's possibile to understand from [Elasticsearch tests : QueryStringQueryBuilderTests.java](https://github.com/elastic/elasticsearch/blob/6.0/core/src/test/java/org/elasticsearch/index/query/QueryStringQueryBuilderTests.java#L917) [#1352](https://github.com/ruflin/Elastica/pull/1352)
- Index mapping field of type [*'string'*](https://www.elastic.co/guide/en/elasticsearch/reference/5.5/string.html) has been removed from Elasticsearch 6.0 codebase [#1353](https://github.com/ruflin/Elastica/pull/1353)
- The [created and found](https://github.com/elastic/elasticsearch/pull/25516) fields in index and delete responses became obsolete after the introduction of the result field in index, update and delete responses [#1354](https://github.com/ruflin/Elastica/pull/1354)
- Removed file scripts [#24627](https://github.com/elastic/elasticsearch/pull/24627) [#1364](https://github.com/ruflin/Elastica/pull/1364)
- Removed [groovy script](https://github.com/elastic/elasticsearch/pull/21607) [#1364](https://github.com/ruflin/Elastica/pull/1364)
- Removed [native script](https://github.com/elastic/elasticsearch/pull/24726) [#1364](https://github.com/ruflin/Elastica/pull/1364)
- Removed old / removed script language support : javascript, python, mvel [#1364](https://github.com/ruflin/Elastica/pull/1364)

### Bugfixes
- Enforce [Content-Type requirement on the layer Rest](https://github.com/elastic/elasticsearch/pull/23146), a [PR on Elastica #1301](https://github.com/ruflin/Elastica/issues/1301) solved it (it has been implemented only in the HTTP Transport), but it was not implemented in the Guzzle Transport. [#1349](https://github.com/ruflin/Elastica/pull/1349)
Expand Down
16 changes: 2 additions & 14 deletions lib/Elastica/Script/AbstractScript.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,7 @@
*/
abstract class AbstractScript extends AbstractUpdateAction
{
const LANG_MVEL = 'mvel';
const LANG_JS = 'js';
const LANG_GROOVY = 'groovy';
const LANG_PYTHON = 'python';
const LANG_NATIVE = 'native';
const LANG_MOUSTACHE = 'moustache';
const LANG_EXPRESSION = 'expression';
const LANG_PAINLESS = 'painless';

Expand All @@ -37,7 +33,7 @@ abstract class AbstractScript extends AbstractUpdateAction
*
* @throws InvalidException
*
* @return Script|ScriptFile|ScriptId
* @return Script|ScriptId
*/
public static function create($data)
{
Expand Down Expand Up @@ -75,14 +71,6 @@ private static function _createFromArray(array $data)
);
}

if (isset($data['script']['file'])) {
return new ScriptFile(
$data['script']['file'],
$params,
$lang
);
}

if (isset($data['script']['id'])) {
return new ScriptId(
$data['script']['id'],
Expand Down
60 changes: 0 additions & 60 deletions lib/Elastica/Script/ScriptFile.php

This file was deleted.

1 change: 1 addition & 0 deletions test/Elastica/Index/SettingsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,7 @@ public function testGetDefaultNumberOfShards()
{
$index = $this->_createIndex();
$index->create([], true);
$index->refresh();

$settings = $index->getSettings();

Expand Down
190 changes: 0 additions & 190 deletions test/Elastica/Script/ScriptFileTest.php

This file was deleted.

4 changes: 2 additions & 2 deletions test/Elastica/Script/ScriptIdTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -143,8 +143,8 @@ public function testSetLang()
{
$script = new ScriptId(self::SCRIPT_ID, [], ScriptId::LANG_PAINLESS);

$this->assertSame($script, $script->setLang(ScriptId::LANG_GROOVY));
$this->assertEquals(ScriptId::LANG_GROOVY, $script->getLang());
$this->assertSame($script, $script->setLang(ScriptId::LANG_PAINLESS));
$this->assertEquals(ScriptId::LANG_PAINLESS, $script->getLang());
}

/**
Expand Down
4 changes: 2 additions & 2 deletions test/Elastica/Script/ScriptTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -142,8 +142,8 @@ public function testSetLang()
{
$script = new Script(self::SCRIPT, [], Script::LANG_PAINLESS);

$this->assertSame($script, $script->setLang(Script::LANG_GROOVY));
$this->assertEquals(Script::LANG_GROOVY, $script->getLang());
$this->assertSame($script, $script->setLang(Script::LANG_PAINLESS));
$this->assertEquals(Script::LANG_PAINLESS, $script->getLang());
}

/**
Expand Down