mirror of
https://github.com/paperless-ngx/paperless-ngx.git
synced 2025-12-11 09:07:18 +01:00
fixed an issue with the search api opening the index on import (that's way too early.)
This commit is contained in:
parent
42c9186e91
commit
938499706c
1 changed files with 6 additions and 2 deletions
|
|
@ -202,7 +202,9 @@ class SearchView(APIView):
|
||||||
|
|
||||||
permission_classes = (IsAuthenticated,)
|
permission_classes = (IsAuthenticated,)
|
||||||
|
|
||||||
ix = index.open_index()
|
def __init__(self, *args, **kwargs):
|
||||||
|
super(SearchView, self).__init__(*args, **kwargs)
|
||||||
|
self.ix = index.open_index()
|
||||||
|
|
||||||
def add_infos_to_hit(self, r):
|
def add_infos_to_hit(self, r):
|
||||||
doc = Document.objects.get(id=r['id'])
|
doc = Document.objects.get(id=r['id'])
|
||||||
|
|
@ -241,7 +243,9 @@ class SearchAutoCompleteView(APIView):
|
||||||
|
|
||||||
permission_classes = (IsAuthenticated,)
|
permission_classes = (IsAuthenticated,)
|
||||||
|
|
||||||
ix = index.open_index()
|
def __init__(self, *args, **kwargs):
|
||||||
|
super(SearchAutoCompleteView, self).__init__(*args, **kwargs)
|
||||||
|
self.ix = index.open_index()
|
||||||
|
|
||||||
def get(self, request, format=None):
|
def get(self, request, format=None):
|
||||||
if 'term' in request.query_params:
|
if 'term' in request.query_params:
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue