如何用TYPO3编写用于SOLR扩展的站点config.yaml:
2种语言,验收和制作。
我从万维网上得到:
solr_host_read: solrprod02.xx.io
solr_core_read:
因为EXT:solr 11似乎不再允许输入条件用于连接(遗留模式)。
那么,如何为每个baseVariant和每种语言配置核心呢?
文档中的示例仅为语言提供提示,而不是为baseVariants https://docs.typo3.org/p/apache-solr-for-typo3/solr/11.1/en-us/Backend/ConnectionManager.html提供提示。
发布于 2021-09-14 11:42:59
一个非常简单的方法是使用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)%'
https://stackoverflow.com/questions/69176440
复制相似问题