Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
erp5
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Laurent S
erp5
Commits
36a82398
Commit
36a82398
authored
Oct 28, 2014
by
Kazuhiko Shiozaki
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixup! full text: move special query generation logic from SearchKey to ComparisonOperator.
parent
3916cbc1
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
2 deletions
+4
-2
product/ZSQLCatalog/Operator/ComparisonOperator.py
product/ZSQLCatalog/Operator/ComparisonOperator.py
+4
-2
No files found.
product/ZSQLCatalog/Operator/ComparisonOperator.py
View file @
36a82398
...
...
@@ -165,12 +165,13 @@ class MroongaComparisonOperator(MatchComparisonOperator):
match_boolean_query_list
.
append
(
token
)
else
:
match_query_list
.
append
(
token
)
# Always use BOOLEAN MODE to combine similarity search and boolean search.
self
.
mode
=
' IN BOOLEAN MODE'
fulltext_query
=
'*D+'
if
match_query_list
:
fulltext_query
+=
' *S"%s"'
%
' '
.
join
(
x
.
replace
(
'"'
,
'
\
\
"'
)
for
x
in
match_query_list
)
if
match_boolean_query_list
:
fulltext_query
+=
' %s'
%
' '
.
join
(
match_boolean_query_list
)
self
.
mode
=
' IN BOOLEAN MODE'
return
self
.
_renderValue
(
fulltext_query
)
verifyClass
(
IOperator
,
MroongaComparisonOperator
)
...
...
@@ -178,7 +179,8 @@ verifyClass(IOperator, MroongaComparisonOperator)
class
MroongaBooleanComparisonOperator
(
MroongaComparisonOperator
):
def
renderValue
(
self
,
value_list
):
"""
value_list must either be a non-list or a single-value list.
Special Query renderer for MroongaFullText queries:
* by default 'AND' search by using '*D+' pragma.
"""
if
isinstance
(
value_list
,
list_type_list
):
try
:
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment