Commit 70a32a15 authored by Kazuhiko Shiozaki's avatar Kazuhiko Shiozaki

full text: optimise empty string search.

parent 58ad1166
......@@ -107,6 +107,10 @@ class MatchComparisonOperator(MonovaluedComparisonOperator):
This operator can emit a select expression, so it overrides
asSQLExpression inseatd of just defining a render method.
"""
# No need fo do full text search for an empty string.
if value_list == '':
column, value_list = self.render(column, value_list)
return SQLExpression(self, where_expression='%s %s %s' % (column, '=', value_list))
value_list = self.renderValue(value_list)
match_string = self.where_expression_format_string % {
'column': column,
......
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