Re: [Wagtail] AttributeError: 'str' object has no attribute 'copy'

896 views
Skip to first unread message
Message has been deleted

Karl Hobley

unread,
Jan 16, 2016, 7:50:34 AM1/16/16
to wag...@googlegroups.com
Looks like your WAGTAILSEARCH_BACKENDS setting is invalid.

Here's an example for Elasticsearch:

WAGTAILSEARCH_BACKENDS = {
    'default': {
        'BACKEND': 'wagtail.wagtailsearch.backends.elasticsearch',
        'URLS': ['http://localhost:9200'],
        'INDEX': 'index-name-here'
    }
}


PS: Elasticsearch 2.x is currently not supported by Wagtail. You should use 1.7+ for now instead.

On 16 January 2016 at 11:31, Manuel Guimarães <mavgui...@gmail.com> wrote:
When I make a search in wagtail using elasticsearch as backend search I 've got the error reported below. I'm using wagtail 1.3.1 with elasticsearch 2.2.0 and django 1.9.1
Any help I would appreciate


[16/Jan/2016 11:17:57] "GET /static/wagtailadmin/fonts/robotoslab-bold.woff2 HTTP/1.1" 304 0
Internal Server Error: /admin/pages/search/
Traceback (most recent call last):
  File "/home/maguimar/django/lib/python3.4/site-packages/django/core/handlers/base.py", line 149, in get_response
    response = self.process_exception_by_middleware(e, request)
  File "/home/maguimar/django/lib/python3.4/site-packages/django/core/handlers/base.py", line 147, in get_response
    response = wrapped_callback(request, *callback_args, **callback_kwargs)
  File "/home/maguimar/django/lib/python3.4/site-packages/django/views/decorators/cache.py", line 43, in _cache_controlled
    response = viewfunc(request, *args, **kw)
  File "/home/maguimar/django/lib/python3.4/site-packages/django/contrib/auth/decorators.py", line 23, in _wrapped_view
    return view_func(request, *args, **kwargs)
  File "/home/maguimar/django/lib/python3.4/site-packages/django/views/decorators/vary.py", line 21, in inner_func
    response = func(*args, **kwargs)
  File "/home/maguimar/django/lib/python3.4/site-packages/wagtail/wagtailadmin/views/pages.py", line 707, in search
    pages = Page.objects.all().prefetch_related('content_type').search(q, fields=['title'])
  File "/home/maguimar/django/lib/python3.4/site-packages/wagtail/wagtailsearch/queryset.py", line 10, in search
    search_backend = get_search_backend(backend)
  File "/home/maguimar/django/lib/python3.4/site-packages/wagtail/wagtailsearch/backends/__init__.py", line 65, in get_search_backend
    params = conf.copy()
AttributeError: 'str' object has no attribute 'copy'
[16/Jan/2016 11:18:09] "GET /admin/pages/search/?q=first HTTP/1.1" 500 101481

--
You received this message because you are subscribed to the Google Groups "Wagtail support" group.
To unsubscribe from this group and stop receiving emails from it, send an email to wagtail+u...@googlegroups.com.
To post to this group, send email to wag...@googlegroups.com.
Visit this group at https://groups.google.com/group/wagtail.
To view this discussion on the web, visit https://groups.google.com/d/msgid/wagtail/f74a7200-6aa3-482c-9a5a-9b3f686eee48%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Message has been deleted

Brett Grace

unread,
Jan 16, 2016, 2:39:51 PM1/16/16
to Wagtail support
Yes, the 2.x Elasticsearch server has breaking API changes. You need to use a 1.x Elasticsearch server and library.

On Saturday, January 16, 2016 at 10:02:16 AM UTC-8, Manuel Guimarães wrote:
My  WAGTAILSEARCH_BACKENDS is exactly as you suggest. But I'm using elasticsearch 2.2.0. It will be the elastic 2.2.0 the cause of the error that I reported?
Reply all
Reply to author
Forward
0 new messages