python-3.xdjangodjango-haystack

django-machina search returns no result


I have followed all the steps given in this Tutorial but the search feature for my project is not working. Whereas the example project given by django-machina is working fine with search. So can someone tell me what is the missing thing. I have also rebuild and updated the index. But still my search is not giving any results. It is always 0 results with no error.

When i run the rebuild index command i get the following error

python3 manage.py rebuild_index

/usr/local/lib/python3.8/site-packages/jose/backends/cryptography_backend.py:18: CryptographyDeprecationWarning: int_from_bytes is deprecated, use int.from_bytes instead
  from cryptography.utils import int_from_bytes, int_to_bytes
WARNING: This will irreparably remove EVERYTHING from your search index in connection 'default'.
Your choices after this are to restore from backups or rebuild via the `rebuild_index` command.
Are you sure you wish to continue? [y/N] y
Removing all documents from your index because you said so.
/usr/local/lib/python3.8/site-packages/haystack/backends/simple_backend.py:31 UserWarning: clear is not implemented in this backend
All documents removed.
Indexing 13 Posts
/usr/local/lib/python3.8/site-packages/haystack/backends/simple_backend.py:25 UserWarning: update is not implemented in this backend

Solution

  • You can find the solution here. After adding settings please do python3 manage.py update_index or you can do it by code

    from django.core import management
    management.call_command('update_index')