From a8172b647980667bef078c865034b52f6523be4b Mon Sep 17 00:00:00 2001 From: Étienne Loks Date: Thu, 8 Nov 2018 12:05:28 +0100 Subject: Fix mixed search --- ishtar_common/views_item.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ishtar_common/views_item.py b/ishtar_common/views_item.py index c14973bc3..aa017c7ad 100644 --- a/ishtar_common/views_item.py +++ b/ishtar_common/views_item.py @@ -383,6 +383,9 @@ def _parse_parentheses_groups(groups, request_keys, current_dct=None, exc_dct = {} if type(groups) is not list: string = groups.strip() + if string.startswith(u'"') and string.endswith(u'"') and \ + string.count(u'"') == 2: + string = string[1:-1] # split into many groups if spaces # do not split inside quotes @@ -454,9 +457,6 @@ def _search_manage_search_vector(model, dct, exc_dct, request_keys): # remove inside parenthesis search_query = \ search_query.replace(u'(', u'').replace(u')', u'').strip() - # manage full quoted - if search_query.startswith(u'"') and search_query.endswith(u'"'): - search_query = search_query[1:-1].replace(u" ", u" & ").strip() if search_query: dct['extras'].append( {'where': [model._meta.db_table + -- cgit v1.2.3