Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Configure synonyms #103

Open
mberrueta opened this issue Feb 12, 2025 · 0 comments
Open

Configure synonyms #103

mberrueta opened this issue Feb 12, 2025 · 0 comments

Comments

@mberrueta
Copy link

First, thanks for this library, is awesome !

It seems that the library support it, but for some reason is not working (most likely I'm doing wrong)

In the settings section you have defined synonyms


But I can't find any example

so if I configure

 use Algoliax.Indexer,
    index_name: :locations,
    object_id: :object_id,
    algolia: [
      attributes_for_faceting: ["city", "state", "neighborhood"],
      searchable_attributes: ["city", "state", "neighborhood"],
      custom_ranking: ["desc(importance)"],
      ranking: ["desc(importance)", "desc(custom_ranking)"],
      replicas: [
        "locations_importance_asc"
      ],
      synonyms: ["SSA", "Salvador", "Salvador da Bahia"]
    ]

I get

** (Algoliax.AlgoliaApiError) Algolia HTTP error:

400 : String is supported only for attributes, attributesToRetrieve, unretrievableAttributes, attributesToHighlight, attributesToSnippet, ranking, customRanking, attributesForFaceting, removeWordsIfNoResults, attributeCriteriaComputedBy, queryType and reRankingApplyFilter attributes near line:1 column:1352

    (algoliax 0.9.1) lib/algoliax/client.ex:48: Algoliax.Client.handle_error/4
    (algoliax 0.9.1) lib/algoliax/resources/index.ex:12: Algoliax.Resources.Index.ensure_settings/4
    (elixir 1.18.2) lib/enum.ex:987: Enum."-each/2-lists^foreach/1-0-"/2
    (algoliax 0.9.1) lib/algoliax/utils.ex:26: Algoliax.Utils.index_name/2
    (algoliax 0.9.1) lib/algoliax/resources/object.ex:25: Algoliax.Resources.Object.save_objects/4

Is there any way to configure it?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant