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

Fix pre 7.2 endpoint class name with aliases + reapply fix #947 #968

Merged
merged 5 commits into from
Nov 26, 2019
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
3 changes: 3 additions & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,9 @@
"monolog/monolog": "Allows for client-level logging and tracing"
},
"autoload": {
"files": [
"src/autoload.php"
],
"psr-4": {
"Elasticsearch\\": "src/Elasticsearch/"
}
Expand Down
56 changes: 10 additions & 46 deletions src/Elasticsearch/Client.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
*/
class Client
{
const VERSION = '7.4.0';
const VERSION = '7.4.1';

/**
* @var Transport
Expand All @@ -58,31 +58,37 @@ class Client
* @var CatNamespace
*/
protected $cat;

/**
* @var ClusterNamespace
*/
protected $cluster;

/**
* @var IndicesNamespace
*/
protected $indices;

/**
* @var IngestNamespace
*/
protected $ingest;

/**
* @var NodesNamespace
*/
protected $nodes;

/**
* @var SnapshotNamespace
*/
protected $snapshot;

/**
* @var TasksNamespace
*/
protected $tasks;


/**
* Client constructor
Expand Down Expand Up @@ -138,7 +144,6 @@ public function bulk(array $params = [])

return $this->performRequest($endpoint);
}

/**
* $params['scroll_id'] = DEPRECATED (list) A comma-separated list of scroll IDs to clear
* $params['body'] = (array) A comma-separated list of scroll IDs to clear if none was specified via the scroll_id parameter
Expand All @@ -160,7 +165,6 @@ public function clearScroll(array $params = [])

return $this->performRequest($endpoint);
}

/**
* $params['index'] = (list) A comma-separated list of indices to restrict the results
* $params['type'] = DEPRECATED (list) A comma-separated list of types to restrict the results
Expand Down Expand Up @@ -199,7 +203,6 @@ public function count(array $params = [])

return $this->performRequest($endpoint);
}

/**
* $params['id'] = (string) Document ID (Required)
* $params['index'] = (string) The name of the index (Required)
Expand Down Expand Up @@ -234,7 +237,6 @@ public function create(array $params = [])

return $this->performRequest($endpoint);
}

/**
* $params['id'] = (string) The document ID (Required)
* $params['index'] = (string) The name of the index (Required)
Expand Down Expand Up @@ -267,7 +269,6 @@ public function delete(array $params = [])

return $this->performRequest($endpoint);
}

/**
* $params['index'] = (list) A comma-separated list of index names to search; use `_all` or empty string to perform the operation on all indices (Required)
* $params['type'] = DEPRECATED (list) A comma-separated list of document types to search; leave empty to perform the operation on all types
Expand Down Expand Up @@ -324,7 +325,6 @@ public function deleteByQuery(array $params = [])

return $this->performRequest($endpoint);
}

/**
* $params['task_id'] = (string) The task id to rethrottle
* $params['requests_per_second'] = (number) The throttle to set on this request in floating sub-requests per second. -1 means set no throttle. (Required)
Expand All @@ -344,7 +344,6 @@ public function deleteByQueryRethrottle(array $params = [])

return $this->performRequest($endpoint);
}

/**
* $params['id'] = (string) Script ID
* $params['timeout'] = (time) Explicit operation timeout
Expand All @@ -365,7 +364,6 @@ public function deleteScript(array $params = [])

return $this->performRequest($endpoint);
}

/**
* $params['id'] = (string) The document ID (Required)
* $params['index'] = (string) The name of the index (Required)
Expand Down Expand Up @@ -403,7 +401,6 @@ public function exists(array $params = []): bool

return BooleanRequestWrapper::performRequest($endpoint, $this->transport);
}

/**
* $params['id'] = (string) The document ID (Required)
* $params['index'] = (string) The name of the index (Required)
Expand Down Expand Up @@ -440,7 +437,6 @@ public function existsSource(array $params = []): bool

return BooleanRequestWrapper::performRequest($endpoint, $this->transport);
}

/**
* $params['id'] = (string) The document ID (Required)
* $params['index'] = (string) The name of the index (Required)
Expand Down Expand Up @@ -480,7 +476,6 @@ public function explain(array $params = [])

return $this->performRequest($endpoint);
}

/**
* $params['index'] = (list) A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices
* $params['fields'] = (list) A comma-separated list of field names
Expand All @@ -504,7 +499,6 @@ public function fieldCaps(array $params = [])

return $this->performRequest($endpoint);
}

/**
* $params['id'] = (string) The document ID (Required)
* $params['index'] = (string) The name of the index (Required)
Expand Down Expand Up @@ -539,7 +533,6 @@ public function get(array $params = [])

return $this->performRequest($endpoint);
}

/**
* $params['id'] = (string) Script ID
* $params['master_timeout'] = (time) Specify timeout for connection to master
Expand All @@ -559,7 +552,6 @@ public function getScript(array $params = [])

return $this->performRequest($endpoint);
}

/**
* $params['id'] = (string) The document ID (Required)
* $params['index'] = (string) The name of the index (Required)
Expand Down Expand Up @@ -593,7 +585,6 @@ public function getSource(array $params = [])

return $this->performRequest($endpoint);
}

/**
* $params['id'] = (string) Document ID
* $params['index'] = (string) The name of the index (Required)
Expand Down Expand Up @@ -631,7 +622,6 @@ public function index(array $params = [])

return $this->performRequest($endpoint);
}

/**
*
* @param array $params Associative array of parameters
Expand All @@ -647,7 +637,6 @@ public function info(array $params = [])

return $this->performRequest($endpoint);
}

/**
* $params['index'] = (string) The name of the index
* $params['type'] = DEPRECATED (string) The type of the document
Expand Down Expand Up @@ -680,7 +669,6 @@ public function mget(array $params = [])

return $this->performRequest($endpoint);
}

/**
* $params['index'] = (list) A comma-separated list of index names to use as default
* $params['type'] = DEPRECATED (list) A comma-separated list of document types to use as default
Expand Down Expand Up @@ -712,7 +700,6 @@ public function msearch(array $params = [])

return $this->performRequest($endpoint);
}

/**
* $params['index'] = (list) A comma-separated list of index names to use as default
* $params['type'] = DEPRECATED (list) A comma-separated list of document types to use as default
Expand Down Expand Up @@ -741,7 +728,6 @@ public function msearchTemplate(array $params = [])

return $this->performRequest($endpoint);
}

/**
* $params['index'] = (string) The index in which the document resides.
* $params['type'] = DEPRECATED (string) The type of the document.
Expand Down Expand Up @@ -770,15 +756,14 @@ public function mtermvectors(array $params = [])
$body = $this->extractArgument($params, 'body');

$endpointBuilder = $this->endpoints;
$endpoint = $endpointBuilder('Mtermvectors');
$endpoint = $endpointBuilder('MTermVectors');
$endpoint->setParams($params);
$endpoint->setIndex($index);
$endpoint->setType($type);
$endpoint->setBody($body);

return $this->performRequest($endpoint);
}

/**
*
* @param array $params Associative array of parameters
Expand All @@ -797,7 +782,6 @@ public function ping(array $params = []): bool

return BooleanRequestWrapper::performRequest($endpoint, $this->transport);
}

/**
* $params['id'] = (string) Script ID (Required)
* $params['context'] = (string) Script context
Expand All @@ -824,7 +808,6 @@ public function putScript(array $params = [])

return $this->performRequest($endpoint);
}

/**
* $params['index'] = (list) A comma-separated list of index names to search; use `_all` or empty string to perform the operation on all indices
* $params['ignore_unavailable'] = (boolean) Whether specified concrete indices should be ignored when unavailable (missing or closed)
Expand Down Expand Up @@ -852,7 +835,6 @@ public function rankEval(array $params = [])

return $this->performRequest($endpoint);
}

/**
* $params['refresh'] = (boolean) Should the effected indexes be refreshed?
* $params['timeout'] = (time) Time each individual bulk request should wait for shards that are unavailable. (Default = 1m)
Expand All @@ -879,7 +861,6 @@ public function reindex(array $params = [])

return $this->performRequest($endpoint);
}

/**
* $params['task_id'] = (string) The task id to rethrottle
* $params['requests_per_second'] = (number) The throttle to set on this request in floating sub-requests per second. -1 means set no throttle. (Required)
Expand All @@ -899,7 +880,6 @@ public function reindexRethrottle(array $params = [])

return $this->performRequest($endpoint);
}

/**
* $params['id'] = (string) The id of the stored search template
* $params['body'] = (array) The search definition template and its params
Expand All @@ -921,7 +901,6 @@ public function renderSearchTemplate(array $params = [])

return $this->performRequest($endpoint);
}

/**
* $params['body'] = (array) The script to execute
*
Expand All @@ -943,7 +922,6 @@ public function scriptsPainlessExecute(array $params = [])

return $this->performRequest($endpoint);
}

/**
* $params['scroll_id'] = DEPRECATED (string) The scroll ID
* $params['scroll'] = (time) Specify how long a consistent view of the index should be maintained for scrolled search
Expand All @@ -967,7 +945,6 @@ public function scroll(array $params = [])

return $this->performRequest($endpoint);
}

/**
* $params['index'] = (list) A comma-separated list of index names to search; use `_all` or empty string to perform the operation on all indices
* $params['type'] = DEPRECATED (list) A comma-separated list of document types to search; leave empty to perform the operation on all types
Expand Down Expand Up @@ -1034,7 +1011,6 @@ public function search(array $params = [])

return $this->performRequest($endpoint);
}

/**
* $params['index'] = (list) A comma-separated list of index names to search; use `_all` or empty string to perform the operation on all indices
* $params['preference'] = (string) Specify the node or shard the operation should be performed on (default: random)
Expand All @@ -1059,7 +1035,6 @@ public function searchShards(array $params = [])

return $this->performRequest($endpoint);
}

/**
* $params['index'] = (list) A comma-separated list of index names to search; use `_all` or empty string to perform the operation on all indices
* $params['type'] = DEPRECATED (list) A comma-separated list of document types to search; leave empty to perform the operation on all types
Expand Down Expand Up @@ -1096,7 +1071,6 @@ public function searchTemplate(array $params = [])

return $this->performRequest($endpoint);
}

/**
* $params['index'] = (string) The index in which the document resides. (Required)
* $params['id'] = (string) The id of the document, when not specified a doc param should be supplied.
Expand Down Expand Up @@ -1126,7 +1100,7 @@ public function termvectors(array $params = [])
$body = $this->extractArgument($params, 'body');

$endpointBuilder = $this->endpoints;
$endpoint = $endpointBuilder('Termvectors');
$endpoint = $endpointBuilder('TermVectors');
$endpoint->setParams($params);
$endpoint->setIndex($index);
$endpoint->setId($id);
Expand All @@ -1135,7 +1109,6 @@ public function termvectors(array $params = [])

return $this->performRequest($endpoint);
}

/**
* $params['id'] = (string) Document ID (Required)
* $params['index'] = (string) The name of the index (Required)
Expand Down Expand Up @@ -1174,7 +1147,6 @@ public function update(array $params = [])

return $this->performRequest($endpoint);
}

/**
* $params['index'] = (list) A comma-separated list of index names to search; use `_all` or empty string to perform the operation on all indices (Required)
* $params['type'] = DEPRECATED (list) A comma-separated list of document types to search; leave empty to perform the operation on all types
Expand Down Expand Up @@ -1234,7 +1206,6 @@ public function updateByQuery(array $params = [])

return $this->performRequest($endpoint);
}

/**
* $params['task_id'] = (string) The task id to rethrottle
* $params['requests_per_second'] = (number) The throttle to set on this request in floating sub-requests per second. -1 means set no throttle. (Required)
Expand All @@ -1254,37 +1225,30 @@ public function updateByQueryRethrottle(array $params = [])

return $this->performRequest($endpoint);
}

public function cat(): CatNamespace
{
return $this->cat;
}

public function cluster(): ClusterNamespace
{
return $this->cluster;
}

public function indices(): IndicesNamespace
{
return $this->indices;
}

public function ingest(): IngestNamespace
{
return $this->ingest;
}

public function nodes(): NodesNamespace
{
return $this->nodes;
}

public function snapshot(): SnapshotNamespace
{
return $this->snapshot;
}

public function tasks(): TasksNamespace
{
return $this->tasks;
Expand Down
Loading