Releases: WTTJ/algoliax
v0.10.0
New
Added the synonyms settings to the Algoliax.Indexer.
It allows you to automatically setup synonyms for your indexes when calling MyIndexer.configure_index()
If not specified or set to nil, the synonyms will not be configured.
Otherwise, the following keywords are expected, with each key having a default value:
synonyms: a list of synonym groups, as expected by Algolia. Default[]replace_existing_synonyms: Whether to replace existing synonyms. Defaulttrueforward_to_replicas: Whether to forward synonyms to replicas. Defaulttrue
You can also provide an arity-1 function (that takes the index_name) that returns the same keyword list.
If using forward_to_replicas: true, make sure not to specify synonyms on the replicas themselves to avoid conflicts/overwrites.
defmodule Global do
use Algoliax.Indexer,
index_name: :people,
object_id: :reference,
schemas: People,
algolia: [
attribute_for_faceting: ["age"],
custom_ranking: ["desc(updated_at)"]
]
synonyms: [
synonyms: [
%{
objectID: "synonym1",
type: "synonym",
synonyms: ["pants", "trousers", "slacks"],
...
},
%{
objectID: "synonym2",
...
}
],
forward_to_replicas: false,
replace_existing_synonyms: false
]
endPRs
- fix: update supported settings list by @Jordan-Kowal in #108
- feat: handle synonyms when configuring index and replicas by @Jordan-Kowal in #109
- chore: version bump to 0.10.0 and changelog update by @Jordan-Kowal in #113
Deps
- chore(deps-dev): bump ex_doc from 0.35.1 to 0.36.1 by @dependabot in #97
- chore(deps-dev): bump credo from 1.7.10 to 1.7.11 by @dependabot in #98
- chore(deps-dev): bump ex_doc from 0.36.1 to 0.37.0 by @dependabot in #100
- chore(deps-dev): bump postgrex from 0.19.3 to 0.20.0 by @dependabot in #101
- chore(deps-dev): bump ex_doc from 0.37.0 to 0.37.1 by @dependabot in #102
- chore(deps): bump hackney from 1.20.1 to 1.22.0 by @dependabot in #105
- chore(deps-dev): bump ex_doc from 0.37.1 to 0.37.2 by @dependabot in #104
- chore(deps-dev): bump plug_cowboy from 2.7.2 to 2.7.3 by @dependabot in #107
- chore(deps): bump hackney from 1.22.0 to 1.23.0 by @dependabot in #106
- fix: revert hackney back to 1.21.0 by @Jordan-Kowal in #110
- chore(deps-dev): bump ex_doc from 0.37.2 to 0.37.3 by @dependabot in #112
Full Changelog: v0.9.1...v0.10.0
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
endAlso 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
ifoption 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|falseor the name (atom) of a arity-0 func which returns a boolean - If provided, the replica will be updated only if the value is
trueor 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
dependabotto the repository
v0.8.1
New
- Added new optional settings
default_filtersto be applied automatically when callingreindexwithout 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
endContributing
- New
CONTRIBUTING.mdfile - Simplified the
config/test.exsfile - Provide a
.env.examplefile to help contributors to setup their environment
v0.8.0
Breaking changes
- Errors for
get_objectandget_objectsare 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/2with 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