如何正确重新导入数据并保留 Algolia 中的设置

How to properly reimport data and keep the settings in Algolia

案例1:在没有设置的情况下设置临时索引后,然后复制到主索引我丢失了主索引中的设置。我必须在其他过程中再次设置设置。

情况二:用settings设置一个temp index后,在settings中指定了index slaves,然后copy到main index,main index失去了slaves,index slaves就属于temp index它不存在,因为在 algolia 复制过程中被删除。

文档说: “在某些情况下,您可能希望完全改变索引的结构方式,并且需要重新索引所有数据。为了在重新导入数据时保留现有服务 运行,我们建议使用临时索引和原子移动。 https://www.algolia.com/doc/node#atomical-re-indexing

案例1可以,但有一小段时间主索引没有设置。

就像这个声明说的那样:“为了保留您现有的服务 运行,同时重新导入您的数据” - 我必须使用未指定索引从站的设置来设置临时索引,然后重新导入,然后在其他进程中再次设置完整设置?避免主索引没有设置的那个小时刻。

的确,使用临时索引时,需要在移动前指定主索引的设置。

执行此操作时唯一不应该发送的设置是 slaves,因为 move_index 操作不会覆盖它。

它以前没有出现在文档中。现在修改为包含a warning关于这个:

You should set all the settings of the main index on the temporary one, except the slaves one. The move_index operation will override all the settings of the destination index except this one.