forwardToReplicas not working

Hello!

I’ve tried using the forwardToReplicas option, but the replicas don’t inherit searchableAttributes or attributesForFaceting. Is there something I’m missing?

I’m creating 3 indices that have 50+ lines of settings, I’m just trying to keep the code short.

$algolia->initIndex('products')->setSettings([
    'replicas' => [
        'products_popular',
        'products_newest',
    ],
    'ranking' => [
        'desc(trend)',
        'typo',
        'words',
        'filters',
        'proximity',
        'attribute',
        'exact',
        'custom',
    ],
    'searchableAttributes' => [
        'title,slug',
        'unordered(description)',
    ],
], true);

$algolia->initIndex("products_newest")->setSettings([
    'ranking' => [
        'desc(createdAt)',
        'typo',
        'words',
        'filters',
        'proximity',
        'attribute',
        'exact',
        'custom',
    ],
]);

Turns out I need to first create the index, and then set the settings separately.

For the record I’ll add a link to your first request here: https://github.com/algolia/algoliasearch-client-php/issues/299

You raised a valid point though that seems un-documented.

I’ll go ahead and create an issue on our internal documentation repository so that we can improve that part in the future.

Thank you @till.