django-haystack / django-haystack/django-haystack
Problem unpickling object will do a hit on elastic search
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 3.7k
- Forks
- 1.3k
- Avg merge
- 3h 18m
- Merged PRs (30d)
- 3
Description
Hi
I am facing an issue, I am trying to cache the queryset in the cache. I can pickle it fine saved to cache with no issues. Now I try to shut down my elastic search and get the objects from the cache I get the following error
pickle.loads(pickled_object)
Failed to query Elasticsearch using '*:*': HTTPConnectionPool(host='127.0.0.1', port=9200): Max retries exceeded with url: /my_model/modelresult/_search (Caused by <class 'socket.error'>: [Errno 61] Connection refused)
My question is why is it trying to do a select all on unpicking ? Also if this isn't the right way how can I cache the query set. I was thinking cache this as json but then how do I feed that to Haystack search query instead of hitting elastic search
Thanks
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the pickle.loads(pickled_object) path and the cached Django queryset/Haystack search query described in the report; reproduce it with Elasticsearch stopped. Trace why unpickling requests ':' and define whether the fix is to avoid that query or document an alternate cache representation; done when the chosen behavior is verified without Elasticsearch.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- django, elasticsearch, python
- Domain
- backend, search
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100