Last active
January 30, 2019 21:52
-
-
Save vickoman/7b16b8c02d15028e3e9f9d407b70b43a to your computer and use it in GitHub Desktop.
Curl to remove children and locked
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# PASO 1 - COPIAR INDICE ELIMINANDO EL FIELD LOCKED | |
curl -X POST "$URL_ES_TARGET/_reindex?pretty=true" -H 'Content-Type: application/json' -d' | |
{ | |
"source": { | |
"index": "theme_base" | |
}, | |
"dest": { | |
"index": "theme_base-draft", | |
"version_type": "external" | |
}, | |
"script": { | |
"source": "ctx._source.remove(\u0027locked\u0027)", | |
"lang": "painless" | |
} | |
} | |
' | |
# PASO 2 ELIMINAR INDICE ORIGINAL | |
curl -X DELETE "$URL_ES_TARGET/theme_base" | |
# PASO3 - COPIAR NUEVO INDICE SIN LOCKED COMO INDICE ORIGINAL | |
curl -XPOST '$URL_ES_TARGET/_reindex?pretty=true' -H 'Content-Type: application/json' -d ' | |
{ | |
"source": { | |
"index": "theme_base-draft" | |
}, | |
"dest": { | |
"index": "theme_base", | |
"version_type": "internal" | |
} | |
} | |
' | |
# PASO 4 ELIMINAR INDICE MODIFICADO | |
curl -X DELETE "$URL_ES_TARGET/theme_base-draft" | |
## ELIMINAR LOCKED DE LOS THEMES | |
# PASO 5 - ELIMINAR EL FIELD LOCKED EN THEMES | |
curl -X POST "$URL_ES_TARGET/_reindex?pretty=true" -H 'Content-Type: application/json' -d' | |
{ | |
"source": { | |
"index": "theme" | |
}, | |
"dest": { | |
"index": "theme-draft", | |
"version_type": "external" | |
}, | |
"script": { | |
"source": "ctx._source.remove(\u0027locked\u0027)", | |
"lang": "painless" | |
} | |
} | |
' | |
# PASO 6 ELIMINAR INDICE INICIAL | |
curl -X DELETE "$URL_ES_TARGET/theme" | |
# PASO 7 - RESTAURAR COMO ORIGINAL | |
curl -XPOST '$URL_ES_TARGET/_reindex?pretty=true' -H 'Content-Type: application/json' -d ' | |
{ | |
"source": { | |
"index": "theme-draft" | |
}, | |
"dest": { | |
"index": "theme", | |
"version_type": "internal" | |
} | |
} | |
' | |
# PASO 8 ELIMINAR INDICE MODIFICADO | |
curl -X DELETE "$URL_ES_TARGET/theme-draft" | |
## ELIMINAR EL FIELD CHILDREN DE LOS COURSES | |
# PASO 9 - ELIMINAR EL FIELD CHILDREN DE LOS COURSES | |
curl -X POST "$URL_ES_TARGET/_reindex?pretty=true" -H 'Content-Type: application/json' -d' | |
{ | |
"source": { | |
"index": "course" | |
}, | |
"dest": { | |
"index": "course-draft", | |
"version_type": "external" | |
}, | |
"script": { | |
"source": "ctx._source.remove(\u0027children\u0027)", | |
"lang": "painless" | |
} | |
} | |
' | |
# PASO 10 ELIMINAR INDICE INICIAL | |
curl -X DELETE "$URL_ES_TARGET/course" | |
# PASO 11 - COPIAR INDICE CREADO MODIFICADO AL INDICE ORIGINAL | |
curl -XPOST '$URL_ES_TARGET/_reindex?pretty=true' -H 'Content-Type: application/json' -d ' | |
{ | |
"source": { | |
"index": "course-draft" | |
}, | |
"dest": { | |
"index": "course", | |
"version_type": "internal" | |
} | |
} | |
' | |
# PASO 12 ELIMINAR INDICE MODIFICADO | |
curl -X DELETE "$URL_ES_TARGET/course-draft" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment