Skip to content

Commit

Permalink
Adds size parameter to the reindex commands in the NLP examples (#2435)…
Browse files Browse the repository at this point in the history
… (#2440)

* Adds size parameter to the reindex commands in the NLP examples.

* Reduce size value in NLP inference page.

(cherry picked from commit 56fa097)

Co-authored-by: István Zoltán Szabó <istvan.szabo@elastic.co>
  • Loading branch information
mergify[bot] and szabosteve authored Jun 14, 2023
1 parent f1ab482 commit ec0f925
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 6 deletions.
8 changes: 4 additions & 4 deletions docs/en/stack/ml/nlp/ml-nlp-inference.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,7 @@ POST _reindex
{
"source": {
"index": "kibana_sample_data_logs",
"size": 500
"size": 50
},
"dest": {
"index": "lang-test",
Expand All @@ -245,9 +245,9 @@ POST _reindex
However, those web log messages are unlikely to contain enough words for the
model to accurately identify the language.

TIP: Set the reindex `size` option to a value
smaller than the `queue_capacity` for the trained model deployment. Otherwise, requests might be rejected
with a "too many requests" 429 error code.
TIP: Set the reindex `size` option to a value smaller than the `queue_capacity`
for the trained model deployment. Otherwise, requests might be rejected with a
"too many requests" 429 error code.

[discrete]
[[ml-nlp-inference-discover]]
Expand Down
6 changes: 5 additions & 1 deletion docs/en/stack/ml/nlp/ml-nlp-ner-example.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -216,14 +216,18 @@ you created:
POST _reindex
{
"source": {
"index": "les-miserables"
"index": "les-miserables",
"size": 50 <1>
},
"dest": {
"index": "les-miserables-infer",
"pipeline": "ner"
}
}
--------------------------------------------------
<1> The default batch size for reindexing is 1000. Reducing `size` to a smaller
number makes the update of the reindexing process quicker which enables you to
follow the progress closely and detect errors early.

Take a random paragraph from the source document as an example:

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -227,14 +227,18 @@ ingest processor inserts the embedding vector into each document.
POST _reindex?wait_for_completion=false
{
"source": {
"index": "collection"
"index": "collection",
"size": 50 <1>
},
"dest": {
"index": "collection-with-embeddings",
"pipeline": "text-embeddings"
}
}
--------------------------------------------------
<1> The default batch size for reindexing is 1000. Reducing `size` to a smaller
number makes the update of the reindexing process quicker which enables you to
follow the progress closely and detect errors early.

The API call returns a task ID that can be used to monitor the progress:

Expand Down

0 comments on commit ec0f925

Please sign in to comment.