First time here? Check out the FAQ!
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

To enter a block of code:

  • enter empty line after your previous text
  • paste or type the code
  • select the code and press the button above
Preview: (hide)
eugenenarciso's avatar
43
eugenenarciso
asked 11 years ago

Comments

see more comments

2 Answers

1

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

To enter a block of code:

  • enter empty line after your previous text
  • paste or type the code
  • select the code and press the button above
Preview: (hide)
Evgeny's avatar
13.2k
Evgeny
answered 11 years ago
link

Comments

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

eugenenarciso's avatar eugenenarciso (11 years ago)

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

Evgeny's avatar Evgeny (11 years ago)

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

pcompassion's avatar pcompassion (11 years ago)
1

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

Evgeny's avatar Evgeny (11 years ago)

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 (11 years ago)
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)

To enter a block of code:

  • enter empty line after your previous text
  • paste or type the code
  • select the code and press the button above
Preview: (hide)
eugenenarciso's avatar
43
eugenenarciso
answered 11 years ago, updated 11 years ago
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 (11 years ago)

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 (11 years ago)

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

eugenenarciso's avatar eugenenarciso (11 years ago)

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 (11 years ago)

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 (11 years ago)
see more comments