no results for empty query

This commit is contained in:
j 2020-01-21 14:09:38 +01:00
parent 53ed483f9c
commit a2ff9480cf
1 changed files with 3 additions and 1 deletions

View File

@ -63,7 +63,9 @@ class FulltextMixin:
@classmethod
def find_fulltext_ids(cls, query):
if query and query[0] == '"' and query[-1] == '"':
if not query:
return []
elif query[0] == '"' and query[-1] == '"':
query = {
"match_phrase": {
"text": query.lower()[1:-1]