Algolia index replicas Sorting criteria overriden


Currently, in our node app, we have a replica that has a configured ranking according to some fields,

This is the code for that main index

const algoliaConnection = require('../../algolia-connection');
const { ALGOLIA_FILTERS_REPLICAS_ARRAY } = require('../../constants/algolia-indexes');

const listingFilterDefault = algoliaConnection.initIndex('listingFilterDefault');

// Faceting attributes for now they are used for filtering only not grouping so the index is smaller and faster
const attributesForFaceting = [

const unretrievableAttributes = ['modelUrl'];

// Array fo numeric values only increase performance
const numericAttributesForFiltering = [

// So far the filtering endpoint only has filters and no search attributes so this should be our ranking criteria
const ranking = [


    forwardToReplicas: true,

module.exports = listingFilterDefault;

This index has a few replicas with different sorting criteria. This is an example for a replica

const algoliaConnection = require('../../algolia-connection');
const { ALGOLIA_FILTERS_TOTAL_PRICE_ASC_INDEX_NAME } = require('../../constants/algolia-indexes');

const listingFilterTotalPriceAsc = algoliaConnection.initIndex(ALGOLIA_FILTERS_TOTAL_PRICE_ASC_INDEX_NAME);

const ranking = [

listingFilterTotalPriceAsc.setSettings({ ranking });

module.exports = listingFilterTotalPriceAsc;

for some reason every time our pipeline deploys a new version of our app the algolia replicas lose their custom ranking and and get the custom ranking of the main index and actually it happens to some of the replicas not all of them (side note this happens in our production env only, in our dev env which has the same code but a different algolia app it never happens)

Any help would be appreciated