D17162: Harmonize handling of underscore in query parser
Stefan BrĂ¼ns
noreply at phabricator.kde.org
Sun Nov 25 21:38:24 GMT 2018
bruns created this revision.
bruns added reviewers: Baloo, Frameworks, ngraham, poboiko.
Herald added projects: Frameworks, Baloo.
Herald added a subscriber: kde-frameworks-devel.
bruns requested review of this revision.
REVISION SUMMARY
The engine differentiates between independent terms, and adjacent terms
forming a phrase. The latter is e.g. used for mail addresses and file
names, "ice at fire.com" or "foo_bar.png". In the database these are stored
without any punctuation characters, but with their relative positions.
While most punctuation characters (e.g. ".", ",", "/", "-", ...) are
treated the same, underscore was handled differently. A query for
"foo-bar.png" searches for the three adjacent terms, while "foo_bar png"
searches for the three terms in any order.
Treat "_" like any other punctuation character. For this to work, the
delimiter has to be checked from the original input string, not the
text mangled for QTextBoundaryFinder.
TEST PLAN
ctest
REPOSITORY
R293 Baloo
BRANCH
submit
REVISION DETAIL
https://phabricator.kde.org/D17162
AFFECTED FILES
autotests/unit/engine/queryparsertest.cpp
src/engine/queryparser.cpp
To: bruns, #baloo, #frameworks, ngraham, poboiko
Cc: kde-frameworks-devel, ashaposhnikov, michaelh, astippich, spoorun, ngraham, bruns, abrahams
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kde-frameworks-devel/attachments/20181125/c561789a/attachment-0001.html>
More information about the Kde-frameworks-devel
mailing list