TYPO3 10 SOLR 语言和 baseVariants 站点 config.yaml
TYPO3 10 SOLR languages and baseVariants sites config.yaml
如何在 TYPO3 中写入站点 config.yaml 用于 SOLR 扩展:
2 种语言,验收和生产。
我从虚拟主机那里得到:
solr_host_read: solrprod02.xx.io
solr_core_read:
- x_acc_nl
- x_acc_en
- x_prod_nl
- x_prod_en
从 EXT:solr 11 开始,似乎不再允许连接出现打字错误条件(传统模式)。
那么如何为每个baseVariant和每个语言配置核心?
文档中的示例仅提供语言提示,不提供 baseVariants https://docs.typo3.org/p/apache-solr-for-typo3/solr/11.1/en-us/Backend/ConnectionManager.html
一个非常简单的方法是使用 typo3conf/AdditionalConfiguration.php
文件并检查那里的上下文:
<?php
$context = (string)\TYPO3\CMS\Core\Core\Environment::getContext();
if ($context === 'Production/Staging') {
putenv('SOLR_ENABLED_READ=true');
putenv('SOLR_HOST=solr');
putenv('SOLR_PATH=/solr/');
putenv('SOLR_PORT=8983');
putenv('SOLR_SCHEME=http');
putenv('SOLR_CORE_NAME_DE=core_de');
putenv('SOLR_USER=');
putenv('SOLR_PWD=');
}
并在您的站点配置中
solr_enabled_read: true
solr_host_read: '%env(SOLR_HOST)%'
solr_password_read: '%env(SOLR_PWD)%'
solr_path_read: '%env(SOLR_PATH)%'
solr_port_read: '%env(SOLR_PORT)%'
solr_scheme_read: '%env(SOLR_SCHEME)%'
solr_use_write_connection: false
solr_username_read: '%env(SOLR_USER)%'
languages:
-
title: Deutsch
enabled: true
languageId: '0'
base: /
typo3Language: de
locale: de
iso-639-1: de
navigationTitle: Deutsch
hreflang: de-de
direction: ''
flag: at
solr_core_read: '%env(SOLR_CORE_NAME_DE)%'
如何在 TYPO3 中写入站点 config.yaml 用于 SOLR 扩展:
2 种语言,验收和生产。
我从虚拟主机那里得到:
solr_host_read: solrprod02.xx.io
solr_core_read:
- x_acc_nl
- x_acc_en
- x_prod_nl
- x_prod_en
从 EXT:solr 11 开始,似乎不再允许连接出现打字错误条件(传统模式)。
那么如何为每个baseVariant和每个语言配置核心?
文档中的示例仅提供语言提示,不提供 baseVariants https://docs.typo3.org/p/apache-solr-for-typo3/solr/11.1/en-us/Backend/ConnectionManager.html
一个非常简单的方法是使用 typo3conf/AdditionalConfiguration.php
文件并检查那里的上下文:
<?php
$context = (string)\TYPO3\CMS\Core\Core\Environment::getContext();
if ($context === 'Production/Staging') {
putenv('SOLR_ENABLED_READ=true');
putenv('SOLR_HOST=solr');
putenv('SOLR_PATH=/solr/');
putenv('SOLR_PORT=8983');
putenv('SOLR_SCHEME=http');
putenv('SOLR_CORE_NAME_DE=core_de');
putenv('SOLR_USER=');
putenv('SOLR_PWD=');
}
并在您的站点配置中
solr_enabled_read: true
solr_host_read: '%env(SOLR_HOST)%'
solr_password_read: '%env(SOLR_PWD)%'
solr_path_read: '%env(SOLR_PATH)%'
solr_port_read: '%env(SOLR_PORT)%'
solr_scheme_read: '%env(SOLR_SCHEME)%'
solr_use_write_connection: false
solr_username_read: '%env(SOLR_USER)%'
languages:
-
title: Deutsch
enabled: true
languageId: '0'
base: /
typo3Language: de
locale: de
iso-639-1: de
navigationTitle: Deutsch
hreflang: de-de
direction: ''
flag: at
solr_core_read: '%env(SOLR_CORE_NAME_DE)%'