Commit 016dbc15 authored by Tristan Cavelier's avatar Tristan Cavelier Committed by Kazuhiko Shiozaki

add a hack to allow `*` and `~` characters in fulltext search

parent 1e2fd051
......@@ -55,7 +55,7 @@
"""\n
from Products.ZSQLCatalog.SQLCatalog import SimpleQuery\n
\n
query = SimpleQuery(**{\'catalog_full_text.fulltext_description\': \'*D+ %s\' % value, \'comparison_operator\': \'match_boolean\'} )\n
query = SimpleQuery(**{\'catalog_full_text.fulltext_description\': \'*D+ %s\' % value.replace(r\'*\', r\'\\*\').replace(r\'~\', r\'\\~\'), \'comparison_operator\': \'match_boolean\'} )\n
return query\n
</string> </value>
</item>
......
......@@ -55,7 +55,8 @@
"""\n
from Products.ZSQLCatalog.SQLCatalog import SimpleQuery\n
\n
query = SimpleQuery(**{\'catalog_full_text.fulltext_title\': \'*D+ %s\' % value, \'comparison_operator\': \'match_boolean\'} )\n
query = SimpleQuery(**{\'catalog_full_text.fulltext_title\': \'*D+ %s\' % value.replace(r\'*\', r\'\\*\').replace(r\'~\', r\'\\~\'), \'comparison_operator\': \'match_boolean\'} )\n
\n
return query\n
</string> </value>
</item>
......
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