New
The Algoliax.Indexer
now supports dynamic definition for the :algolia
settings. It can supports 2 types of configurations:
- (Existing) Keyword list
- (New) Name of a 0-arity function that returns a keyword list
defmodule People do
use Algoliax.Indexer,
index_name: :people,
object_id: :reference,
schemas: [People],
algolia: :runtime_algolia
def runtime_algolia do
[
attribute_for_faceting: ["age"],
custom_ranking: ["desc(updated_at)"]
]
end
end
Also added 2 new exceptions for the :algolia
configuration: InvalidAlgoliaSettingsFunctionError
and InvalidAlgoliaSettingsConfigurationError
Other changes
Existing direct calls to Algoliax.Settings.replica_settings/2
will still work but will not benefit from
the dynamic :algolia
configuration. Please use Algoliax.Settings.replica_settings/3
instead.
PR details
- chore(deps): bump ecto from 3.12.4 to 3.12.5 by @dependabot in #93
- fix: doc indexname at runtime by @StephaneRob in #94
- feat: allow :algolia settings to be either static or dynamic by @Jordan-Kowal in #95
- release: 0.9.1 by @Jordan-Kowal in #96
Full Changelog: v0.9.0...v0.9.1