Bug 424887 - Searching for file metainformation such as tags in Dolphin
Summary: Searching for file metainformation such as tags in Dolphin
Status: RESOLVED FIXED
Alias: None
Product: dolphin
Classification: Applications
Component: search (show other bugs)
Version: 18.08.0
Platform: Debian stable Linux
: NOR wishlist
Target Milestone: ---
Assignee: Dolphin Bug Assignee
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-08-01 09:34 UTC by myndstream
Modified: 2021-01-06 20:56 UTC (History)
3 users (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description myndstream 2020-08-01 09:34:44 UTC
A way to search for different metainformation of files including "tags" with Dolphin's search would be very useful.

When clicking on the tag in the information panel on the right Dolphin displays an error message: "The file or folder tags:Tag-name does not exist."

I also tried searching for files with a specific tag with KFind by entering "Tags" into "Search metainformation sections" and the tag-name in "for". It did not show any results.

Please also reply if there is a way to search for tags with KDE/Qt software - I think there has to be.

Searching for tags via the search Dolphin would be useful for many use-cases such as for music files (similar to playlists), images, and other media (like a media center).

SOFTWARE/OS VERSIONS
Linux/KDE Plasma: 5.14.5
KDE Plasma Version: 5.14
KDE Frameworks Version: 5.54.0
Qt Version: 5.11.3
Comment 1 Christoph Feck 2020-08-26 20:33:23 UTC
If you press Ctrl+F in Dolphin to open the Baloo search, then you should be able to search by tags or other attributes. e.g.:

    tag:Holidays type:Image

Baloo requires that the files get indexed to know about these attributes.

KFind doesn't use Baloo search, as far as I know.
Comment 2 myndstream 2020-08-26 21:17:07 UTC
(In reply to Christoph Feck from comment #1)

Doesn't work for me with Dolphin v18.08.0.
And it would be far more appropriate, intuitive, useful and user-friendly if there were some GUI controls to search for tags - for example a button "tags" where you can enter the tags and then it simply modifies the search-string to append "tag:tag-name".

When I enter a tag like this it doesn't show the files with that tag in the search results (it shows no search results).
Comment 3 tagwerk19 2020-12-29 21:31:33 UTC
You can navigate through the tags folders in Dolphin; opening 'Tags' in the 'Places' navigation pane and stepping through the folder structure.

Not a direct equivalent to search but useful if you are looking for a single tag.

Does need Baloo.
Comment 4 tagwerk19 2020-12-29 21:32:15 UTC
(In reply to myndstream from comment #0)

> When clicking on the tag in the information panel on the right Dolphin
> displays an error message: "The file or folder tags:Tag-name does not exist."

Just checking this in Neon (*). No error message but a panel that states "Tag Fragment". This is true but not incredibly useful :-/

What would be of practical use is if, when you clicked on the tag, you were taken to the tag folder.

* Plasma 5.20.4, Frameworks 5.77.0
Comment 5 myndstream 2021-01-01 16:54:24 UTC
(In reply to tagwerk19 from comment #3)
> You can navigate through the tags folders in Dolphin; opening 'Tags' in the
> 'Places' navigation pane and stepping through the folder structure.

There is no 'Tags' in the 'Places' panel on the left in Dolphin on my end.

> Does need Baloo.
baloo-kf5 is installed.


(In reply to tagwerk19 from comment #4)
> What would be of practical use is if, when you clicked on the tag, you were
> taken to the tag folder.

There are countless practical uses for this. It allows organizing files with tags and makes the tags actually useful.
For example I like to tag music files until I find a music player (like the 'Nuclear' player) that works properly and could then also use those tags. I outlined this and some other use-cases in the description above.

> Just checking this in Neon (*). No error message but a panel that states "Tag Fragment". This is true but not incredibly useful :-/
Maybe this issue should be changed from "wishlist" to "bug". Or do you think it would be better to create a separate issue for this with the error output?
Comment 6 tagwerk19 2021-01-01 18:45:19 UTC
(In reply to myndstream from comment #5)
 
> There is no 'Tags' in the 'Places' panel on the left in Dolphin on my end.

Check maybe that tags are actually being applied, try:

  getfattr -d whatever-filename

This will show the tags in the metainfo... (file attributes...)

If you see tags there, you can query baloo directly. Assume you've tagged the file with "mytag", then

  baloosearch tags:mytag

should list it. If it doesn't then you are troubleshooting baloo. Things to try here are to run:

  balooctl status

to see if baloo thinks it is running and then run

  balooctl monitor

in a separate window. This should show you files "as baloo indexes them". If you create/edit a file you should see it pop up on the monitor output. Try also creating/editing a file in your 'Documents' folder, some distributions set up baloo to index your whole home directory, others just a subset of "standard" folders. After that, it's worth trying

  balooctl check

to prod baloo to look for any changes. It does sometimes get stuck and a reminder will get it going again.

As a parallel option, assuming you have disc space, set up a virtual machine and install a newer release. It may be you are dealing with a "way old" problem.
Comment 7 Jason Straight 2021-01-01 23:00:49 UTC
I feel like KDE/Plasma is definitely missing out here. indexing and tagging is such a powerful feature, but it's like it's barely implemented at this point.

Everything is indexed, but making use of that, and tagging, and searching, etc is lacking.

If you want to search for tags, the url syntax in dolphin is different now and I only stumbled across it on some site while doing a search. I found nothing about it in any documentation anywhere, and it's very non-intuitive.

To search for files with tag=Jason, you'd enter "baloosearch:/?query=tag:jason" in the file address bar. It's not just tag: any more.
Comment 8 tagwerk19 2021-01-01 23:54:12 UTC
(In reply to Jason Straight from comment #7)

> To search for files with tag=Jason, you'd enter
> "baloosearch:/?query=tag:jason" in the file address bar.
> It's not just tag: any more.

Maybe try
  tags:jason
or
  tags:/jason

Or at least that works for me in Neon Testing and Fedora 33
Comment 9 myndstream 2021-01-05 18:35:47 UTC
* baloosearch:/?query=tag:tagname does not show any files in dolphin (entered in Dolphin search by pressing Ctrl+F)
* same for baloosearch tags:tagname
* same for tags:tagname
* same for tags:/tagname
* same for tags=tagname
* same for tag=tagname

* running baloosearch tags:tagname in the console in that folder only returns the elapsed time
* getfattr -d whatever-filename returns bash: getfattr: command not found

Tags would be very useful. I'm wondering why not many people have asked about it as tags are a widely used functionality on the Web and could be tremendously useful for things like music files. The tags could be used across apps and sync across devices etc.

Note that having a good identifier-mechanism would be useful for this so that tags could be kept for files whose names change (e.g. via hashes or adding ID fields etc). But this could be implemented later once tags are working at least to some degree.

balooctl status returned "Baloo is currently disabled. To enable, please run balooctl enable"

I still don't get any search results but maybe it needs to index first. balooctl monitor now returns:
```
Press ctrl+c to stop monitoring
File indexer is running
Initial Indexing
```

Is that file-indexing disabled by default? If so why? Maybe I disabled it either for security reasons (and/) or because it consumed lots of CPU.

Anyways, I guess it'll probably work after it indexed the files. If not I'll add a comment. But I'd still like to know if it's disabled by default in debian. I'll check with KDE neon later. Thanks for the help!
Comment 10 myndstream 2021-01-06 02:07:37 UTC
Now baloosearch tags:tagname shows the files while entering tags:tagname into Dolphin's search (Ctrl+F) doesn't show any search-results. I thought maybe it hasn't indexed the directory yet...however `balooctl status` returns
> Baloo File Indexer is running
> Indexer state: Idle
Comment 11 tagwerk19 2021-01-06 08:27:57 UTC
(In reply to myndstream from comment #10)

> Now baloosearch tags:tagname shows the files while entering tags:tagname
> into Dolphin's search (Ctrl+F) doesn't show any search-results. 

I think you are now in far better shape....

Baloo is finding files, indexing the tags and a baloosearch is giving you the answers.

When you do a Ctrl-F in Dolphin and get the Search, do you see options for "Filename", "Content", "From Here", "Your Files" displayed? They look a bit like browser tabs and act like filters.

If you've typed in "tags:tagname" into the search, click on the "Content" tab. Similarly on the "Your Files".

If you search for "word" and click back and forth between "Filename" and "Content" you should switch back and forth between seeing filenames with "word" in them and the results of the free text search.
Comment 12 myndstream 2021-01-06 12:57:07 UTC
(In reply to tagwerk19 from comment #11)
> If you've typed in "tags:tagname" into the search, click on the "Content"
> tab. Similarly on the "Your Files".
That was it - now it's displaying files with that tag (and clicking on the tags in the Information panel now works too).
Thank you!

I'll try to find out if Debian10 with KDE has the baloo search/indexing enabled by default later because it probably should and I don't know if and why I disabled it if it is.
Comment 13 tagwerk19 2021-01-06 17:45:20 UTC
(In reply to myndstream from comment #12)

> I'll try to find out if Debian10 with KDE has the baloo search/indexing
> enabled by default...

If you create a new user and log in with that you'll get the account 'defaults'. Anything you'd changed for one user won't affect a new user...

Good news that it's now working.

I might sketch out a bug report about the Dolphin "Filename" and "Content" tabs not being as intuitive as they might be....
Comment 14 myndstream 2021-01-06 18:15:12 UTC
> I might sketch out a bug report about the Dolphin "Filename" and "Content" tabs not being as intuitive as they might be....

That would be great. I think it would be best if there was a button to show more metadata fields for the search than filetype, modified-at and rating. Then it would be nice if there was a way to configure which fields are displayed by default (one could add "Tags"). There could be a separate input field for tags and for example when one enters text in there it sets a background-color for the tag after entering a comma (far more intuitive and self-explanatory than having to know that one has to enter tags:tagname in the main search). Lastly, the entire metadata-panel (including filetype etc) which is currently shown by default could be made toggleable so that one can set it to not shown by default.
Comment 15 tagwerk19 2021-01-06 20:56:49 UTC
See Bug 431240