[GH-ISSUE #478] Elasticsearch not working: You must specify a 'INDEX_NAME' in your settings for connection 'default' #368

Closed
opened 2026-02-25 21:31:47 +03:00 by kerem · 3 comments
Owner

Originally created by @w4tzmann on GitHub (Sep 14, 2022).
Original GitHub issue: https://github.com/ciur/papermerge/issues/478

Originally assigned to: @ciur on GitHub.

Description
Using docker-compose with ghcr.io/papermerge/papermerge:latest and elasticsearch as search eninge are not working for me.
After entering a word in the search bar an pressing Enter, nothing happens.
papermerge backend container log entry:

ERROR 2022-09-14 13:56:32,648 log Internal Server Error: /api/search/
Traceback (most recent call last):
File "/venv/lib/python3.9/site-packages/django/core/handlers/exception.py", line 55, in inner
response = get_response(request)
File "/venv/lib/python3.9/site-packages/django/core/handlers/base.py", line 197, in _get_response
response = wrapped_callback(request, *callback_args, **callback_kwargs)
File "/venv/lib/python3.9/site-packages/django/views/decorators/csrf.py", line 54, in wrapped_view
return view_func(*args, **kwargs)
File "/venv/lib/python3.9/site-packages/django/views/generic/base.py", line 84, in view
return self.dispatch(request, *args, **kwargs)
File "/venv/lib/python3.9/site-packages/rest_framework/views.py", line 509, in dispatch
response = self.handle_exception(exc)
File "/venv/lib/python3.9/site-packages/rest_framework/views.py", line 469, in handle_exception
self.raise_uncaught_exception(exc)
File "/venv/lib/python3.9/site-packages/rest_framework/views.py", line 480, in raise_uncaught_exception
raise exc
File "/venv/lib/python3.9/site-packages/rest_framework/views.py", line 506, in dispatch
response = handler(request, *args, **kwargs)
File "/app/papermerge/search/views.py", line 77, in get
query_all = SearchQuerySet().filter(user=request.user)
File "/venv/lib/python3.9/site-packages/haystack/query.py", line 25, in init
self._determine_backend()
File "/venv/lib/python3.9/site-packages/haystack/query.py", line 58, in _determine_backend
self.query = connections[backend_alias].get_query()
File "/venv/lib/python3.9/site-packages/haystack/backends/init.py", line 1100, in get_query
return self.query(using=self.using)
File "/venv/lib/python3.9/site-packages/haystack/backends/init.py", line 510, in init
self.backend = connections[self._using].get_backend()
File "/venv/lib/python3.9/site-packages/haystack/backends/init.py", line 1092, in get_backend
self._backend = self.backend(self.using, **self.options)
File "/venv/lib/python3.9/site-packages/haystack/backends/elasticsearch7_backend.py", line 94, in init
super().init(connection_alias, **connection_options)
File "/venv/lib/python3.9/site-packages/haystack/backends/elasticsearch_backend.py", line 133, in init
raise ImproperlyConfigured(
django.core.exceptions.ImproperlyConfigured: You must specify a 'INDEX_NAME' in your settings for connection 'default'.
[pid: 37|app: 0|req: 95/146] 172.18.0.7 () {58 vars in 1851 bytes} [Wed Sep 14 13:56:32 2022] GET /api/search/?q=Test => generated 145 bytes in 90 msecs (HTTP/1.1 500) 7 headers in 225 bytes (1 switches on core 0)

Switching to xapian and the search works like a charm.

Expected
Search for the given words

Actual
No Search

Info:

  • OS: Win 10 (Client) / Ubuntu 20.04 Server
  • Browser: Edge
  • Database: Postgres 14.4
  • Papermerge Version: latest
Originally created by @w4tzmann on GitHub (Sep 14, 2022). Original GitHub issue: https://github.com/ciur/papermerge/issues/478 Originally assigned to: @ciur on GitHub. **Description** Using docker-compose with ghcr.io/papermerge/papermerge:latest and elasticsearch as search eninge are not working for me. After entering a word in the search bar an pressing Enter, nothing happens. papermerge backend container log entry: > ERROR 2022-09-14 13:56:32,648 log Internal Server Error: /api/search/ > Traceback (most recent call last): > File "/venv/lib/python3.9/site-packages/django/core/handlers/exception.py", line 55, in inner > response = get_response(request) > File "/venv/lib/python3.9/site-packages/django/core/handlers/base.py", line 197, in _get_response > response = wrapped_callback(request, *callback_args, **callback_kwargs) > File "/venv/lib/python3.9/site-packages/django/views/decorators/csrf.py", line 54, in wrapped_view > return view_func(*args, **kwargs) > File "/venv/lib/python3.9/site-packages/django/views/generic/base.py", line 84, in view > return self.dispatch(request, *args, **kwargs) > File "/venv/lib/python3.9/site-packages/rest_framework/views.py", line 509, in dispatch > response = self.handle_exception(exc) > File "/venv/lib/python3.9/site-packages/rest_framework/views.py", line 469, in handle_exception > self.raise_uncaught_exception(exc) > File "/venv/lib/python3.9/site-packages/rest_framework/views.py", line 480, in raise_uncaught_exception > raise exc > File "/venv/lib/python3.9/site-packages/rest_framework/views.py", line 506, in dispatch > response = handler(request, *args, **kwargs) > File "/app/papermerge/search/views.py", line 77, in get > query_all = SearchQuerySet().filter(user=request.user) > File "/venv/lib/python3.9/site-packages/haystack/query.py", line 25, in __init__ > self._determine_backend() > File "/venv/lib/python3.9/site-packages/haystack/query.py", line 58, in _determine_backend > self.query = connections[backend_alias].get_query() > File "/venv/lib/python3.9/site-packages/haystack/backends/__init__.py", line 1100, in get_query > return self.query(using=self.using) > File "/venv/lib/python3.9/site-packages/haystack/backends/__init__.py", line 510, in __init__ > self.backend = connections[self._using].get_backend() > File "/venv/lib/python3.9/site-packages/haystack/backends/__init__.py", line 1092, in get_backend > self._backend = self.backend(self.using, **self.options) > File "/venv/lib/python3.9/site-packages/haystack/backends/elasticsearch7_backend.py", line 94, in __init__ > super().__init__(connection_alias, **connection_options) > File "/venv/lib/python3.9/site-packages/haystack/backends/elasticsearch_backend.py", line 133, in __init__ > raise ImproperlyConfigured( > django.core.exceptions.ImproperlyConfigured: You must specify a 'INDEX_NAME' in your settings for connection 'default'. > [pid: 37|app: 0|req: 95/146] 172.18.0.7 () {58 vars in 1851 bytes} [Wed Sep 14 13:56:32 2022] GET /api/search/?q=Test => generated 145 bytes in 90 msecs (HTTP/1.1 500) 7 headers in 225 bytes (1 switches on core 0) Switching to xapian and the search works like a charm. **Expected** Search for the given words **Actual** No Search **Info:** - OS: Win 10 (Client) / Ubuntu 20.04 Server - Browser: Edge - Database: Postgres 14.4 - Papermerge Version: latest
kerem 2026-02-25 21:31:47 +03:00
  • closed this issue
  • added the
    bug
    label
Author
Owner

@ciur commented on GitHub (Sep 14, 2022):

Thanks for opening bug report on this!

<!-- gh-comment-id:1247041951 --> @ciur commented on GitHub (Sep 14, 2022): Thanks for opening bug report on this!
Author
Owner

@w4tzmann commented on GitHub (Sep 15, 2022):

I could fix this for me, with the following changes: https://github.com/papermerge/papermerge-core/pull/68
pm_search

<!-- gh-comment-id:1248006996 --> @w4tzmann commented on GitHub (Sep 15, 2022): I could fix this for me, with the following changes: https://github.com/papermerge/papermerge-core/pull/68 <img width="583" alt="pm_search" src="https://user-images.githubusercontent.com/69207307/190398289-31af4ba7-2d6e-4fcc-8a12-6f351f27359a.png">
Author
Owner

@ciur commented on GitHub (Sep 15, 2022):

PR was accepted and merged, thanks for your contribution!

<!-- gh-comment-id:1248406928 --> @ciur commented on GitHub (Sep 15, 2022): PR was accepted and merged, thanks for your contribution!
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/papermerge#368
No description provided.