Ask Your Question
1

haystack python manage.py rebuild_index error

asked 2013-05-21 17:27:18 -0600

eugenenarciso gravatar image

Hello,

I've been struggling to enable haystack w/ solr backend on a test instance but I'm hitting the error below. So it seems I should be building my own user_text.txt template and head the django template language. If anyone had ran into this problem or have a template they'd like share I'd appreciate it!

Thank you

edit retag flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted
1

answered 2013-05-21 17:29:44 -0600

eugenenarciso gravatar image

updated 2013-06-04 16:28:37 -0600

 
#HAYSTACK_SETTINGS 
ENABLE_HAYSTACK_SEARCH = True
#Uncomment for multilingual setup: 
#HAYSTACK_ROUTERS = ['askbot.search.haystack.routers.LanguageRouter',]

#Uncomment if you use haystack #More info in http://django-haystack.readthedocs.org/en/latest/settings.html 
HAYSTACK_CONNECTIONS = { 
      'default': { 
         'ENGINE': 'haystack.backends.simple_backend.SimpleEngine', 
         'URL': 'http: //10.0.1.201:8080/solr' 
     } 
} 
 
$ pip freeze |grep haystack django-haystack==2.0.0 
$ python manage.py build_solr_schema > /tmp/schema.xml
WARNING!!! You are using a 'locmem' (local memory) caching backend,
which is OK for a low volume site running on a single-process server.
For a multi-process configuration it is neccessary to have a production
cache system, such as redis or memcached.

With local memory caching and multi-process setup you might intermittently
see outdated content on your site.

/usr/local/lib/python2.7/dist-packages/Coffin-0.3.7-py2.7.egg/coffin/common.py:73: UserWarning: Cannot translate loader: askbot.skins.loaders.Loader
  warnings.warn('Cannot translate loader: %s' % loader)
Traceback (most recent call last):
  File "manage.py", line 11, in <module>
    execute_manager(settings)
  File "/usr/local/lib/python2.7/dist-packages/Django-1.4.5-py2.7.egg/django/core/management/__init__.py", line 459, in execute_manager
    utility.execute()
  File "/usr/local/lib/python2.7/dist-packages/Django-1.4.5-py2.7.egg/django/core/management/__init__.py", line 382, in execute
    self.fetch_command(subcommand).run_from_argv(self.argv)
  File "/usr/local/lib/python2.7/dist-packages/Django-1.4.5-py2.7.egg/django/core/management/base.py", line 196, in run_from_argv
    self.execute(*args, **options.__dict__)
  File "/usr/local/lib/python2.7/dist-packages/Django-1.4.5-py2.7.egg/django/core/management/base.py", line 232, in execute
    output = self.handle(*args, **options)
  File "/usr/local/lib/python2.7/dist-packages/haystack/management/commands/build_solr_schema.py", line 24, in handle
    schema_xml = self.build_template(using=using)
  File "/usr/local/lib/python2.7/dist-packages/haystack/management/commands/build_solr_schema.py", line 50, in build_template
    c = self.build_context(using=using)
  File "/usr/local/lib/python2.7/dist-packages/haystack/management/commands/build_solr_schema.py", line 36, in build_context
    raise ImproperlyConfigured("'%s' isn't configured as a SolrEngine)." % backend.connection_alias)
django.core.exceptions.ImproperlyConfigured: 'default' isn't configured as a SolrEngine).

Sorry forgot the stdout:

root@askbot-testvm:/srv/askbot# ./manage.py rebuild_index

WARNING: This will irreparably remove EVERYTHING from your search index.
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 16 people.
/usr/local/lib/python2.7/dist-packages/Coffin-0.3.7-py2.7.egg/coffin/common.py:73: UserWarning: Cannot translate loader: askbot.skins.loaders.Loader
  warnings.warn('Cannot translate loader: %s' % loader)
Traceback (most recent call last):
  File "./manage.py", line 11, in <module>
    execute_manager(settings)
  File "/usr/local/lib/python2.7/dist-packages/Django-1.4.5-py2.7.egg/django/core/management/__init__.py", line 459, in execute_manager
    utility.execute()
  File "/usr/local/lib/python2.7/dist-packages/Django-1.4.5-py2.7.egg/django/core/management/__init__.py", line 382, in execute
    self.fetch_command(subcommand).run_from_argv(self.argv)
  File "/usr ...
(more)
edit flag offensive delete link more

Comments

it now requires haystack==2.0 and the settings changed to a dictionary based configuration, please check that first

Fitoria gravatar imageFitoria ( 2013-06-04 16:19:34 -0600 )edit

Hey Fitoria, thanks for the reply. I am doing exactly that: <pre> #HAYSTACK_SETTINGS ENABLE_HAYSTACK_SEARCH = True

#Uncomment for multilingual setup: #HAYSTACK_ROUTERS = ['askbot.search.haystack.routers.LanguageRouter',]

#Uncomment if you use haystack #More info in http://django-haystack.readthedocs.org/en/latest/settings.html HAYSTACK_CONNECTIONS = { 'default': { 'ENGINE': 'haystack.backends.simple_backend.SimpleEngine', 'URL': 'http: //10.0.1.201:8080/solr' } } </pre>

<pre> $ pip freeze |grep haystack django-haystack==2.0.0 </pre>

eugenenarciso gravatar imageeugenenarciso ( 2013-06-04 16:22:03 -0600 )edit

oh yeah, html format doesn't work on comments.

eugenenarciso gravatar imageeugenenarciso ( 2013-06-04 16:26:25 -0600 )edit

python manage.py build_solr_schema > /tmp/schema.xml will just work with solr setup so instead of using the SimpleEngine change the configuration values to use SolrEngine check -> http://django-haystack.readthedocs.org/en/latest/settings.html#haystack-connections

Fitoria gravatar imageFitoria ( 2013-06-04 16:29:31 -0600 )edit

great! that worked! should've seen that, I was just c&p the configs from doc/source/solr.rst for testing

eugenenarciso gravatar imageeugenenarciso ( 2013-06-04 16:33:46 -0600 )edit
1

answered 2013-05-21 17:28:32 -0600

Evgeny gravatar image

We will have updates regarding this in the near future, please hang on.

edit flag offensive delete link more

Comments

Thanks Evgeny, please keep this post updated once the branch is available.

eugenenarciso gravatar imageeugenenarciso ( 2013-05-30 11:45:49 -0600 )edit

Eugene, I will hopefully very soon. We've almost completed this work.

Evgeny gravatar imageEvgeny ( 2013-05-30 12:50:58 -0600 )edit

Hi, what's the status of this? I don't see any haystack/solr related branch name in github.

pcompassion gravatar imagepcompassion ( 2013-06-03 00:43:46 -0600 )edit
1

There is a branch called "solr" we will merge it into the master by mid-june.

Evgeny gravatar imageEvgeny ( 2013-06-03 05:21:30 -0600 )edit

Hey Evgeny, thank you for the branch! I am stuck at building the solr schema. Can you let me know what im missing? I've posted the stack as an answer below. Thanks

eugenenarciso gravatar imageeugenenarciso ( 2013-06-04 16:06:38 -0600 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

Stats

Asked: 2013-05-21 17:27:18 -0600

Seen: 2,188 times

Last updated: Jun 04 '13