fecshop xunsearch 如何自定义search.ini 配置文件

Xunsearch · Fecmall · 于 5年前 发布 · 1703 次阅读

对于fecshop的配置,打开文件 @fecshop/config/components/xunSearch.php 可以看到

return [
    'xunsearch' => [
        'class' => 'hightman\xunsearch\Connection', // 此行必须
        'iniDirectory' => '@fecshop/config/xunsearch',    // 搜索 ini 文件目录,默认:@vendor/hightman/xunsearch/app
        'charset' => 'utf-8',   // 指定项目使用的默认编码,默认即时 utf-8,可不指定
    ],

iniDirectory 指明init文件路径为:@fecshop/config/xunsearch,进入这个文件夹可以发现文件 @fecshop/config/xunsearch/search.ini

关于search.ini的内容以及解读参看:http://www.fecshop.com/topic/1504

这个是fecshop的对于xunsearch的配置文件,如果你想要自定义,那么,在本地config文件重写这个xunsearch components配置

譬如新建文件 @common/config/xunsearch/search.ini,然后在配置文件 @common/config/fecshop_local.php文件中添加配置

在return数组中添加 xunsearch components的配置,这个会覆盖fecshop的默认配置

return [
    'modules'  => $modules,
    'services' => $services,
    'components' => [
        'xunsearch' => [
            'iniDirectory' => '@common/config/xunsearch',    // 搜索 ini 文件目录,默认:@vendor/hightman/xunsearch/app
        ],
    ]
];

然后在文件 @common/config/xunsearch/search.ini 中添加你的xunsearch配置就可以了。

共收到 0 条回复
没有找到数据。
添加回复 (需要登录)
需要 登录 后方可回复, 如果你还没有账号请点击这里 注册
Your Site Analytics