Skip to content

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

@ersinakinci

Description

@ersinakinci
  • 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions