-
Notifications
You must be signed in to change notification settings - Fork 500
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
Refactors JS client helper documentation #1358
Conversation
Fix #823 Signed-off-by: Robert Da Silva <[email protected]>
Signed-off-by: Robert Da Silva <[email protected]>
…-website into robdasilva-main
@robdasilva -- could you please look over the PR for technical accuracy? Thank you! |
| `refreshOnCompletion` | Boolean | Whether a refresh should be run on all affected indices at the end of the bulk operation. Optional. Default is false. | ||
| `retries` | Integer | The number of times an operation is retried before `onDrop` is called for that document. Optional. Defaults to the client's `maxRetries` value. | ||
| `wait` | Integer | Time in milliseconds to wait before retrying an operation. Optional. Default is 5,000. | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we bubble the required params to the top of this list, and make it easier to see that they are required? One way of doing this is having a column called required / default
that either states that param is required or a default value, if any, when it's optional:
Option | Data type | Required / Default | Description |
---|---|---|---|
datasource |
An array, async generator or a readable stream of strings or objects | REQUIRED | Represents the documents you need to create, delete, index or update. |
concurrency |
Integer | 5 | The number of requests to be executed in parallel. |
flushBytes |
Integer | 5,000,000. | Maximum bulk body size to send in bytes. |
Thank you and great work :-)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
_clients/javascript/index.md
Outdated
- `enabled`: A Boolean used to turn the Circuit Breaker on or off. Defaults to `false`. | ||
- `maxPercentage`: The threshold that determines whether the Circuit Breaker engages. The input range must be between `[0 ,1]`. Any number that exceeds that range will correct to `1.0`. | ||
- `enabled`: A Boolean used to turn the circuit breaker on or off. Defaults to `false`. | ||
- `maxPercentage`: The threshold that determines whether the circuit breaker engages. Valid values are [0, 1]. Any value that exceeds that range will correct to `1.0`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think Valid values are [0, 1]
can easily be interpreted as only 0 and 1 are valid values
when maxPercentage can be any real number between 0.0 and 1.0
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reworded.
Signed-off-by: Fanit Kolchina <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 🚀
And thank you for your work!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's add an introduction to helpers, even if it's a short sentence.
Otherwise, LGTM
_clients/javascript/helpers.md
Outdated
|
||
# Helper methods | ||
|
||
This section is currently incomplete. It does not yet cover all helper methods and their options. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This section is currently incomplete. It does not yet cover all helper methods and their options. | |
Helper methods allow you to abstract certain API tasks. | |
This section is currently incomplete. It does not yet cover all helper methods and their options. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reworded.
Signed-off-by: Fanit Kolchina <[email protected]>
aborted: boolean | ||
} | ||
``` | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
#### Helper configuration options |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Really great work Fanit!
i only had a couple minor suggestions
Co-authored-by: Alice Williams <[email protected]>
Co-authored-by: Alice Williams <[email protected]>
Signed-off-by: Fanit Kolchina <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@kolchfa-aws Please see my changes and comments and let me know if you have any questions. Thanks!
_clients/index.md
Outdated
|
||
OpenSearch provides clients for several popular programming languages, with more coming. In general, clients are compatible with clusters running the same major version of OpenSearch (`major.minor.patch`). | ||
OpenSearch provides clients for several popular programming languages, with more coming. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OpenSearch provides clients for several popular programming languages, with more coming. | |
OpenSearch provides clients for several popular programming languages, with more to come. |
_clients/javascript/helpers.md
Outdated
|
||
When creating a new bulk helper instance, you can use the following configuration options. | ||
|
||
| Option | Data type | Required/Default | Description |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've seen "Data Type" (both words capitalized) in other tables. Let's make consistent.
_clients/javascript/helpers.md
Outdated
|
||
| Option | Data type | Required/Default | Description | ||
| :--- | :--- | :--- | :--- | ||
| `datasource` | An array, async generator or a readable stream of strings or objects | Required | Represents the documents you need to create, delete, index or update. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| `datasource` | An array, async generator or a readable stream of strings or objects | Required | Represents the documents you need to create, delete, index or update. | |
| `datasource` | An array, async generator, or readable stream of strings or objects | Required | Represents the documents you need to create, delete, index, or update. |
_clients/javascript/helpers.md
Outdated
| `concurrency` | Integer | Optional. Default is 5. | The number of requests to be executed in parallel. | ||
| `flushBytes` | Integer | Optional. Default is 5,000,000. | Maximum bulk body size to send in bytes. | ||
| `flushInterval` | Integer | Optional. Default is 30,000. | Time in milliseconds to wait before flushing the body after the last document has been read. | ||
| `onDrop` | Function | Optional. Default is `noop`. | A function to be invoked for every document that can’t be indexed after reaching the maximum amount of retries. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| `onDrop` | Function | Optional. Default is `noop`. | A function to be invoked for every document that can’t be indexed after reaching the maximum amount of retries. | |
| `onDrop` | Function | Optional. Default is `noop`. | A function to be invoked for every document that can’t be indexed after reaching the maximum number of retries. |
_clients/javascript/helpers.md
Outdated
| `flushBytes` | Integer | Optional. Default is 5,000,000. | Maximum bulk body size to send in bytes. | ||
| `flushInterval` | Integer | Optional. Default is 30,000. | Time in milliseconds to wait before flushing the body after the last document has been read. | ||
| `onDrop` | Function | Optional. Default is `noop`. | A function to be invoked for every document that can’t be indexed after reaching the maximum amount of retries. | ||
| `refreshOnCompletion` | Boolean | Optional. Default is false. | Whether or not a refresh should be run on all affected indices at the end of the bulk operation. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| `refreshOnCompletion` | Boolean | Optional. Default is false. | Whether or not a refresh should be run on all affected indices at the end of the bulk operation. | |
| `refreshOnCompletion` | Boolean | Optional. Default is false. | Whether or not a refresh should be run on all affected indexes at the end of the bulk operation. |
_clients/javascript/helpers.md
Outdated
|
||
#### Index | ||
|
||
The index operation creates a new document if it doesn’t exist, and recreates the document if it already exists. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The index operation creates a new document if it doesn’t exist, and recreates the document if it already exists. | |
The index operation creates a new document if it doesn’t exist and recreates the document if it already exists. |
_clients/javascript/helpers.md
Outdated
|
||
#### Update | ||
|
||
The update operation updates the document with the the fields being sent. The document must already exist in the index. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The update operation updates the document with the the fields being sent. The document must already exist in the index. | |
The update operation updates the document with the fields being sent. The document must already exist in the index. |
Signed-off-by: Fanit Kolchina <[email protected]>
* Fix Circuit Breaker section in JS client docs Fix #823 Signed-off-by: Robert Da Silva <[email protected]> * Add documentation for JS client bulk helper Signed-off-by: Robert Da Silva <[email protected]> * Refactors js client helper documentation * Incorporated tech review comments Signed-off-by: Fanit Kolchina <[email protected]> * Incorporated doc review comments Signed-off-by: Fanit Kolchina <[email protected]> * Update _clients/javascript/helpers.md Co-authored-by: Alice Williams <[email protected]> * Update _clients/javascript/helpers.md Co-authored-by: Alice Williams <[email protected]> * Update helpers.md * Incorporated tech review feedback Signed-off-by: Fanit Kolchina <[email protected]> * Implemented editorial comments Signed-off-by: Fanit Kolchina <[email protected]> Signed-off-by: Robert Da Silva <[email protected]> Signed-off-by: Fanit Kolchina <[email protected]> Co-authored-by: Robert Da Silva <[email protected]> Co-authored-by: Alice Williams <[email protected]> (cherry picked from commit 89f966a)
* Fix Circuit Breaker section in JS client docs Fix #823 Signed-off-by: Robert Da Silva <[email protected]> * Add documentation for JS client bulk helper Signed-off-by: Robert Da Silva <[email protected]> * Refactors js client helper documentation * Incorporated tech review comments Signed-off-by: Fanit Kolchina <[email protected]> * Incorporated doc review comments Signed-off-by: Fanit Kolchina <[email protected]> * Update _clients/javascript/helpers.md Co-authored-by: Alice Williams <[email protected]> * Update _clients/javascript/helpers.md Co-authored-by: Alice Williams <[email protected]> * Update helpers.md * Incorporated tech review feedback Signed-off-by: Fanit Kolchina <[email protected]> * Implemented editorial comments Signed-off-by: Fanit Kolchina <[email protected]> Signed-off-by: Robert Da Silva <[email protected]> Signed-off-by: Fanit Kolchina <[email protected]> Co-authored-by: Robert Da Silva <[email protected]> Co-authored-by: Alice Williams <[email protected]> (cherry picked from commit 89f966a) Co-authored-by: kolchfa-aws <[email protected]>
Description
Refactors js client helper documentation.
Checklist
For more information on following Developer Certificate of Origin and signing off your commits, please check here.