rake 태스크를 사용하여 algolia:reindex를 실행하던 중 다음과 같은 오류로 인해 크래시가 발생했습니다.
Clearing users from Algolia
Pushing users to Algolia
...
Successfully pushed 1849 users to Algolia
Clearing tags from Algolia
Pushing tags to Algolia
..
Successfully pushed 53 tags to Algolia
Clearing posts from Algolia
Pushing posts to Algolia
rake aborted!
Algolia::AlgoliaHttpError: Record at the position 662 objectID=690 is too big size=20920/20000 bytes. Please have a look at https://www.algolia.com/doc/guides/sending-and-managing-data/prepare-your-data/in-depth/index-and-records-size-and-usage-limitations/#record-size-limits (Algolia::AlgoliaHttpError)
제 판단으로는 이 플러그인에는 긴 게시글을 별도의 청크로 분할하는 기능이 포함되어 있지 않습니다. @index.save_objects 호출 직전에 다음 코드를 추가하여 긴 게시글을 제외함으로써 문제를 우회할 수 있었습니다.
objects.reject! { |object| object.to_json.bytesize > 20000 }
하지만 이렇게 하면 해당 게시글들이 인덱싱되지 않는다는 점도 함께 의미합니다.