From b86a7816e0b5d9c19db8b071e8e82905ad93ea33 Mon Sep 17 00:00:00 2001 From: barkhayot Date: Thu, 19 Dec 2024 22:01:16 +0900 Subject: [PATCH 1/3] chore: fix typos --- .buildkite/run-elasticsearch.sh | 2 +- .buildkite/run-repository.sh | 2 +- .buildkite/run-tests | 2 +- .ci/run-elasticsearch.sh | 2 +- .ci/run-repository.sh | 2 +- .ci/run-tests | 2 +- .doc/typedapi/conventions/requests.asciidoc | 2 +- CHANGELOG.md | 4 ++-- _examples/bulk/README.md | 4 ++-- _examples/bulk/default.go | 2 +- _examples/bulk/indexer.go | 2 +- elasticsearch_internal_test.go | 4 ++-- internal/build/cmd/tools/commands/spec/command.go | 2 +- typedapi/indices/rollover/request.go | 2 +- typedapi/indices/rollover/rollover.go | 2 +- .../security/getuserprivileges/get_user_privileges.go | 8 ++++---- typedapi/types/settings.go | 2 +- typedapi/types/textclassificationinferenceoptions.go | 2 +- .../types/textclassificationinferenceupdateoptions.go | 2 +- 19 files changed, 25 insertions(+), 25 deletions(-) diff --git a/.buildkite/run-elasticsearch.sh b/.buildkite/run-elasticsearch.sh index 850331a77c..ffccd54dde 100755 --- a/.buildkite/run-elasticsearch.sh +++ b/.buildkite/run-elasticsearch.sh @@ -26,7 +26,7 @@ script_path=$(dirname $(realpath -s $0)) source $script_path/functions/imports.sh set -euo pipefail -echo -e "\033[34;1mINFO:\033[0m Take down node if called twice with the same arguments (DETACH=true) or on seperate terminals \033[0m" +echo -e "\033[34;1mINFO:\033[0m Take down node if called twice with the same arguments (DETACH=true) or on separate terminals \033[0m" cleanup_node $es_node_name master_node_name=${es_node_name} diff --git a/.buildkite/run-repository.sh b/.buildkite/run-repository.sh index e5361f05c2..f284e77b6f 100644 --- a/.buildkite/run-repository.sh +++ b/.buildkite/run-repository.sh @@ -6,7 +6,7 @@ # # Its recommended to call `imports.sh` as defined here so that you get access to all variables defined there # -# Any parameters that test-matrix.yml defines should be declared here with appropiate defaults +# Any parameters that test-matrix.yml defines should be declared here with appropriate defaults script_path=$(dirname $(realpath -s $0)) source $script_path/functions/imports.sh diff --git a/.buildkite/run-tests b/.buildkite/run-tests index 6c21171865..b1931841f0 100755 --- a/.buildkite/run-tests +++ b/.buildkite/run-tests @@ -1,7 +1,7 @@ #!/usr/bin/env bash # # Version 1.1 -# - Moved to .buildkite folder and seperated out `run-repository.sh` +# - Moved to .buildkite folder and separated out `run-repository.sh` # - Add `$RUNSCRIPTS` env var for running Elasticsearch dependent products script_path=$(dirname $(realpath -s $0)) source $script_path/functions/imports.sh diff --git a/.ci/run-elasticsearch.sh b/.ci/run-elasticsearch.sh index 3f4e2f1da4..b72fa7ca21 100755 --- a/.ci/run-elasticsearch.sh +++ b/.ci/run-elasticsearch.sh @@ -26,7 +26,7 @@ script_path=$(dirname $(realpath -s $0)) source $script_path/functions/imports.sh set -euo pipefail -echo -e "\033[34;1mINFO:\033[0m Take down node if called twice with the same arguments (DETACH=true) or on seperate terminals \033[0m" +echo -e "\033[34;1mINFO:\033[0m Take down node if called twice with the same arguments (DETACH=true) or on separate terminals \033[0m" cleanup_node $es_node_name master_node_name=${es_node_name} diff --git a/.ci/run-repository.sh b/.ci/run-repository.sh index fa1b716111..2e07adc59a 100644 --- a/.ci/run-repository.sh +++ b/.ci/run-repository.sh @@ -6,7 +6,7 @@ # # Its recommended to call `imports.sh` as defined here so that you get access to all variables defined there # -# Any parameters that test-matrix.yml defines should be declared here with appropiate defaults +# Any parameters that test-matrix.yml defines should be declared here with appropriate defaults script_path=$(dirname $(realpath -s $0)) source $script_path/functions/imports.sh diff --git a/.ci/run-tests b/.ci/run-tests index 5166c457b7..109e4c7290 100755 --- a/.ci/run-tests +++ b/.ci/run-tests @@ -1,7 +1,7 @@ #!/usr/bin/env bash # # Version 1.1 -# - Moved to .ci folder and seperated out `run-repository.sh` +# - Moved to .ci folder and separated out `run-repository.sh` # - Add `$RUNSCRIPTS` env var for running Elasticsearch dependent products script_path=$(dirname $(realpath -s $0)) source $script_path/functions/imports.sh diff --git a/.doc/typedapi/conventions/requests.asciidoc b/.doc/typedapi/conventions/requests.asciidoc index f3cf3f3513..fa05783292 100644 --- a/.doc/typedapi/conventions/requests.asciidoc +++ b/.doc/typedapi/conventions/requests.asciidoc @@ -2,7 +2,7 @@ ==== Requests Requests are modeled around structures that follows as closely as possible the {es} API and uses the standard `json/encoding` for serialization. -Corresponding request can be found withing the same package as its endpoint and comes with a Builder that allows you to deep dive into the API by following the types. +Corresponding request can be found within the same package as its endpoint and comes with a Builder that allows you to deep dive into the API by following the types. [source,go] ------------------------------------ diff --git a/CHANGELOG.md b/CHANGELOG.md index 649e058a57..8efc68b1db 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -214,7 +214,7 @@ Update APIs to latest [elasticsearch-specification 8.10](https://github.com/elas * `FleetGetSecret` * `FleetPostSecret` -**Exprimental APIs** +**Experimental APIs** `QueryRulesetList` @@ -224,7 +224,7 @@ Update APIs to latest [elasticsearch-specification 8.10](https://github.com/elas `Security.UpdateSettings` ## Typed API -**Exprimental APIs** +**Experimental APIs** `QueryRuleset.List` diff --git a/_examples/bulk/README.md b/_examples/bulk/README.md index 14c5586ced..843609b1ff 100644 --- a/_examples/bulk/README.md +++ b/_examples/bulk/README.md @@ -24,7 +24,7 @@ go run default.go -count=100000 -batch=25000 # → Generated 100,000 articles # → Sending batch [1/4] [2/4] [3/4] [4/4] # ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔ -# Sucessfuly indexed [100,000] documents in 3.423s (29,214 docs/sec) +# Successfully indexed [100,000] documents in 3.423s (29,214 docs/sec) ``` ## `indexer.go` @@ -39,7 +39,7 @@ go run indexer.go -count=100000 -flush=1000000 # ▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁ # → Generated 100,000 articles # ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔ -# Sucessfuly indexed [100,000] documents in 1.909s (52,383 docs/sec) +# Successfully indexed [100,000] documents in 1.909s (52,383 docs/sec) ``` The helper allows you to `Add()` bulk indexer items, and flushes each batch based on the configured threshold. diff --git a/_examples/bulk/default.go b/_examples/bulk/default.go index 5a285a8111..0e4a375e96 100644 --- a/_examples/bulk/default.go +++ b/_examples/bulk/default.go @@ -285,7 +285,7 @@ func main() { ) } else { log.Printf( - "Sucessfuly indexed [%s] documents in %s (%s docs/sec)", + "Successfully indexed [%s] documents in %s (%s docs/sec)", humanize.Comma(int64(numIndexed)), dur.Truncate(time.Millisecond), humanize.Comma(int64(1000.0/float64(dur/time.Millisecond)*float64(numIndexed))), diff --git a/_examples/bulk/indexer.go b/_examples/bulk/indexer.go index 7c47268423..1ea57c7b34 100644 --- a/_examples/bulk/indexer.go +++ b/_examples/bulk/indexer.go @@ -255,7 +255,7 @@ func main() { ) } else { log.Printf( - "Sucessfuly indexed [%s] documents in %s (%s docs/sec)", + "Successfully indexed [%s] documents in %s (%s docs/sec)", humanize.Comma(int64(biStats.NumFlushed)), dur.Truncate(time.Millisecond), humanize.Comma(int64(1000.0/float64(dur/time.Millisecond)*float64(biStats.NumFlushed))), diff --git a/elasticsearch_internal_test.go b/elasticsearch_internal_test.go index 952f1a0930..d6668ca0a7 100644 --- a/elasticsearch_internal_test.go +++ b/elasticsearch_internal_test.go @@ -906,7 +906,7 @@ func TestContentTypeOverride(t *testing.T) { _, _ = c.Search(c.Search.WithBody(strings.NewReader(""))) }) - t.Run("overriden CBOR Content-Type functional options style", func(t *testing.T) { + t.Run("overridden CBOR Content-Type functional options style", func(t *testing.T) { contentType := "application/cbor" tp, _ := elastictransport.New(elastictransport.Config{ @@ -938,7 +938,7 @@ func TestContentTypeOverride(t *testing.T) { c.Search.WithBody(strings.NewReader("")), ) }) - t.Run("overriden CBOR Content-Type direct call style", func(t *testing.T) { + t.Run("overridden CBOR Content-Type direct call style", func(t *testing.T) { contentType := "application/cbor" tp, _ := elastictransport.New(elastictransport.Config{ diff --git a/internal/build/cmd/tools/commands/spec/command.go b/internal/build/cmd/tools/commands/spec/command.go index 38934a81d0..0516ca1b28 100644 --- a/internal/build/cmd/tools/commands/spec/command.go +++ b/internal/build/cmd/tools/commands/spec/command.go @@ -143,7 +143,7 @@ func (c Command) writeFileToDest(filename string, data []byte) error { return fmt.Errorf("cannot write file: %s", err) } if c.Debug { - log.Printf("Successfuly written file to : %s", path) + log.Printf("Successfully written file to : %s", path) } return nil } diff --git a/typedapi/indices/rollover/request.go b/typedapi/indices/rollover/request.go index 3bf113d649..09fb4d8ab1 100644 --- a/typedapi/indices/rollover/request.go +++ b/typedapi/indices/rollover/request.go @@ -47,7 +47,7 @@ type Request struct { Conditions *types.RolloverConditions `json:"conditions,omitempty"` // Mappings Mapping for fields in the index. // If specified, this mapping can include field names, field data types, and - // mapping paramaters. + // mapping parameters. Mappings *types.TypeMapping `json:"mappings,omitempty"` // Settings Configuration options for the index. // Data streams do not support this parameter. diff --git a/typedapi/indices/rollover/rollover.go b/typedapi/indices/rollover/rollover.go index e493bb4bc9..726167a497 100644 --- a/typedapi/indices/rollover/rollover.go +++ b/typedapi/indices/rollover/rollover.go @@ -459,7 +459,7 @@ func (r *Rollover) Conditions(conditions *types.RolloverConditions) *Rollover { // Mappings Mapping for fields in the index. // If specified, this mapping can include field names, field data types, and -// mapping paramaters. +// mapping parameters. // API name: mappings func (r *Rollover) Mappings(mappings *types.TypeMapping) *Rollover { diff --git a/typedapi/security/getuserprivileges/get_user_privileges.go b/typedapi/security/getuserprivileges/get_user_privileges.go index c9b4591744..7f8580850d 100644 --- a/typedapi/security/getuserprivileges/get_user_privileges.go +++ b/typedapi/security/getuserprivileges/get_user_privileges.go @@ -288,11 +288,11 @@ func (r *GetUserPrivileges) Application(name string) *GetUserPrivileges { return r } -// Priviledge The name of the privilege. If you do not specify this parameter, the API +// Privilege The name of the privilege. If you do not specify this parameter, the API // returns information about all privileges for the requested application. -// API name: priviledge -func (r *GetUserPrivileges) Priviledge(name string) *GetUserPrivileges { - r.values.Set("priviledge", name) +// API name: privilege +func (r *GetUserPrivileges) Privilege(name string) *GetUserPrivileges { + r.values.Set("privilege", name) return r } diff --git a/typedapi/types/settings.go b/typedapi/types/settings.go index d4bbb17af4..0f4ec5b016 100644 --- a/typedapi/types/settings.go +++ b/typedapi/types/settings.go @@ -41,7 +41,7 @@ type Settings struct { // will be performed thus improving // overall performance. AlignCheckpoints *bool `json:"align_checkpoints,omitempty"` - // DatesAsEpochMillis Defines if dates in the ouput should be written as ISO formatted string or as + // DatesAsEpochMillis Defines if dates in the output should be written as ISO formatted string or as // millis since epoch. epoch_millis was // the default for transforms created before version 7.11. For compatible output // set this value to `true`. diff --git a/typedapi/types/textclassificationinferenceoptions.go b/typedapi/types/textclassificationinferenceoptions.go index a1ca40e5b0..21f13af46b 100644 --- a/typedapi/types/textclassificationinferenceoptions.go +++ b/typedapi/types/textclassificationinferenceoptions.go @@ -34,7 +34,7 @@ import ( // https://github.com/elastic/elasticsearch-specification/blob/48e2d9de9de2911b8cb1cf715e4bc0a2b1f4b827/specification/ml/_types/inference.ts#L189-L199 type TextClassificationInferenceOptions struct { // ClassificationLabels Classification labels to apply other than the stored labels. Must have the - // same deminsions as the default configured labels + // same dimensions as the default configured labels ClassificationLabels []string `json:"classification_labels,omitempty"` // NumTopClasses Specifies the number of top class predictions to return. Defaults to 0. NumTopClasses *int `json:"num_top_classes,omitempty"` diff --git a/typedapi/types/textclassificationinferenceupdateoptions.go b/typedapi/types/textclassificationinferenceupdateoptions.go index f1aa526689..492ae32ce7 100644 --- a/typedapi/types/textclassificationinferenceupdateoptions.go +++ b/typedapi/types/textclassificationinferenceupdateoptions.go @@ -34,7 +34,7 @@ import ( // https://github.com/elastic/elasticsearch-specification/blob/48e2d9de9de2911b8cb1cf715e4bc0a2b1f4b827/specification/ml/_types/inference.ts#L363-L372 type TextClassificationInferenceUpdateOptions struct { // ClassificationLabels Classification labels to apply other than the stored labels. Must have the - // same deminsions as the default configured labels + // same dimensions as the default configured labels ClassificationLabels []string `json:"classification_labels,omitempty"` // NumTopClasses Specifies the number of top class predictions to return. Defaults to 0. NumTopClasses *int `json:"num_top_classes,omitempty"` From 600d47e5c7b03134ab60b62262ac549733463eb1 Mon Sep 17 00:00:00 2001 From: barkhayot Date: Thu, 19 Dec 2024 22:11:02 +0900 Subject: [PATCH 2/3] fix: wip --- elasticsearch_example_test.go | 1 + 1 file changed, 1 insertion(+) diff --git a/elasticsearch_example_test.go b/elasticsearch_example_test.go index 68ea52748b..cbde306859 100644 --- a/elasticsearch_example_test.go +++ b/elasticsearch_example_test.go @@ -33,6 +33,7 @@ import ( ) func init() { + log.SetFlags(0) } From 6786226067a2df107a7d36a169d3d63912ae8416 Mon Sep 17 00:00:00 2001 From: barkhayot Date: Thu, 19 Dec 2024 22:12:01 +0900 Subject: [PATCH 3/3] fix: cleanup --- elasticsearch_example_test.go | 1 - 1 file changed, 1 deletion(-) diff --git a/elasticsearch_example_test.go b/elasticsearch_example_test.go index cbde306859..68ea52748b 100644 --- a/elasticsearch_example_test.go +++ b/elasticsearch_example_test.go @@ -33,7 +33,6 @@ import ( ) func init() { - log.SetFlags(0) }