Skip to content

Commit

Permalink
Merge branch 'main' into annieh/add_cluster_code_examples_to_docs
Browse files Browse the repository at this point in the history
  • Loading branch information
anniegale9538 committed Apr 8, 2024
2 parents f439da6 + 221723e commit 1128afb
Show file tree
Hide file tree
Showing 24 changed files with 817 additions and 60 deletions.
2 changes: 1 addition & 1 deletion .buildkite/pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ steps:
env:
PHP_VERSION: "{{ matrix.php }}"
TEST_SUITE: "{{ matrix.suite }}"
STACK_VERSION: 8.12-SNAPSHOT
STACK_VERSION: 8.13.0-SNAPSHOT
matrix:
setup:
suite:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/license.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4

- name: Check license headers
run: |
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,13 @@ jobs:

strategy:
matrix:
php-version: [7.4, 8.0, 8.1, 8.2]
php-version: [7.4, 8.0, 8.1, 8.2, 8.3]
os: [ubuntu-latest]
es-version: [8.9-SNAPSHOT]
es-version: [8.13-SNAPSHOT]

steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Use PHP ${{ matrix.php-version }}
uses: shivammathur/setup-php@v2
Expand All @@ -30,7 +30,7 @@ jobs:
id: composercache
run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
- name: Cache dependencies
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: ${{ steps.composercache.outputs.dir }}
key: ${{ runner.os }}-php-${{ matrix.php-version }}-${{ hashFiles('**/composer.json') }}
Expand Down
83 changes: 83 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,86 @@
## Release 8.13.0

- Added the `mapTo($class)` function to Elasticsearch response for mapping the result
of [ES|QL](https://www.elastic.co/guide/en/elasticsearch/reference/current/esql.html)
query to an object of stdClass or of a specific class
[#1398](https://github.com/elastic/elasticsearch-php/issues/1398)

This release introduces 6 new APIs and 6 EXPERIMENTAL APIs.

- Specific changes per endpoints
- `AsyncSearch.status`
- Added the `keep_alive` parameter (time), specify the time interval in which the results (partial or final) for this search will be available.
- `Connector.list`
- Added the following parameters:
- `index_name`: list, a comma-separated list of connector index names to fetch connector documents for;
- `connector_name`: list, a comma-separated list of connector names to fetch connector documents for;
- `service_type`: list, a comma-separated list of connector service types to fetch connector documents for;
- `query`: string, a search string for querying connectors, filtering results by matching against connector names, descriptions, and index names;
- `Connector.updateApiKeyId` (new EXPERIMENTAL API)
- API: https://github.com/elastic/elasticsearch/blob/main/rest-api-spec/src/main/resources/rest-api-spec/api/connector.update_api_key_id.json
- Documentation: https://www.elastic.co/guide/en/elasticsearch/reference/master/update-connector-api-key-id-api.html
- `Connector.updateIndexName` (new EXPERIMENTAL API)
- API: https://github.com/elastic/elasticsearch/blob/main/rest-api-spec/src/main/resources/rest-api-spec/api/connector.update_index_name.json
- Documentation: https://www.elastic.co/guide/en/elasticsearch/reference/master/update-connector-index-name-api.html
- `Connector.updateNative` (new EXPERIMENTAL API)
- API: https://github.com/elastic/elasticsearch/blob/main/rest-api-spec/src/main/resources/rest-api-spec/api/connector.update_native.json
- Documentation: https://www.elastic.co/guide/en/elasticsearch/reference/master/connector-apis.html
- `Connector.updateServiceType` (new EXPERIMENTAL API)
- API: https://github.com/elastic/elasticsearch/blob/main/rest-api-spec/src/main/resources/rest-api-spec/api/connector.update_service_type.json
- Documentation: https://www.elastic.co/guide/en/elasticsearch/reference/master/update-connector-service-type-api.html
- `Connector.updateStatus` (new EXPERIMENTAL API)
- API: https://github.com/elastic/elasticsearch/blob/main/rest-api-spec/src/main/resources/rest-api-spec/api/connector.update_status.json
- Documentation: https://www.elastic.co/guide/en/elasticsearch/reference/master/update-connector-status-api.html
- `ConnectorSyncJob.list`
- Added the `job_type` parameter (list), a comma-separated list of job types.
- `Esql.asyncQuery` (new EXPERIMENTAL API)
- API: https://github.com/elastic/elasticsearch/blob/main/rest-api-spec/src/main/resources/rest-api-spec/api/esql.async_query.json
- Documentation: https://www.elastic.co/guide/en/elasticsearch/reference/master/esql-async-query-api.html
- `Esql.asyncQueryGet` (new API)
- API: https://github.com/elastic/elasticsearch/blob/main/rest-api-spec/src/main/resources/rest-api-spec/api/esql.async_query_get.json
- Documentation: https://www.elastic.co/guide/en/elasticsearch/reference/master/esql-async-query-get-api.html
- `Esql.query`
- Added the `drop_null_columns` parameter (boolean) to sepcify if null columns should be removed from the results. If yes, their name and type will be returned in a new `all_columns` section.
- `Indices.resolveCluster` (new API)
- API: https://github.com/elastic/elasticsearch/blob/main/rest-api-spec/src/main/resources/rest-api-spec/api/get_script.json
- Documentation: https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-resolve-cluster-api.html
- `Indices.rollover`
- Added the `lazy` parameter (boolean), if set to true, the rollover action will only mark a data stream to signal that it needs to be rolled over at the next write. Only allowed on data streams.
- `Inference.deleteModel`
- The `model_id` parameter has been renamed to `inference_id`.
- `Inference.getModel`
- The `model_id` parameter has been renamed in `inference_id`.
- `Inference.inference`
- The `model_id` parameter has been renamed in `inference_id`.
- `Inference.putModel`
- The `model_id` parameter has been renamed in `inference_id`.
- `Profiling.flamegraph` (new API)
- API: https://github.com/elastic/elasticsearch/blob/main/rest-api-spec/src/main/resources/rest-api-spec/api/profiling.flamegraph.json
- Documentation: https://www.elastic.co/guide/en/observability/current/universal-profiling.html
- `Profiling.stacktraces` (new API)
- API: https://github.com/elastic/elasticsearch/blob/main/rest-api-spec/src/main/resources/rest-api-spec/api/profiling.stacktraces.json
- Documentation: https://www.elastic.co/guide/en/observability/current/universal-profiling.html
- `Security.queryUser` (new API)
- API: https://github.com/elastic/elasticsearch/blob/main/rest-api-spec/src/main/resources/rest-api-spec/api/security.query_user.json
- Documentation: https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-query-user.html
- `Synonyms.deleteSynonym`
- This API is now stable.
- `Synonyms.deleteSynonymRule`
- This API is now stable.
- `Synonyms.getSynonym`
- This API is now stable.
- `Synonyms.getSynonymRule`
- This API is now stable.
- `Synonyms.getSynonymsSets`
- This API is now stable.
- `Synonyms.putSynonym`
- This API is now stable.
- `Synonyms.putSynonymRule`
- This API is now stable.
- `TextStructure.testGrokPattern` (new API)
- API: https://github.com/elastic/elasticsearch/blob/main/rest-api-spec/src/main/resources/rest-api-spec/api/text_structure.test_grok_pattern.json
- Documentation: https://www.elastic.co/guide/en/elasticsearch/reference/master/test-grok-pattern.html

## Release 8.12.0

- Added 22 new EXPERIMENTAL APIs and 1 new stable API:
Expand Down
7 changes: 4 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,9 @@
"symfony/finder": "~4.0",
"nyholm/psr7": "^1.5",
"php-http/mock-client": "^1.5",
"symfony/http-client": "^5.0|^6.0",
"psr/http-factory" : "^1.0"
"symfony/http-client": "^5.0|^6.0|^7.0",
"psr/http-factory" : "^1.0",
"php-http/message-factory" : "^1.0"
},
"autoload": {
"psr-4": {
Expand All @@ -51,7 +52,7 @@
"vendor/bin/phpunit --testdox -c phpunit-integration-cloud-tests.xml"
],
"phpstan": [
"phpstan analyse src --level 2 --no-progress"
"phpstan analyse src --level 2 --no-progress --memory-limit 256M"
]
},
"config": {
Expand Down
14 changes: 12 additions & 2 deletions docs/release-notes.asciidoc
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
[[release-notes]]
== Release notes

* <<rn-8-11-0>>
* <<rn-8-13-0>>
* <<rn-8-12-0>>
* <<rn-8-11-0>>
* <<rn-8-10-0>>
* <<rn-8-9-0>>
Expand Down Expand Up @@ -44,11 +45,20 @@
* <<rn-7-0-1>>
* <<rn-7-0-0>>

[discrete]
[[rn-8-13-0]]
=== 8.13.0

* Updated the API endpoints to Elasticserach 8.13.0
* Added the Added the mapTo($class) function to Elasticsearch response for mapping the result
of https://www.elastic.co/guide/en/elasticsearch/reference/current/esql.html[ES|QL]
query to an object of stdClass or a specific class https://github.com/elastic/elasticsearch-php/issues/1398[#1398]

[discrete]
[[rn-8-12-0]]
=== 8.12.0

* Updated the API endpoints to Elasticserach 8.11.0
* Updated the API endpoints to Elasticserach 8.12.0
* Tested the library with PHP 8.3

[discrete]
Expand Down
2 changes: 1 addition & 1 deletion src/Client.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
final class Client implements ClientInterface
{
const CLIENT_NAME = 'es';
const VERSION = '8.12.0';
const VERSION = '8.13.0';
const API_COMPATIBILITY_HEADER = '%s/vnd.elasticsearch+%s; compatible-with=8';

use ClientEndpointsTrait;
Expand Down
3 changes: 2 additions & 1 deletion src/Endpoints/AsyncSearch.php
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,7 @@ public function get(array $params = [])
*
* @param array{
* id: string, // (REQUIRED) The async search ID
* keep_alive: time, // Specify the time interval in which the results (partial or final) for this search will be available
* pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false)
* human: boolean, // Return human readable values for statistics. (DEFAULT: true)
* error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false)
Expand All @@ -128,7 +129,7 @@ public function status(array $params = [])
$url = '/_async_search/status/' . $this->encode($params['id']);
$method = 'GET';

$url = $this->addQueryString($url, $params, ['pretty','human','error_trace','source','filter_path']);
$url = $this->addQueryString($url, $params, ['keep_alive','pretty','human','error_trace','source','filter_path']);
$headers = [
'Accept' => 'application/json',
];
Expand Down
Loading

0 comments on commit 1128afb

Please sign in to comment.