【问题标题】:Algolia / Wordpress: Index is pushing to wp_searcheable_posts but not other indexAlgolia / Wordpress:索引正在推送到 wp_searcheable_posts 但不是其他索引
【发布时间】:2019-03-14 11:59:42
【问题描述】:

我正在使用 Algolia Wordpress 插件,并希望将一些 ACF 字段添加到我的 Algolia 索引中。

以下代码来自 Algolia 文档,我遇到的问题是它没有更新 Algolia 索引“wp_posts_doctor”,您可以从名为“doctor”的自定义帖子类型中猜测索引。

下面看起来很简单,但显然第一个过滤器没有触发。我尝试了很多组合,但不确定正确的语法是什么。

我用 doctor 替换了 post,_doctor_post ...没有骰子。

有人知道什么是正确的约定吗?谢谢。

add_filter('algolia_post_shared_attributes', '_provider_attributes', 10, 2); add_filter('algolia_searchable_post_shared_attributes', '_provider_attributes', 10, 2);

【问题讨论】:

    标签: wordpress algolia


    【解决方案1】:

    所以默认过滤器,不需要修改。奇怪的是,为了为自定义帖子类型推高特定索引,我进入 WP 管理中的 Algolia Search > Autocomplete,然后单击相关帖子类型的重新索引。就是这样。

    add_filter( 'algolia_post_shared_attributes', '_provider_attributes', 10, 2 );
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2017-09-21
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多