Skip to content

Commit 4afe314

Browse files
Merge branch 'AC-12480' into AC-12482
2 parents 7bc770a + 55752a6 commit 4afe314

File tree

5 files changed

+63
-2
lines changed

5 files changed

+63
-2
lines changed

app/code/Magento/CatalogSearch/i18n/en_US.csv

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,4 +39,6 @@ name,name
3939
"Rebuild Catalog product fulltext search index","Rebuild Catalog product fulltext search index"
4040
"Please enter a valid price range.","Please enter a valid price range."
4141
"This value must be compatible with the corresponding setting in the configured search engine. Be aware: a low query length limit may cause the performance impact.","This value must be compatible with the corresponding setting in the configured search engine. Be aware: a low query length limit may cause the performance impact."
42-
"This value must be compatible with the corresponding setting in the configured search engine.","This value must be compatible with the corresponding setting in the configured search engine."
42+
"This value must be compatible with the corresponding setting in the configured search engine.","This value must be compatible with the corresponding setting in the configured search engine."
43+
"If not specified, Default Search Engine will be used.","If not specified, Default Search Engine will be used."
44+
"This search engine option is no longer supported by Adobe. It is recommended to use OpenSearch as a search engine instead.","This search engine option is no longer supported by Adobe. It is recommended to use OpenSearch as a search engine instead."
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
<?xml version="1.0"?>
2+
<!--
3+
/**
4+
* Copyright 2024 Adobe
5+
* All Rights Reserved.
6+
*/
7+
-->
8+
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
9+
<body>
10+
<referenceContainer name="js">
11+
<block class="Magento\Backend\Block\Template" name="search_engine_comment_js" template="Magento_CatalogSearch::search_engine_comment.phtml"/>
12+
</referenceContainer>
13+
</body>
14+
</page>
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<?php
2+
/**
3+
* Copyright 2024 Adobe
4+
* All Rights Reserved.
5+
*/
6+
?>
7+
<script type="text/x-magento-init">
8+
{
9+
"*": {
10+
"Magento_CatalogSearch/js/search-engine-comment": {}
11+
}
12+
}
13+
</script>
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
/**
2+
* Copyright 2024 Adobe
3+
* All Rights Reserved.
4+
*/
5+
require([
6+
'jquery',
7+
'domReady!',
8+
'mage/translate'
9+
], function ($) {
10+
'use strict';
11+
12+
$(function () {
13+
const engineField = $('#catalog_search_engine');
14+
const commentContainer = $('#row_catalog_search_engine p');
15+
16+
const updateCommentText = () => {
17+
const engineValue = engineField.val(),
18+
defaultText = $.mage.__('If not specified, Default Search Engine will be used.'),
19+
unsupportedText = $.mage.__('This search engine option is no longer supported by Adobe. ' +
20+
'It is recommended to use OpenSearch as a search engine instead.'),
21+
newCommentText = ['elasticsearch7', 'elasticsearch8'].includes(engineValue) ?
22+
unsupportedText : defaultText;
23+
24+
if (commentContainer.text() !== newCommentText) {
25+
commentContainer.text(newCommentText);
26+
}
27+
};
28+
29+
engineField.change(updateCommentText);
30+
updateCommentText();
31+
});
32+
});

setup/src/Magento/Setup/Model/SearchConfigOptionsList.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ public function getAvailableSearchEngineList(): array
150150
{
151151
return [
152152
'elasticsearch7' => 'Elasticsearch 7.x (deprecated)',
153-
'elasticsearch8' => 'Elasticsearch 8.x',
153+
'elasticsearch8' => 'Elasticsearch 8.x (deprecated)',
154154
'opensearch' => 'OpenSearch'
155155
];
156156
}

0 commit comments

Comments
 (0)