Description
Rewrite much of the code base to make it easier to maintain and more stable.
This suggestion is only aimed at the code a user might interact with, I made a separate issue for refactoring the test suite: #300.
Basic example
lib/meilisearch.rb is far too big to reason about
Similarly named instance and class methods where one often just calls the other
Return values are sort of random and inconsistent
Methods often have side-effects
Methods often have hacks waiting to break at any moment
Logic is repeated in many places
Some code is not reached by tests at all
Difficult to add features such as #152 #267 or fix some issues like #280
Inconsistent public API when it comes to ! methods and method names in general
Flags in method parameters (product.index!(true) does not express what true means)
Poor error reporting (indexing can fail with no warning or return value provided to the user)
There needs to be restructuring to integrate methods or classes to filter by an ActiveRecord (or other ORM) query, such as suggested in #255
There needs to be restructuring to integrate methods for searching multiple indexes with proper document-ORM conversion as required by #254 and #283
Add proper checks and validations to configuration (instead of the current implementation of the meilisearch method)
Description Rewrite much of the code base to make it easier to maintain and more stable. This suggestion is only aimed at the code a user might interact with, I made a separate issue for refactoring the test suite: #300.
Basic example
lib/meilisearch.rb
is far too big to reason about!
methods and method names in generalproduct.index!(true)
does not express whattrue
means)meilisearch
method)