Diffusion Baloo 1799816357b4

Harmonize handling of underscore in query parser

Authored by bruns on Nov 25 2018, 8:53 PM.

Description

Harmonize handling of underscore in query parser

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@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

Reviewers: Baloo, Frameworks, ngraham, poboiko

Reviewed By: poboiko

Subscribers: kde-frameworks-devel

Tags: Frameworks, Baloo

Differential Revision: https://phabricator.kde.org/D17162

Details

Committed
brunsMar 17 2019, 4:43 PM
Reviewer
poboiko
Differential Revision
D17162: Harmonize handling of underscore in query parser
Parents
R293:eb68430ae5f4: Baloo engine: treat every non-success code as a failure
Branches
Unknown
Tags
Unknown