Django Haystack and Woosh not working on web requests but working on django shell on production server

StackOverflow https://stackoverflow.com/questions/12718021

  •  05-07-2021
  •  | 
  •  

Domanda

On my production server, I'm not getting any search results with haystack when I search through the webpage, but it builds indexes correctly and I can retrieve results using the haystack api on the django shell.

No exceptions are being thrown, I just get no results at all.

On my local server everything works fine.

The only discernible difference is that the production server is using fcgi where as the local server is using wsgi.

I can't for the life of me figure out what's going on. Any ideas?

È stato utile?

Soluzione

I resolved the issue by owning the search index directory to apache and moving:

import haystack
haystack.autodiscover()

from search_sites.py to urls.py

I still don't fully understand why the search is now working but I'm glad it is!

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top