Commit f3cd0fce authored by Bartek Górny's avatar Bartek Górny

Fixed search_mode selection; added the right implementation of any-category search.

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@12563 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 0a7378e3
...@@ -106,15 +106,13 @@ cats = []\n ...@@ -106,15 +106,13 @@ cats = []\n
bases = context.portal_categories.getBaseCategoryList()\n bases = context.portal_categories.getBaseCategoryList()\n
for k,v in args.items():\n for k,v in args.items():\n
if k in bases:\n if k in bases:\n
cats.append(\'/\'.join((k, v)))\n args[k+\'_relative_url\'] = k + \'/\' + v\n
if cats != []:\n
args[\'category\'] = cats\n
\n \n
# expand simplified notation of search mode\n # expand simplified notation of search mode\n
mode = args.get(\'mode\')\n mode = args.get(\'mode\')\n
modemap = {\'natural\':0, \'boolean\':\'in_boolean_mode\', \'expanded\':\'with_query_expansion\'}\n modemap = {\'natural\':0, \'boolean\':\'in_boolean_mode\', \'expanded\':\'with_query_expansion\'}\n
if mode and modemap.has_key(mode):\n if mode and modemap.has_key(mode):\n
args[\'search_mode\'] = modemap[mode]\n args[\'SearchableText\'] = dict(query=args[\'SearchableText\'], search_mode=modemap[mode])\n
\n \n
# a hack because SQLCatalog wants table.key now \n # a hack because SQLCatalog wants table.key now \n
# dunno if it is a bug or a feature\n # dunno if it is a bug or a feature\n
...@@ -245,6 +243,7 @@ return res\n ...@@ -245,6 +243,7 @@ return res\n
<string>v</string> <string>v</string>
<string>mode</string> <string>mode</string>
<string>modemap</string> <string>modemap</string>
<string>dict</string>
<string>cf</string> <string>cf</string>
<string>ct</string> <string>ct</string>
<string>mf</string> <string>mf</string>
......
497 499
\ No newline at end of file \ No newline at end of file
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