Commit e2a44469 authored by Kazuhiko Shiozaki's avatar Kazuhiko Shiozaki

full text: revert imperfect changes to make FullTextKey behave somehow close to MroongaFullTextKey.

parent ae7c1a91
...@@ -29,8 +29,6 @@ ...@@ -29,8 +29,6 @@
############################################################################## ##############################################################################
from DefaultKey import DefaultKey from DefaultKey import DefaultKey
from SearchKey import SearchKey
from Products.ZSQLCatalog.Query.SimpleQuery import SimpleQuery from Products.ZSQLCatalog.Query.SimpleQuery import SimpleQuery
from Products.ZSQLCatalog.interfaces.search_key import ISearchKey from Products.ZSQLCatalog.interfaces.search_key import ISearchKey
from Products.ZSQLCatalog.SearchText import dequote from Products.ZSQLCatalog.SearchText import dequote
...@@ -98,18 +96,12 @@ class FullTextKey(DefaultKey): ...@@ -98,18 +96,12 @@ class FullTextKey(DefaultKey):
value_list = operator_value_dict.pop(comparison_operator, []) value_list = operator_value_dict.pop(comparison_operator, [])
if not value_list: if not value_list:
continue continue
if logical_operator == 'or': # XXX:
joined_value = ' '.join(value_list) # In MySQL FTS, no operator implies OR so that we should not merge
append(SimpleQuery(search_key=self, # AND queries into one...
comparison_operator=comparison_operator, append(SimpleQuery(search_key=self,
group=group, **{column:joined_value})) comparison_operator=comparison_operator,
else: group=group, **{column: ' '.join(value_list)}))
# In MySQL FTS, no operator implies OR so that we cannot merge
# AND queries into one.
for value in value_list:
append(SimpleQuery(search_key=self,
comparison_operator=comparison_operator,
group=group, **{column:value}))
# Other comparison operators are handled by the super class. # Other comparison operators are handled by the super class.
if operator_value_dict: if operator_value_dict:
query_list += super(FullTextKey, self)._buildQuery( query_list += super(FullTextKey, self)._buildQuery(
......
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