Summary: | baloosearch cannot filter rating criteria correctly | ||
---|---|---|---|
Product: | [Frameworks and Libraries] frameworks-baloo | Reporter: | Saman <svps777+kde> |
Component: | Engine | Assignee: | Stefan Brüns <stefan.bruens> |
Status: | RESOLVED FIXED | ||
Severity: | major | CC: | aspotashev, nate, noein93, pinak.ahuja, stefan.bruens |
Priority: | NOR | ||
Version: | 5.18.0 | ||
Target Milestone: | --- | ||
Platform: | Fedora RPMs | ||
OS: | Linux | ||
Latest Commit: | https://commits.kde.org/baloo/e1045c4f7891e012e03caf9b1f5a5c81c585e282 | Version Fixed In: | 5.53 |
Description
Saman
2016-01-14 02:57:46 UTC
Are you still able to reproduce this issue? It works for me using KDE Frameworks 5.39.0 in KDE Neon. (In reply to Nate Graham from comment #1) > Are you still able to reproduce this issue? It works for me using KDE > Frameworks 5.39.0 in KDE Neon. I'm using Frameworks 5.38.0 (Fedora 26) and I can't reproduce the bug. It is fixed! Fabulous! (In reply to Nate Graham from comment #3) > Fabulous! Sorry my mistake. The problem still exists in 5.38.0. But the following issue is fixed in my framework version: https://bugs.kde.org/show_bug.cgi?id=378884 Still can't repro, but if you can, we'll keep this open and resume investigating. (In reply to Nate Graham from comment #5) > Still can't repro, but if you can, we'll keep this open and resume > investigating. Unlike previous versions, the problem sometimes happens. It's strange on the same directory I see the problem but after some tries, I can't reproduce it. I try to test it more. I can reproduce this bug in Baloo 5.38.0: $ baloosearch -d. "rating=9" | grep -v "Elapsed:" | wc -l The output is 9 then I run the following command: $ baloosearch -d. "rating=10" | grep -v "Elapsed:" | wc -l The output is 5 So I expect to see 14 for the following command but I see 9 instead: $ baloosearch -d. "rating>=9" | grep -v "Elapsed:" | wc -l In other words there is no difference between "=" and ">=" operators. Some test cases which baloo failed in 5.38.0: 1. Create a directory named baloo_test 2. Create two files "rating10.txt" and "rating9.txt". Give rating 10 to the former and 9 to the latter. I can see the following wrong results: $ baloosearch -d. "rating>=10" rating10.txt rating9.txt $ baloosearch -d. "rating>=9" rating9.txt $ baloosearch -d. "rating<=10" rating10.txt $ baloosearch -d. "rating<=9" rating10.txt rating9.txt $ baloosearch -d. "rating<=2" rating10.txt Git commit e1045c4f7891e012e03caf9b1f5a5c81c585e282 by Stefan Brüns. Committed on 01/12/2018 at 13:48. Pushed by bruns into branch 'master'. Fix searches for rating 10 (5 stars) Summary: The comparator callback/lambda used a string comparision, which returned the wrong documents, as "2" > "10", and "10" < "9", i.e. selecting the "Highest rating" in dolphin returned all documents with a rating of 2 or higher. Convert the numeric suffix of the rating term ("R2", "R10", ...) to an integer value and use it for comparision. Reviewers: #baloo, #frameworks, ngraham, poboiko, mgallien Reviewed By: #baloo, ngraham Subscribers: kde-frameworks-devel Tags: #frameworks, #baloo Differential Revision: https://phabricator.kde.org/D17272 M +2 -2 autotests/unit/engine/postingdbtest.cpp M +5 -5 src/engine/postingdb.cpp M +1 -1 src/engine/postingdb.h M +1 -1 src/engine/transaction.cpp M +1 -1 src/engine/transaction.h M +3 -4 src/lib/searchstore.cpp https://commits.kde.org/baloo/e1045c4f7891e012e03caf9b1f5a5c81c585e282 |