Bug 355767 - KRunner searches for words inside files, but does not find the file that matches the words provided
Summary: KRunner searches for words inside files, but does not find the file that matc...
Status: CONFIRMED
Alias: None
Product: krunner
Classification: Plasma
Component: filesearch (show other bugs)
Version: unspecified
Platform: Arch Linux Linux
: NOR normal
Target Milestone: ---
Assignee: Stefan Brüns
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-11-23 01:01 UTC by Akarsh Simha
Modified: 2022-08-09 15:57 UTC (History)
7 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Akarsh Simha 2015-11-23 01:01:00 UTC
Pre-KF5 versions of KRunner would pull up a file when one typed in a query that was a substring of the filename. KRunner now instead prioritizes all occurances of the query inside of baloo-indexed documents rather than displaying on top the match from the file name.

I've shown an example here:
http://wstaw.org/m/2015/11/23/krunnerbug.png

It turns out that I indeed have a file named Lamb_Sir_Horace_Hydrodynamics.pdf under a subdirectory of $HOME -- however, the results I see are mostly matches for words inside the documents.

Reproducible: Always

Steps to Reproduce:
1.  Fire up KRunner
2. Type a query string that matches a document's file name, but is also present in many of the other documents indexed by baloo
3. The file-name match is not prioritized over a body indexed-text match.

Actual Results:  
The file-name match is drowned amidst full-text matches

Expected Results:  
It would be much preferable to have the document where there is a filename match (or more generally metadata match) on the top of the list of matches.

Question: It might be even better if directory search is provided by a different module?
Comment 1 Michael D 2016-03-17 09:55:24 UTC
It would be useful if the current "document" runner had an option to search for filenames and perhaps filenames only. If searching both contents and filenames it could prioritize filenames over contents, or provide an option for setting priority. Otherwise, a separate krunner to search for filenames would be very useful, but I think it doesn't make sense to have a separate runner for that when the functionality should be put in the current "document" runner.

I guess this is a wish rather than bug, but given that the functionality existed KDE4, it looks like a regression.

PS. the title of this report does not exactly make it easy to find!
Comment 2 Hugh Gao 2017-02-06 01:16:17 UTC
Search by content annoying in a lot times, because the result list is so long that it's difficult to find what wanted.
Comment 3 hoitaus 2017-11-03 05:07:31 UTC
*** This bug has been confirmed by popular vote. ***
Comment 4 Stefan Brüns 2019-04-10 00:37:29 UTC
Option 1: In KRunner, use "filename:foo"
Option 2: In Dolphin -> "Find ...", select "Filename"
Comment 5 enno 2019-08-29 18:48:47 UTC
Since searching for a file by its name is a common use case, could the keyword 'filename:' be shortened? Say, to 'f:'?
Comment 6 Michael D 2019-08-29 18:50:22 UTC
Or "file:foo"
Comment 7 Natalie Clarius 2022-08-09 15:57:16 UTC
As far as I can tell Baloo does not provide an option to limit a query nor information in the return results whether the match occurs in the file name or file contents, so such an option would have to be added to Baloo before KRunner could make use of it. Even better would be if filtering out content matches altogether weren't necessary because this relevance would be adequately reflected in the sorting, which Baloo currently does not seem to do.