algolia / algoliasearch-django

Seamless integration of Algolia into your Django project.
https://www.algolia.com
MIT License
173 stars 65 forks source link

Fix #238: reindex deletes settings (again) #241

Closed PLNech closed 6 years ago

PLNech commented 6 years ago

From this comment, v1.5.4 did not fix the issue.

For now this PR contains two tests that should assert expected behavior:

The next step is to get more info on the failing use case to compare with these tests.

PLNech commented 6 years ago

Although all tests passed on Travis, testing locally resulted in an error for py27-django19:

Traceback (most recent call last):
  File "runtests.py", line 20, in <module>
    main()
  File "runtests.py", line 13, in main
    django.setup()
  File "/Users/pln/Work/APIClients/algoliasearch-django/.tox/py27-django19/lib/python2.7/site-packages/django/__init__.py", line 18, in setup
    apps.populate(settings.INSTALLED_APPS)
  File "/Users/pln/Work/APIClients/algoliasearch-django/.tox/py27-django19/lib/python2.7/site-packages/django/apps/registry.py", line 85, in populate
    app_config = AppConfig.create(entry)
  File "/Users/pln/Work/APIClients/algoliasearch-django/.tox/py27-django19/lib/python2.7/site-packages/django/apps/config.py", line 90, in create
    module = import_module(entry)
  File "/usr/local/Cellar/python/2.7.14/Frameworks/Python.framework/Versions/2.7/lib/python2.7/importlib/__init__.py", line 37, in import_module
    __import__(name)
  File "/Users/pln/Work/APIClients/algoliasearch-django/algoliasearch_django/__init__.py", line 6, in <module>
    from . import models
  File "/Users/pln/Work/APIClients/algoliasearch-django/algoliasearch_django/models.py", line 9, in <module>
    from algoliasearch.helpers import AlgoliaException
ImportError: No module named algoliasearch.helpers

Once we confirm with @abakar that the bug is fixed, I'll make sure this issue is resolved before releasing.

PLNech commented 6 years ago
PLNech commented 6 years ago

@Haizzz: I just released these changes with v1.5.5, which resolves the deleted rules and synonyms issue, along with another fix.

Could you check if your replica's custom ranking is still getting deleted with this update? If yes, can you share the code where you call algoliasearch.register and the definition of the eventual AlgoliaIndex? (I'll open a separate issue to track this).