From 76cdf76007e849266108ad1514fab1a3935006d7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20Noco=C5=84?= Date: Tue, 25 Feb 2025 14:30:57 +0100 Subject: [PATCH 1/7] Changed examples deleting Elasticsearch indices --- .../search_engines/elasticsearch/elasticsearch_overview.md | 7 ++++--- docs/update_and_migration/from_4.5/update_from_4.5.md | 5 +++-- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/docs/search/search_engines/elasticsearch/elasticsearch_overview.md b/docs/search/search_engines/elasticsearch/elasticsearch_overview.md index c84ba47a66..ec1591db3b 100644 --- a/docs/search/search_engines/elasticsearch/elasticsearch_overview.md +++ b/docs/search/search_engines/elasticsearch/elasticsearch_overview.md @@ -24,11 +24,12 @@ To proceed you need to be familiar with how indexing, filtering and queries work Whenever you make any changes in case of variables (for example, environmental ones) or configuration files, you need to erase Elasticsearch index, update the schema, and rebuild the index. -To delete the index, you can use an HTTP request. -Use the command as in the following example: +To delete the index, use the [delete index REST API](https://www.elastic.co/guide/en/elasticsearch/reference/7.17/indices-delete-index.html). +Use the commands as in the following example: ```bash -curl --request DELETE 'https://elasticsearch:9200/_all' +curl --request DELETE 'https://elasticsearch:9200/default_location*' +curl --request DELETE 'https://elasticsearch:9200/default_content*' ``` To update the schema and then reindex the search, use the following commands: diff --git a/docs/update_and_migration/from_4.5/update_from_4.5.md b/docs/update_and_migration/from_4.5/update_from_4.5.md index 025b2f1779..7c23da4695 100644 --- a/docs/update_and_migration/from_4.5/update_from_4.5.md +++ b/docs/update_and_migration/from_4.5/update_from_4.5.md @@ -489,11 +489,12 @@ Restart Solr for `solrconfig.xml` changes to take effect. Elasticsearch schema's templates change, for example, with the addition of new features such as spellchecking. When this happens, you need to erase the index, update the schema, and rebuild the index. -To delete the index, you can use an HTTP request. +To delete the index, use the [delete index REST API](https://www.elastic.co/guide/en/elasticsearch/reference/7.17/indices-delete-index.html). Use the command as in the following example: ```bash -curl --request DELETE 'https://elasticsearch:9200/_all' +curl --request DELETE 'https://elasticsearch:9200/default_location*' +curl --request DELETE 'https://elasticsearch:9200/default_content*' ``` To update the schema, and then reindex the content, use the following commands: From b4003b54bff0272e72f39c3d85b2676bfeeb6c88 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20Noco=C5=84?= Date: Fri, 10 Oct 2025 12:10:16 +0200 Subject: [PATCH 2/7] Added mention about custom indices. Extrcted to snippet --- .../elasticsearch/elasticsearch_overview.md | 15 +--------- docs/snippets/elasticsearch_clear_index.md | 30 +++++++++++++++++++ .../from_4.5/update_from_4.5.md | 15 +--------- 3 files changed, 32 insertions(+), 28 deletions(-) create mode 100644 docs/snippets/elasticsearch_clear_index.md diff --git a/docs/search/search_engines/elasticsearch/elasticsearch_overview.md b/docs/search/search_engines/elasticsearch/elasticsearch_overview.md index ec1591db3b..1b822f596e 100644 --- a/docs/search/search_engines/elasticsearch/elasticsearch_overview.md +++ b/docs/search/search_engines/elasticsearch/elasticsearch_overview.md @@ -24,17 +24,4 @@ To proceed you need to be familiar with how indexing, filtering and queries work Whenever you make any changes in case of variables (for example, environmental ones) or configuration files, you need to erase Elasticsearch index, update the schema, and rebuild the index. -To delete the index, use the [delete index REST API](https://www.elastic.co/guide/en/elasticsearch/reference/7.17/indices-delete-index.html). -Use the commands as in the following example: - -```bash -curl --request DELETE 'https://elasticsearch:9200/default_location*' -curl --request DELETE 'https://elasticsearch:9200/default_content*' -``` - -To update the schema and then reindex the search, use the following commands: - -```bash -php bin/console ibexa:elasticsearch:put-index-template --overwrite -php bin/console ibexa:reindex -``` +[[% include 'snippets/elasticsearch_clear_index.md' %]] diff --git a/docs/snippets/elasticsearch_clear_index.md b/docs/snippets/elasticsearch_clear_index.md new file mode 100644 index 0000000000..da81b12c34 --- /dev/null +++ b/docs/snippets/elasticsearch_clear_index.md @@ -0,0 +1,30 @@ +To delete an index, you can use the ElasticSearch's REST API. + +First, use the [`_cat/indices` endpoint](https://www.elastic.co/guide/en/elasticsearch/reference/7.17/cat-indices.html) to list existing indices: + +``` bash +yellow open default_location_eng_gb_54 DoSFV-CtQFylKKVvd48YfA 1 1 1 0 16.7kb 16.7kb +yellow open default_location_eng_gb_42 3Z_IrWVHQh2m37jPqQBOcQ 1 1 1 0 20.1kb 20.1kb +yellow open default_content_eng_gb_45 y-t4uNQwR4KRJ-N9i3zUog 1 1 1 0 21.3kb 21.3kb +yellow open default_content_eng_gb_46 e_LS5qG3RIih6iQRPsNp-w 1 1 1 0 22.5kb 22.5kb +yellow open default_content_eng_gb_1 101-1-tQS_2KSvNs2X2JAQ 1 1 17 0 39.8kb 39.8kb +yellow open default_location_eng_gb_46 fSGtpljwTpGfascFechmww 1 1 1 0 21kb 21kb +(...) +``` + +Create a list containing all indices used by the DXP, including the [custom indices](search/search_engines/elasticsearch/configure_elasticsearch.md#define-field-type-mappingtemplates) as well. + +Then, delete them by using the [delete index endpoint](https://www.elastic.co/guide/en/elasticsearch/reference/7.17/indices-delete-index.html) + +``` bash +curl --request DELETE 'https://elasticsearch:9200/default_location*' +curl --request DELETE 'https://elasticsearch:9200/default_content*' +(...) +``` + +To update the schema and then reindex the search, use the following commands: + +``` bash +php bin/console ibexa:elasticsearch:put-index-template --overwrite +php bin/console ibexa:reindex +``` diff --git a/docs/update_and_migration/from_4.5/update_from_4.5.md b/docs/update_and_migration/from_4.5/update_from_4.5.md index 7c23da4695..e09bae01ad 100644 --- a/docs/update_and_migration/from_4.5/update_from_4.5.md +++ b/docs/update_and_migration/from_4.5/update_from_4.5.md @@ -489,20 +489,7 @@ Restart Solr for `solrconfig.xml` changes to take effect. Elasticsearch schema's templates change, for example, with the addition of new features such as spellchecking. When this happens, you need to erase the index, update the schema, and rebuild the index. -To delete the index, use the [delete index REST API](https://www.elastic.co/guide/en/elasticsearch/reference/7.17/indices-delete-index.html). -Use the command as in the following example: - -```bash -curl --request DELETE 'https://elasticsearch:9200/default_location*' -curl --request DELETE 'https://elasticsearch:9200/default_content*' -``` - -To update the schema, and then reindex the content, use the following commands: - -```bash -php bin/console ibexa:elasticsearch:put-index-template --overwrite -php bin/console ibexa:reindex -``` +[[% include 'snippets/elasticsearch_clear_index.md' %]] ## Update to v4.6.latest From e878a7b16a06abd04be9888a9c7edb7edfb03563 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20Noco=C5=84?= Date: Tue, 20 Jan 2026 10:26:16 +0100 Subject: [PATCH 3/7] Adjusted to ES 8.19 --- docs/snippets/elasticsearch_clear_index.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/snippets/elasticsearch_clear_index.md b/docs/snippets/elasticsearch_clear_index.md index da81b12c34..441bf92b9c 100644 --- a/docs/snippets/elasticsearch_clear_index.md +++ b/docs/snippets/elasticsearch_clear_index.md @@ -1,6 +1,6 @@ To delete an index, you can use the ElasticSearch's REST API. -First, use the [`_cat/indices` endpoint](https://www.elastic.co/guide/en/elasticsearch/reference/7.17/cat-indices.html) to list existing indices: +First, use the [`_cat/indices` endpoint](https://www.elastic.co/guide/en/elasticsearch/reference/8.19/cat-indices.html) to list existing indices: ``` bash yellow open default_location_eng_gb_54 DoSFV-CtQFylKKVvd48YfA 1 1 1 0 16.7kb 16.7kb @@ -14,7 +14,7 @@ yellow open default_location_eng_gb_46 fSGtpljwTpGfascFechmww 1 1 1 0 21kb Create a list containing all indices used by the DXP, including the [custom indices](search/search_engines/elasticsearch/configure_elasticsearch.md#define-field-type-mappingtemplates) as well. -Then, delete them by using the [delete index endpoint](https://www.elastic.co/guide/en/elasticsearch/reference/7.17/indices-delete-index.html) +Then, delete them by using the [delete index endpoint](https://www.elastic.co/guide/en/elasticsearch/reference/8.19/indices-delete-index.html) ``` bash curl --request DELETE 'https://elasticsearch:9200/default_location*' From 65f9da6c3ffb3244773e9e39b5ed7907c17a01fd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20Noco=C5=84?= Date: Tue, 20 Jan 2026 12:46:31 +0100 Subject: [PATCH 4/7] Made path absolute --- docs/snippets/elasticsearch_clear_index.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/snippets/elasticsearch_clear_index.md b/docs/snippets/elasticsearch_clear_index.md index 441bf92b9c..a610f25388 100644 --- a/docs/snippets/elasticsearch_clear_index.md +++ b/docs/snippets/elasticsearch_clear_index.md @@ -12,7 +12,7 @@ yellow open default_location_eng_gb_46 fSGtpljwTpGfascFechmww 1 1 1 0 21kb (...) ``` -Create a list containing all indices used by the DXP, including the [custom indices](search/search_engines/elasticsearch/configure_elasticsearch.md#define-field-type-mappingtemplates) as well. +Create a list containing all indices used by the DXP, including the [custom indices](/search/search_engines/elasticsearch/configure_elasticsearch.md#define-field-type-mapping-templates) as well. Then, delete them by using the [delete index endpoint](https://www.elastic.co/guide/en/elasticsearch/reference/8.19/indices-delete-index.html) From 1caf64f4a514337b0dc78d17b6e1d72b03439f8f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20Noco=C5=84?= Date: Tue, 20 Jan 2026 13:43:42 +0100 Subject: [PATCH 5/7] Fixed typo --- docs/snippets/elasticsearch_clear_index.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/snippets/elasticsearch_clear_index.md b/docs/snippets/elasticsearch_clear_index.md index a610f25388..dcc255756b 100644 --- a/docs/snippets/elasticsearch_clear_index.md +++ b/docs/snippets/elasticsearch_clear_index.md @@ -1,4 +1,4 @@ -To delete an index, you can use the ElasticSearch's REST API. +To delete an index, you can use the Elasticsearch's REST API. First, use the [`_cat/indices` endpoint](https://www.elastic.co/guide/en/elasticsearch/reference/8.19/cat-indices.html) to list existing indices: From 4249e73e6b9246dca6e25f2e12cc446cde273ff3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20Noco=C5=84?= Date: Tue, 20 Jan 2026 14:52:07 +0100 Subject: [PATCH 6/7] Review feedback --- docs/snippets/elasticsearch_clear_index.md | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/docs/snippets/elasticsearch_clear_index.md b/docs/snippets/elasticsearch_clear_index.md index dcc255756b..1f6603a1d2 100644 --- a/docs/snippets/elasticsearch_clear_index.md +++ b/docs/snippets/elasticsearch_clear_index.md @@ -1,6 +1,7 @@ To delete an index, you can use the Elasticsearch's REST API. -First, use the [`_cat/indices` endpoint](https://www.elastic.co/guide/en/elasticsearch/reference/8.19/cat-indices.html) to list existing indices: +First, use the [`_cat/indices` endpoint](https://www.elastic.co/guide/en/elasticsearch/reference/8.19/cat-indices.html) to list existing indices. +For example, the command `curl -H "Accept: application/text" elasticsearch:9200/_cat/indices` returns output like the following: ``` bash yellow open default_location_eng_gb_54 DoSFV-CtQFylKKVvd48YfA 1 1 1 0 16.7kb 16.7kb @@ -22,6 +23,11 @@ curl --request DELETE 'https://elasticsearch:9200/default_content*' (...) ``` +!!! tip + + To quickly delete all existing Elasticsearch indices, you can use the `_all` keyword as the name of the index, as in the following request: `curl --request DELETE 'https://elasticsearch:9200/_all`. + Always review the list of existing indices and confirm they are safe to delete before executing this command, as it permanently removes data. + To update the schema and then reindex the search, use the following commands: ``` bash From 1fd4cf9f65975944f136228d85614a23f0060e02 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20Noco=C5=84?= Date: Tue, 20 Jan 2026 16:16:46 +0100 Subject: [PATCH 7/7] Update docs/snippets/elasticsearch_clear_index.md --- docs/snippets/elasticsearch_clear_index.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/snippets/elasticsearch_clear_index.md b/docs/snippets/elasticsearch_clear_index.md index 1f6603a1d2..87f029b50d 100644 --- a/docs/snippets/elasticsearch_clear_index.md +++ b/docs/snippets/elasticsearch_clear_index.md @@ -25,7 +25,7 @@ curl --request DELETE 'https://elasticsearch:9200/default_content*' !!! tip - To quickly delete all existing Elasticsearch indices, you can use the `_all` keyword as the name of the index, as in the following request: `curl --request DELETE 'https://elasticsearch:9200/_all`. + To quickly delete all existing Elasticsearch indices, you can use the `_all` keyword as the name of the index, as in the following request: `curl --request DELETE https://elasticsearch:9200/_all`. Always review the list of existing indices and confirm they are safe to delete before executing this command, as it permanently removes data. To update the schema and then reindex the search, use the following commands: