elastic_tutorial/The Elasticsearch Documentation/6_script-Advance/2_reindex.es
2025-04-09 09:37:23 +03:30

28 lines
1020 B
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

POST _reindex
{
"source": {
"index": "mainindex",
"_source": ["tags", "allwords", "subject", "keywords", "verb"]
},
"dest": {
"index": "suggestindex"
}
}
// reindex یک نوع ایندکس برای انتقال داده ها از یک ایندکس به ایندکس دیگر است
// source -> ایندکسی که باید برود
// dest -> ایندکسی که اطلاعات به آن وارد میشود
// _source -> فیلد هایی که انتقال میابند
POST _reindex?wait_for_completion=false
// انجام عملیات reindex زمان بر است و معمولا با خطای time out روبه رو میشود
// برای جلوگیری، wait_for_completion را فالس قرار دهید
// بعد از فالس کردن wait_for_completion، در بدنه پاسخ به شما یک task_id داده میشود که میتوان با آن بررسی کرد فرایند انتقال تا کجا پیش رفته
GET _tasks/isijdisajdsl
// بررسی وضعیت تسک