From b300cb1d6451bfea722dd9f87ec4b17c868826c0 Mon Sep 17 00:00:00 2001 From: Ivan Tyagov <ivan@nexedi.com> Date: Tue, 8 Feb 2011 11:19:36 +0000 Subject: [PATCH] Avoid search without specifying search words. git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@43165 20353a03-c40f-0410-a6d1-a30d3c3de9de --- .../erp5_mysql_innodb/SQLCatalog_makeFullTextQuery.xml | 3 ++- bt5/erp5_full_text_sphinxse_catalog/bt/revision | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/bt5/erp5_full_text_sphinxse_catalog/CatalogMethodTemplateItem/portal_catalog/erp5_mysql_innodb/SQLCatalog_makeFullTextQuery.xml b/bt5/erp5_full_text_sphinxse_catalog/CatalogMethodTemplateItem/portal_catalog/erp5_mysql_innodb/SQLCatalog_makeFullTextQuery.xml index 675502eeb3..6e0ebe21e2 100644 --- a/bt5/erp5_full_text_sphinxse_catalog/CatalogMethodTemplateItem/portal_catalog/erp5_mysql_innodb/SQLCatalog_makeFullTextQuery.xml +++ b/bt5/erp5_full_text_sphinxse_catalog/CatalogMethodTemplateItem/portal_catalog/erp5_mysql_innodb/SQLCatalog_makeFullTextQuery.xml @@ -61,8 +61,9 @@ defaut_dict = {\'mode\': \'ext2\', # full text search mode\n }\n for key, item in defaut_dict.items():\n operator = \';%s\' %key\n - if operator not in value:\n + if operator not in value and value not in (\'\', None):\n value = \'%s%s=%s\' %(value, operator, item)\n +\n query = Query(**{\'sphinxse_query\': value})\n return query\n </string> </value> diff --git a/bt5/erp5_full_text_sphinxse_catalog/bt/revision b/bt5/erp5_full_text_sphinxse_catalog/bt/revision index b5045cc404..8fdd954df9 100644 --- a/bt5/erp5_full_text_sphinxse_catalog/bt/revision +++ b/bt5/erp5_full_text_sphinxse_catalog/bt/revision @@ -1 +1 @@ -21 \ No newline at end of file +22 \ No newline at end of file -- 2.30.9