Indexed nested array replaced by object with count field instead

Hi,

I am working on indexing my objects into Algolia and they look like this:

{
    title: "This is an article",
    authors: [
        {
            first_name: "Alex",
            last_name: "Doe"
        },
        {
            first_name: "John",
            last_name: "Boy"
        }
    ]
}

I am sending this exact object to be indexed in Algolia with the saveObject() method.
I have been struggling to understand why the nested array of authors is converted to the following object in Algolia, making the nested fields not searchable.

{
    title: "This is an article",
    authors: {
        count: 2
    }
}

Any help would be really appreciated.

Thanks!

Hi @alexandre.phiev

Definitely strange, we’re schemaless and should honor the shape of your object. You mention saveObject() – I assume you’re using the JavaScript SDK. Any chance I could see the code snippet?

Also, where are you seeing the transformed object with the count – in the dashboard?

Hi,

Thanks a lot for the reply. I actually figured out that this is due to the Strapi plugin for Algolia and not Algolia itself.

There is a know issue about this: Algolia not indexing relation field, only shows count · Issue #139 · MattieBelt/mattie-strapi-bundle · GitHub

Cheers