Commit 6aee2b4f authored by Kazuhiko Shiozaki's avatar Kazuhiko Shiozaki

modify _buildQuery() according to the change in r38682.


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@38372 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent f4c271e9
......@@ -52,10 +52,12 @@ class SphinxSEFullTextKey(SearchKey):
same operator into just one query, to save SQL server from the burden to
do multiple fulltext lookups when one would suit the purpose.
Here We wrap each phrase or word with double quotes, as the
workaround of 1-gram search specification in current Sphinx.
Example:
'aaa bbb' : '"aaa" "bbb"'
'"aaa bbb"' : '"aaa" "bbb"' XXX no way to differentiate with the
above for now
'"aaa bbb"' : '"aaa bbb"'
'"aaa bbb" ccc' : '"aaa bbb" "ccc"'
"""
column = self.getColumn()
......@@ -66,7 +68,7 @@ class SphinxSEFullTextKey(SearchKey):
value_list = value_list[0].split()
append(SimpleQuery(search_key=self,
comparison_operator=comparison_operator,
group=group, **{column:'"%s"' % '" "'.join(value_list)}))
group=group, **{column:' '.join(['"%s"' % x.replace('"', '') for x in value_list])}))
return query_list
verifyClass(ISearchKey, SphinxSEFullTextKey)
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