Skip to content

Commit d279808

Browse files
authored
[8.9] Bump Elasticsearch apis (#693)
* Typedapi: Add changelog for future release * bump 8.9.0 * API: Update typed API for Elasticsearch v8.9.0 (26d0e20) * Tests: reflect typedapi changes * API: Update API for Elasticsearch v8.9.0 (26ca704) * fixup! API: Update typed API for Elasticsearch v8.9.0 (26d0e20)
1 parent d4f29a0 commit d279808

File tree

3,276 files changed

+53897
-16725
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

3,276 files changed

+53897
-16725
lines changed

.buildkite/pipeline.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ steps:
44
provider: "gcp"
55
env:
66
TEST_SUITE: "{{ matrix.suite }}"
7-
STACK_VERSION: 8.8.0-SNAPSHOT
7+
STACK_VERSION: 8.9.0-SNAPSHOT
88
WORKSPACE: /tmp/go-elasticsearch
99
matrix:
1010
setup:

.ci/test-matrix.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22

33
STACK_VERSION:
4-
- 8.8.0-SNAPSHOT
4+
- 8.9.0-SNAPSHOT
55

66
GO_VERSION:
77
- 1-alpine

.github/workflows/build.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,12 @@ on:
77
branches:
88
- github-actions
99
- main
10-
- 8.5
10+
- 8.9
1111
- 7.17
1212
pull_request:
1313
branches:
1414
- main
15-
- 8.5
15+
- 8.9
1616
- 7.17
1717

1818
env:

.github/workflows/test-integration.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ on:
1717

1818
env:
1919
GITHUB_ACTIONS: true
20-
ELASTICSEARCH_VERSION: elasticsearch:8.3.0-SNAPSHOT
20+
ELASTICSEARCH_VERSION: elasticsearch:8.9.0-SNAPSHOT
2121

2222
jobs:
2323
test:

CHANGELOG.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,20 @@
1+
# 8.9.0
2+
3+
## Typed API
4+
5+
* Propagated request fields towards the endpoint for ease of access, taking priority over same-name query string fields.
6+
* Added a stub for Do methods on endpoints that only support a boolean response such as `core.exists`.
7+
* NDJSON endpoints support with custom serialization and helpers for specific like `core.bulk`.
8+
* Link to endpoints documentation in API index to better display and easy of use.
9+
10+
# 8.8.2
11+
12+
## Typed API
13+
14+
* Fixed deserialization for `Suggest` in search responses.
15+
* Fixed double-quoted strings in deserialization for unions normalized as string. #684
16+
* Fixed handling of `core.Get` response when the index did not exist. #678
17+
118
# 8.7.0
219

320
## API

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
SHELL := /bin/bash
22

3-
ELASTICSEARCH_DEFAULT_BUILD_VERSION = "8.8.0-SNAPSHOT"
3+
ELASTICSEARCH_DEFAULT_BUILD_VERSION = "8.9.0-SNAPSHOT"
44

55
##@ Test
66
test-unit: ## Run unit tests

elasticsearch_integration_test.go

Lines changed: 22 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@ import (
2828
"errors"
2929
"fmt"
3030
"github.com/elastic/go-elasticsearch/v8/typedapi/core/search"
31-
"github.com/elastic/go-elasticsearch/v8/typedapi/indices/create"
3231
"github.com/elastic/go-elasticsearch/v8/typedapi/some"
3332
"github.com/elastic/go-elasticsearch/v8/typedapi/types"
3433
"github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/refresh"
@@ -327,12 +326,10 @@ func TestTypedClient(t *testing.T) {
327326
indexName := "test-index"
328327
if exists, err := es.Indices.Exists(indexName).IsSuccess(context.Background()); !exists && err == nil {
329328
res, err := es.Indices.Create(indexName).
330-
Request(&create.Request{
331-
Mappings: &types.TypeMapping{
332-
Properties: map[string]types.Property{
333-
"price": types.NewIntegerNumberProperty(),
334-
"name": types.NewKeywordProperty(),
335-
},
329+
Mappings(&types.TypeMapping{
330+
Properties: map[string]types.Property{
331+
"price": types.IntegerNumberProperty{},
332+
"name": types.KeywordProperty{},
336333
},
337334
}).
338335
Do(context.Background())
@@ -360,6 +357,7 @@ func TestTypedClient(t *testing.T) {
360357
Id int `json:"id"`
361358
Name string `json:"name"`
362359
Price int `json:"price"`
360+
Alt string `json:"alt"`
363361
}
364362

365363
// Indexing synchronously with refresh.Waitfor, one document at a time
@@ -381,7 +379,7 @@ func TestTypedClient(t *testing.T) {
381379
},
382380
} {
383381
indexed, err := es.Index(indexName).
384-
Request(document).
382+
Document(document).
385383
Id(strconv.Itoa(document.Id)).
386384
Refresh(refresh.Waitfor).
387385
Do(context.Background())
@@ -391,6 +389,9 @@ func TestTypedClient(t *testing.T) {
391389
if indexed.Result != result.Created {
392390
t.Fatalf("unexpected result during indexation of document: %v, response: %v", document, indexed)
393391
}
392+
393+
document.Alt = fmt.Sprintf("alt_%d", document.Id)
394+
es.Update(indexName, strconv.Itoa(document.Id)).Doc(document).Do(context.Background())
394395
}
395396

396397
// Check for document existence in index
@@ -412,13 +413,12 @@ func TestTypedClient(t *testing.T) {
412413
// Simple search matching name
413414
res, err := es.Search().
414415
Index(indexName).
415-
Request(&search.Request{
416-
Query: &types.Query{
417-
Match: map[string]types.MatchQuery{
418-
"name": {Query: "Foo"},
419-
},
416+
Query(&types.Query{
417+
Match: map[string]types.MatchQuery{
418+
"name": {Query: "Foo"},
420419
},
421-
}).Do(context.Background())
420+
}).
421+
Do(context.Background())
422422

423423
if err != nil {
424424
t.Fatalf("error runnning search query: %s", err)
@@ -440,17 +440,15 @@ func TestTypedClient(t *testing.T) {
440440
// Aggregate prices with a SumAggregation
441441
searchResponse, err := es.Search().
442442
Index(indexName).
443-
Request(
444-
&search.Request{
445-
Size: some.Int(0),
446-
Aggregations: map[string]types.Aggregations{
447-
"total_prices": {
448-
Sum: &types.SumAggregation{
449-
Field: some.String("price"),
450-
},
451-
},
443+
Size(0).
444+
Aggregations(map[string]types.Aggregations{
445+
"total_prices": {
446+
Sum: &types.SumAggregation{
447+
Field: some.String("price"),
452448
},
453-
}).Do(context.Background())
449+
},
450+
}).
451+
Do(context.Background())
454452

455453
if err != nil {
456454
t.Fatal(err)

0 commit comments

Comments
 (0)