1

haystack python manage.py rebuild_index error

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

eugenenarciso's avatar
43
eugenenarciso
asked 2013-05-21 17:27:18 -0500
edit flag offensive 0 remove flag close merge delete

Comments

add a comment see more comments

2 Answers

1

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

Evgeny's avatar
13.2k
Evgeny
answered 2013-05-21 17:28:32 -0500
edit flag offensive 0 remove flag delete link

Comments

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

eugenenarciso's avatar eugenenarciso (2013-05-30 11:45:49 -0500) edit

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

Evgeny's avatar Evgeny (2013-05-30 12:50:58 -0500) edit

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

pcompassion's avatar pcompassion (2013-06-03 00:43:46 -0500) edit
1

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

Evgeny's avatar Evgeny (2013-06-03 05:21:30 -0500) 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's avatar eugenenarciso (2013-06-04 16:06:38 -0500) edit
add a comment see more comments
1
 
#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)
eugenenarciso's avatar
43
eugenenarciso
answered 2013-05-21 17:29:44 -0500, updated 2013-06-04 16:28:37 -0500
edit flag offensive 0 remove flag delete link

Comments

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

Fitoria's avatar Fitoria (2013-06-04 16:19:34 -0500) 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's avatar eugenenarciso (2013-06-04 16:22:03 -0500) edit

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

eugenenarciso's avatar eugenenarciso (2013-06-04 16:26:25 -0500) 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's avatar Fitoria (2013-06-04 16:29:31 -0500) edit

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

eugenenarciso's avatar eugenenarciso (2013-06-04 16:33:46 -0500) edit
add a comment see more comments