Searching by content returns incomplete results comparing to grep or krusader. I have some directory (~/.bash_it → git@github.com:Fisiu/bash-it.git). When I run `grep -rl "scm_prompt_info" . | wc -l` or krusader serach, in both cases I got 20 files which contain "scm_prompt_info" phrase. When I do the same search in Dolphin (tested on 4.11.5 and 4.12.3), then search result contains only 7 files. No matter if nepomuk indexing is enabled/disabled. Reproducible: Always
Thanks for the bug report. I can confirm this. The problem is that we only search the text inside files which have a mime type that begins with "text/". All your files that contain "#!/usr/bin/env bash" at the beginning have the mime type "shell script" and are not considered as text files. I'm not sure what to do about this. I would prefer not to maintain a Dolphin-internal list of mime types that usually contain plain text... (and such a list would not help at all, because it would only work if Nepomuk is disabled, and the Dolphin-internal 'filenamesearch' is used).
And how krusader does handle searching by content? Maybe theirs solution applies.
Ah, I just looked through the API docs - it seems that we can use mime type inheritance, like KFileItem item(....); if (item.determineMimeType()->is("text/plain")) { // Check if the file contains the text... } Probably Krusader uses the same solution (or they search in all files).
I have a patch that fixes the problem for me: https://git.reviewboard.kde.org/r/116805/ @Hrvoje: I see that you read this report. Should a separate report be filed for Nepomuk/Baloo?
(In reply to comment #4) > @Hrvoje: I see that you read this report. Should a separate report be filed > for Nepomuk/Baloo? You mean is the same bug valid with nepomuk/baloo on ? At the moment i have downgraded from 4.13 to 4.12 due to some issues, and i am normally not using nepomuk. i can try to activate it and test with another user if needed ;-)
Git commit c52ba9446b05e6bc7f890daac406659a9c37c562 by Frank Reininghaus. Committed on 16/03/2014 at 17:02. Pushed by freininghaus into branch 'KDE/4.12'. Use MIME type inheritance to find out if a file contains text Before this commit, filenamesearch checked if a file's MIME type begins with "text/" to determine if its content can be searched. This prevented that text inside shell scripts is found. REVIEW: 116805 FIXED-IN: 4.12.4 M +4 -1 dolphin/src/search/filenamesearchprotocol.cpp http://commits.kde.org/kde-baseapps/c52ba9446b05e6bc7f890daac406659a9c37c562
(In reply to comment #5) > (In reply to comment #4) > > @Hrvoje: I see that you read this report. Should a separate report be filed > > for Nepomuk/Baloo? > > You mean is the same bug valid with nepomuk/baloo on ? According to comment 0, yes, but I haven't tested it myself.
*** Bug 314607 has been marked as a duplicate of this bug. ***