Consider below command:
baloosearch -d. "rating>=10" | grep -i unconditionally
/path/to/directory/Katy Perry/Katy Perry - Unconditionally (Official)-XjwZAa2EjKA.mp4
and consider the output of getfattr:
getfattr -d Katy\ Perry\ -\ Unconditionally\ \(Official\)-XjwZAa2EjKA.mp4
# file: Katy Perry - Unconditionally (Official)-XjwZAa2EjKA.mp4
So baloosearch shouldn't show that file. I'm using Fedora 23 65 bit:
rpm -qa | grep -i baloo
Steps to Reproduce:
1. set "user.baloo.rating" xattribute to 8 for foo.mp4
2. run baloosearch -d. "rating>=10"
3. The file will appear in the result.
A set of files in which there are some files that don't have rating >= 10
The set of files must have rating >= 10
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!
(In reply to Nate Graham from comment #3)
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
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"
$ baloosearch -d. "rating>=9"
$ baloosearch -d. "rating<=10"
$ baloosearch -d. "rating<=9"
$ baloosearch -d. "rating<=2"
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)
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
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
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