Commit 94062a5e by Tim Babych

prefer DB

parent d8a735e1
...@@ -23,7 +23,11 @@ class AnnotationSearchView(APIView): ...@@ -23,7 +23,11 @@ class AnnotationSearchView(APIView):
Search annotations. Search annotations.
""" """
def get(self, *args, **kwargs): # pylint: disable=unused-argument def get(self, *args, **kwargs): # pylint: disable=unused-argument
if settings.ES_DISABLED: """
Search annotations in most appropriate storage
"""
# search in DB when ES is not available or there is no need to bother it
if settings.ES_DISABLED or 'text' not in self.request.QUERY_PARAMS.dict():
results = self.get_from_db(*args, **kwargs) results = self.get_from_db(*args, **kwargs)
else: else:
results = self.get_from_es(*args, **kwargs) results = self.get_from_es(*args, **kwargs)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment