Commit 0ed3aef8 authored by Grégory Wisniewski's avatar Grégory Wisniewski

Fix full-text searches with mixed modes.

When full-text expression uses both boolean and natural mode, the expressions
should be merged, otherwise there would be 2 different definitions for the same
(fulltext) column alias in the SELECT or ORDER BY expressions. If any of the
full-text expressions contain boolean operators, the whole expression will be
executed in boolean mode.

Reviewed by Vincent.


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@33656 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent a581d41c
...@@ -68,7 +68,11 @@ class FullTextKey(SearchKey): ...@@ -68,7 +68,11 @@ class FullTextKey(SearchKey):
else: else:
append(value) append(value)
if len(new_value_list): if len(new_value_list):
operator_value_dict['match'] = new_value_list if 'match_boolean' in operator_value_dict:
# use boolean mode for all expressions
operator_value_dict['match_boolean'].extend(new_value_list)
else:
operator_value_dict['match'] = new_value_list
return operator_value_dict, logical_operator, parsed return operator_value_dict, logical_operator, parsed
@profiler_decorator @profiler_decorator
......
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