toastdriven/django-haystack — Issue #514: `from_python` and `to_python` methods missing in ES + Solr Backends
Author: dlo
Created: 2012-02-18 00:31:40+00:00
State: open

They are being referenced all over the place even though they don't exist in the backends themselves.

I ran into this right after running `./manage.py rebuild_index` using ElasticSearch.

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.
All documents removed.
Indexing 3 occurrences.
Traceback (most recent call last):
File "./manage.py", line 15, in
execute_manager(settings)
File "/Users/dan/Web/activehi/lib/python2.7/site-packages/django/core/management/__init__.py", line 438, in execute_manager
utility.execute()
File "/Users/dan/Web/activehi/lib/python2.7/site-packages/django/core/management/__init__.py", line 379, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "/Users/dan/Web/activehi/lib/python2.7/site-packages/django/core/management/base.py", line 191, in run_from_argv
self.execute(*args, **options.__dict__)
File "/Users/dan/Web/activehi/lib/python2.7/site-packages/django/core/management/base.py", line 220, in execute
output = self.handle(*args, **options)
File "/Users/dan/Web/activehi/lib/python2.7/site-packages/haystack/management/commands/rebuild_index.py", line 15, in handle
call_command('update_index', **options)
File "/Users/dan/Web/activehi/lib/python2.7/site-packages/django/core/management/__init__.py", line 166, in call_command
return klass.execute(*args, **defaults)
File "/Users/dan/Web/activehi/lib/python2.7/site-packages/django/core/management/base.py", line 220, in execute
output = self.handle(*args, **options)
File "/Users/dan/Web/activehi/lib/python2.7/site-packages/haystack/management/commands/update_index.py", line 202, in handle
return super(Command, self).handle(*items, **options)
File "/Users/dan/Web/activehi/lib/python2.7/site-packages/django/core/management/base.py", line 322, in handle
label_output = self.handle_label(label, **options)
File "/Users/dan/Web/activehi/lib/python2.7/site-packages/haystack/management/commands/update_index.py", line 257, in handle_label
do_update(self.backend, index, qs, start, end, total, self.verbosity)
File "/Users/dan/Web/activehi/lib/python2.7/site-packages/haystack/management/commands/update_index.py", line 100, in do_update
backend.update(index, current_qs)
File "/Users/dan/Web/activehi/lib/python2.7/site-packages/haystack/backends/elasticsearch_backend.py", line 158, in update
final_data[key] = self.conn.from_python(value)
AttributeError: 'ElasticSearch' object has no attribute 'from_python'