[Erp5-report] r38372 kazuhiko - /erp5/trunk/products/ZSQLCatalog/SearchKey/

nobody at svn.erp5.org nobody at svn.erp5.org
Tue Sep 14 16:46:29 CEST 2010


Author: kazuhiko
Date: Tue Sep 14 16:46:26 2010
New Revision: 38372

URL: http://svn.erp5.org?rev=38372&view=rev
Log:
modify _buildQuery() according to the change in r38682.

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

Modified: erp5/trunk/products/ZSQLCatalog/SearchKey/SphinxSEFullTextKey.py
URL: http://svn.erp5.org/erp5/trunk/products/ZSQLCatalog/SearchKey/SphinxSEFullTextKey.py?rev=38372&r1=38371&r2=38372&view=diff
==============================================================================
--- erp5/trunk/products/ZSQLCatalog/SearchKey/SphinxSEFullTextKey.py [utf8] (original)
+++ erp5/trunk/products/ZSQLCatalog/SearchKey/SphinxSEFullTextKey.py [utf8] Tue Sep 14 16:46:26 2010
@@ -52,10 +52,12 @@ class SphinxSEFullTextKey(SearchKey):
       same operator into just one query, to save SQL server from the burden to
       do multiple fulltext lookups when one would suit the purpose.
 
+      Here We wrap each phrase or word with double quotes, as the
+      workaround of 1-gram search specification in current Sphinx.
+
       Example:
       'aaa bbb' : '"aaa" "bbb"'
-      '"aaa bbb"' : '"aaa" "bbb"' XXX no way to differentiate with the
-                                        above for now
+      '"aaa bbb"' : '"aaa bbb"'
       '"aaa bbb" ccc' : '"aaa bbb" "ccc"'
     """
     column = self.getColumn()
@@ -66,7 +68,7 @@ class SphinxSEFullTextKey(SearchKey):
         value_list = value_list[0].split()
       append(SimpleQuery(search_key=self,
                          comparison_operator=comparison_operator,
-                         group=group, **{column:'"%s"' % '" "'.join(value_list)}))
+                         group=group, **{column:' '.join(['"%s"' % x.replace('"', '') for x in value_list])}))
     return query_list
 
 verifyClass(ISearchKey, SphinxSEFullTextKey)




More information about the Erp5-report mailing list