Closed qcaron closed 6 years ago
Following the approach given on algoliasearch-django-example fixed it. I used the approach in the example project some time ago but I thought the documentation was up-to-date and decided to review the way I register indexes.
Another thing is that it is the name of the model is displayed when using the algolia_applysettings
command for example. It would be great to have a full index name (with prefix and suffix) because I thought those were not applied... Until I checked the dashboard and displayed the list of indexes in the Algolia app - in the dashboard.
Cheers!
Hi @qcaron,
Thanks for your valuable feedback. We'll look into it and update documentation. Unfortunately, for now, our doc is still manage with a private repository so you cannot edit it. This README.md
is generated from our doc on algolia.com/doc.
Hi @qcaron and thank you for reporting this,
As stated by @julienbourdeau, the doc is indeed wrong:
You should import the register
decorator from the algoliasearch_django.decorators
module and not from the main algoliasearch_django
module.
So your code of the index.py
should looks like this:
from algoliasearch_django import AlgoliaIndex
from algoliasearch_django.decorators import register
from .models import TestSearch
@register(TestSearch)
class TestSearchIndex(AlgoliaIndex):
fields = (
'text',
)
Really sorry for this, we will update the documentation right away :)
Thanks for your answers and for reacting promptly 🤘
Closed via f753b04
Hi guys,
I defined this index by following the instructions found in the documentation:
index.py
Here are my models.py and settings.py for this test case:
models.py
settings.py
I am getting this stacktrace when running
./manage.py algolia_applysettings
:I am using:
Is this a bug? If not, I can update the documentation based on your answers.
Using
algoliasearch.register(YourModel)
works except thesettings.ALGOLIA.INDEX_SUFFIX
is not taken into account and I need to customize my index as well.Let me know if you need more about my issue. Quentin