Commit f88e1066 authored by Romain Courteaud's avatar Romain Courteaud

Revert "Workaround mariadb crazy slow query when using fulltext key."

This reverts commit 1159063c.
parent cdb121a7
...@@ -35,6 +35,6 @@ class MroongaBooleanFullTextKey(MroongaFullTextKey): ...@@ -35,6 +35,6 @@ class MroongaBooleanFullTextKey(MroongaFullTextKey):
This SearchKey generates SQL fulltext comparisons for Mroonga whose This SearchKey generates SQL fulltext comparisons for Mroonga whose
default comparison operator is mroonga_boolean. default comparison operator is mroonga_boolean.
""" """
default_fulltext_comparison_operator = 'mroonga_boolean' default_comparison_operator = 'mroonga_boolean'
verifyClass(ISearchKey, MroongaBooleanFullTextKey) verifyClass(ISearchKey, MroongaBooleanFullTextKey)
...@@ -26,14 +26,14 @@ ...@@ -26,14 +26,14 @@
# #
############################################################################## ##############################################################################
from KeywordKey import KeywordKey from DefaultKey import DefaultKey
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
from zope.interface.verify import verifyClass from zope.interface.verify import verifyClass
class MroongaFullTextKey(KeywordKey): class MroongaFullTextKey(DefaultKey):
default_fulltext_comparison_operator = 'mroonga' default_comparison_operator = 'mroonga'
def dequoteParsedText(self): def dequoteParsedText(self):
return False return False
...@@ -45,14 +45,6 @@ class MroongaFullTextKey(KeywordKey): ...@@ -45,14 +45,6 @@ class MroongaFullTextKey(KeywordKey):
# from fulltext='a b' that means fulltext search with (a AND b). # from fulltext='a b' that means fulltext search with (a AND b).
return '(%s)' % (value, ) return '(%s)' % (value, )
def _guessComparisonOperator(self, value):
if isinstance(value, basestring) and value[:1] in ('+', '-'):
operator = self.default_fulltext_comparison_operator
else:
operator = super(MroongaFullTextKey,
self)._guessComparisonOperator(value)
return operator
def _processSearchValue(self, search_value, logical_operator, def _processSearchValue(self, search_value, logical_operator,
comparison_operator): comparison_operator):
operator_value_dict, logical_operator, parsed = \ operator_value_dict, logical_operator, parsed = \
......
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