Algolia Wordpress 索引导致重复条目

Algolia Wordpress indexing cause duplicate entries

我在 Woocommerce 网站上使用 Algolia 插件进行搜索,从 woocommerce algolia 插件建立索引后,在 algolia 仪表板中我看到有 多个重复条目 (除了对象 ID 之外的所有内容都相同) 具有 不同对象 ID 和相同 post id 的相同产品。但是在 wordpress 仪表板中只有一个产品条目。这仅发生在某些产品中,并非全部。 任何人都请帮助我。

请允许我引用 docs of the Algolia plugin for WordPress:

I have more records than I have posts, is that normal? This is intentional and allows you to fully leverage the Algolia engine.

The plugin takes care of the splitting for you and makes sure that your articles are fully indexed independently from their size.

This means that even if your article is huge and you are searching for a word that is at the very bottom, you will have it as part of the suggested articles.

因此,为了回答您的问题,您预计每个 post 有多个记录。这可确保 Algolia 尽可能快地为您提供相关结果。

您最终可以通过在 wp-config.php 文件中定义常量来禁用 post 拆分:define( 'ALGOLIA_SPLIT_POSTS', false ); 如果您对在 post 的内容中搜索不感兴趣,我只建议您这样做。一般来说,禁用 post 拆分会对结果的相关性产生负面影响。