[Erp5-report] r33656 gregory - /erp5/trunk/products/ZSQLCatalog/SearchKey/FullTextKey.py

nobody at svn.erp5.org nobody at svn.erp5.org
Thu Mar 11 16:11:49 CET 2010


Author: gregory
Date: Thu Mar 11 16:11:48 2010
New Revision: 33656

URL: http://svn.erp5.org?rev=33656&view=rev
Log:
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.

Modified:
    erp5/trunk/products/ZSQLCatalog/SearchKey/FullTextKey.py

Modified: erp5/trunk/products/ZSQLCatalog/SearchKey/FullTextKey.py
URL: http://svn.erp5.org/erp5/trunk/products/ZSQLCatalog/SearchKey/FullTextKey.py?rev=33656&r1=33655&r2=33656&view=diff
==============================================================================
--- erp5/trunk/products/ZSQLCatalog/SearchKey/FullTextKey.py [utf8] (original)
+++ erp5/trunk/products/ZSQLCatalog/SearchKey/FullTextKey.py [utf8] Thu Mar 11 16:11:48 2010
@@ -68,7 +68,11 @@
       else:
         append(value)
     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
 
   @profiler_decorator




More information about the Erp5-report mailing list