Set priority

Set priority

Phases allowed: hot, warm, cold.

Sets the priority of the index as soon as the policy enters the hot, warm, or cold phase. Higher priority indices are recovered before indices with lower priorities following a node restart.

Generally, indexes in the hot phase should have the highest value and indexes in the cold phase should have the lowest values. For example: 100 for the hot phase, 50 for the warm phase, and 0 for the cold phase. Indices that don’t set this value have a default priority of 1.

Options

priority

(Required, integer) The priority for the index. Must be 0 or greater. Set to null to remove the priority.

Example

  1. resp = client.ilm.put_lifecycle(
  2. name="my_policy",
  3. policy={
  4. "phases": {
  5. "warm": {
  6. "actions": {
  7. "set_priority": {
  8. "priority": 50
  9. }
  10. }
  11. }
  12. }
  13. },
  14. )
  15. print(resp)
  1. response = client.ilm.put_lifecycle(
  2. policy: 'my_policy',
  3. body: {
  4. policy: {
  5. phases: {
  6. warm: {
  7. actions: {
  8. set_priority: {
  9. priority: 50
  10. }
  11. }
  12. }
  13. }
  14. }
  15. }
  16. )
  17. puts response
  1. const response = await client.ilm.putLifecycle({
  2. name: "my_policy",
  3. policy: {
  4. phases: {
  5. warm: {
  6. actions: {
  7. set_priority: {
  8. priority: 50,
  9. },
  10. },
  11. },
  12. },
  13. },
  14. });
  15. console.log(response);
  1. PUT _ilm/policy/my_policy
  2. {
  3. "policy": {
  4. "phases": {
  5. "warm": {
  6. "actions": {
  7. "set_priority" : {
  8. "priority": 50
  9. }
  10. }
  11. }
  12. }
  13. }
  14. }