Currently, our Shopify plugin does not support afterDistinct for facets, and there is no out-of-the-box feature or solution to configure this setting.
As a workaround, you can enable the "Prevent Syncing Facets to Algolia indices" setting (https://www.algolia.com/doc/integration/shopify/getting-started/configuration#prevent-syncing-facets-to-algolia-indices) in the Facets configuration within the Algolia Shopify app. This ensures that the Algolia Shopify extension no longer syncs facet information (attributesForFaceting) with your indices, meaning it won't automatically add, remove, or reorder facets. You can then manage your facets and enable afterDistinct directly through the Facets configuration in the Algolia index dashboard.