添加自定义分类术语方面

时间:2016-12-14 13:21:54

标签: php wordpress facet algolia taxonomy-terms

我有一个名为locations的分类术语,我想在重新索引上添加方面。数据是预期的索引以及可搜索的属性。但是,我用来做这件事似乎不起作用;

function algolia_locations_faceting( array $settings ) {

    $settings['attributesForFaceting'] = array_merge($settings['attributesForFaceting'], [
        'parent',
        'type',
        'taxonomy',
    ]);

    return $settings;
}

\add_filter( 'algolia_terms_locations_index_settings', 'algolia_locations_faceting', 10, 2 );

我有一个类似的方法可以使用algolia_searchable_posts_index_settings过滤器来分割可搜索的帖子,并且按预期工作,所以我不确定为什么一个有效,另一个无效。

任何帮助都将不胜感激。

0 个答案:

没有答案
相关问题