When I try to limit the search with --directory, I'll see the result from other sibling directories. For example: $ pwd /home/foo/Music Video/Imagine Dragons $ baloosearch -d . "" I can see unexpected results such as: /home/foo/Music Video/Infernal/ but I only see the unexpected results from sibling directories. It seems it limit the result to the parent directory (--directory /home/foo/Music Video).
Just confirming this affects me as well. System is gentoo, package is kde-frameworks/baloo-5.34.0. Some quick commands to test: cd ~/tmp mkdir kde-search-test cd kde-search-test mkdir dir1 mkdir dir2 touch dir1/rareword.txt touch dir2/rareword.txt cd .. baloosearch filename:rareword baloosearch filename:rareword --directory kde-search-test/dir1/ (Might have to run "balooctl index kde-search-test/", etc. for the files to get indexed, before running baloosearch.) The baloosearch command simply ignores the --directory parameter. This would perhaps not be too severe if it just affected the baloosearch command; unfortunately, it's also affecting programs tying into baloo. See, for example, bug 379665, 'search is not working in "from here"', filed under dolphin. There, we see basically the same behavior: dolphin returns search results from the entire system, ignoring the "from here" switch that's supposed to restrict results to the current directory.
*** Bug 379665 has been marked as a duplicate of this bug. ***
Fixed by KF 5.38.0.
I confirm it works OK in kubuntu 1710