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

Reindex silently fails to update settings when settings are misconfigured #383

Open
ersinakinci opened this issue Jun 30, 2020 · 1 comment

Comments

@ersinakinci
Copy link

  • Rails version: 5.2.4.3
  • Algolia Rails integration version: 1.24.0
  • Algolia Client Version: 1.27.3
  • Language Version: Ruby

Description

If your model's settings are incorrectly configured, .reindex! will update your index while silently failing to update your index's settings. There's no indication given that anything is misconfigured, making any problems with your settings difficult to diagnose.

Steps To Reproduce

I have a Rails model that looks like this:

class MyModel
  algoliasearch do
    attribute :title
    attribute :name

    attributesForFaceting [:title, :name]  # Correctly configured
    customRanking ['asc(title)', 'name'] # Incorrectly configured, name must be 'asc(name)' or 'desc(name)'
  end
end

Running MyModel.reindex! will reindex correctly, but customRanking and attributesForFaceting will silently fail to update because customRanking is incorrectly configured.

There should be an error given so that the user can fix the problem.

@ersinakinci
Copy link
Author

As a partial workaround, it's possible to see the errors by running MyModel.algolia_set_settings, which will visibly fail if your settings are incorrectly configured.

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