Releases: WTTJ/algoliax
v0.9.1
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
v0.9.0
Breaking change
ALGOLIA_API_KEY and ALGOLIA_APPLICATION_ID aren't read anymore from system env variables inside the code. Only application config is now used (as documented).
If you used these env vars, you should now read them inside the config:
config :algoliax,
api_key: System.get_env("ALGOLIA_API_KEY"),
application_id: System.get_env("ALGOLIA_APPLICATION_ID")
What's Changed
- chore(deps-dev): bump postgrex from 0.19.1 to 0.19.2 in the patches group by @dependabot in #80
- chore(deps-dev): bump credo from 1.7.8 to 1.7.9 in the patches group by @dependabot in #81
- chore: standardize dependabot config by @davidjulien in #84
- chore: add workflow to publish package on release by @davidjulien in #82
- chore: add CODEOWNERS by @davidjulien in #83
- chore(deps-dev): bump credo from 1.7.9 to 1.7.10 by @dependabot in #85
- chore: update publish_public_package workflow by @davidjulien in #86
- chore(deps-dev): bump postgrex from 0.19.2 to 0.19.3 by @dependabot in #87
- chore(deps-dev): bump ex_doc from 0.34.2 to 0.35.0 by @dependabot in #88
- chore(deps-dev): bump ex_doc from 0.35.0 to 0.35.1 by @dependabot in #89
- feat: don't read anymore ALGOLIA_API_KEY and ALGOLIA_APPLICATION_ID env vars in code by @davidjulien in #90
- feat: read algolia mock port from application config during tests by @davidjulien in #91
- chore: new version 0.9.0 by @davidjulien in #92
New Contributors
- @davidjulien made their first contribution in #84
Full Changelog: v0.8.3...v0.9.0
v0.8.3
New
- New
if
option for replicas which decides if they should be updated or not.- If not provided, the replica will be updated (so no impact on existing configurations)
- Must be
nil|true|false
or the name (atom) of a arity-0 func which returns a boolean - If provided, the replica will be updated only if the value is
true
or the function returnstrue
Other changes
- chore(deps): bump inflex from 2.0.0 to 2.1.0 in the minors group by @dependabot in #76
- chore(deps-dev): bump credo from 1.7.7 to 1.7.8 in the patches group by @dependabot in #77
- chore(deps): bump the patches group with 2 updates by @dependabot in #78
New Contributors
- @dependabot made their first contribution in #76
Full Changelog: v0.8.2...v0.8.3
v0.8.2
- Upgrading all dependencies
- Added
dependabot
to the repository
v0.8.1
New
- Added new optional settings
default_filters
to be applied automatically when callingreindex
without query
orreindex_atomic
. Defaults to%{}
which was the previous behavior.
defmodule BlondeBeerIndexer do
use Algoliax.Indexer,
index_name: :blonde_beers,
object_id: :name,
schemas: [Beer],
default_filters: %{where: [kind: "blonde"]} # <---
end
defmodule BeerIndexer do
use Algoliax.Indexer,
index_name: :various_beers,
object_id: :name,
schemas: [Beer1, Beer2, Beer3],
default_filters: :get_filters # <--- can be a function
def get_filters do
%{
Beer1 => %{where: [kind: "blonde"]}, # <--- custom filter for Beer1
:where => [kind: "brune"] # <--- Will be used for Beer2 and Beer3
}
end
end
Contributing
- New
CONTRIBUTING.md
file - Simplified the
config/test.exs
file - Provide a
.env.example
file to help contributors to setup their environment
v0.8.0
Breaking changes
- Errors for
get_object
andget_objects
are now of arity 4 and returns the original request as last attribute
New
- Added possibility to have multiple indexes for a model (applies for replicas as well)
- Added
build_object/2
with the index name as second parameter (useful for translations for example)
v0.7.1
Breaking changes
- Add
wait_task/1
(https://hexdocs.pm/algoliax/Algoliax.html#wait_task/1) - Indexer operation returns a
%Algoliax.Reponse{}
(#51)
Bug fix
- Ensure clean up on reindex fail
v0.6.0
v0.5.0
v0.5.0
v0.4.3
v0.4.3