Bug 438528 - balooctl could use a remove subcommand to remove duplicate IDs
Summary: balooctl could use a remove subcommand to remove duplicate IDs
Status: CONFIRMED
Alias: None
Product: frameworks-baloo
Classification: Frameworks and Libraries
Component: balooctl (show other bugs)
Version: 5.82.0
Platform: Fedora RPMs Linux
: NOR normal
Target Milestone: ---
Assignee: baloo-bugs-null
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-06-13 00:29 UTC by skierpage
Modified: 2023-01-01 11:45 UTC (History)
2 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 skierpage 2021-06-13 00:29:44 UTC
SUMMARY
It's possible to have multiple entries in Baloo's index for a file path due to the way it generates its internal IDs (see bug 438382). `baloosearch --id some terms` will show these IDs but you can't clear particular IDs.

STEPS TO REPRODUCE
1. Get into a state where Baloo's index has multiple IDs for a file. This happens to me with files I often edit on a mounted NTFS partition which I told Baloo to index.
2. baloosearch for terms in this file, using its --id option
3. Try to remove the errant IDs with balooctl clear

OBSERVED RESULT
E.g.
  % baloosearch --id FuelCellWorks
  500d900000803 /media/Windows/Users/spage/Documents/ECO.txt
  5be2000000803 /media/Windows/Users/spage/Documents/ECO.txt
  8546e00000803 /media/Windows/Users/spage/Documents/ECO.txt
  ...

EXPECTED RESULT

You should be able to clear particular IDs from Baloo's index. It would work like this:
  % balooctl remove 5be2000000803 nosuchid666 8546e00000803 
  Removing ID 5be2000000803 from index.
  ID nosuchid666 not found in index.
  Removing ID 8546e00000803 from index.
  2 IDs removed from Baloo's index.

SOFTWARE/OS VERSIONS
Linux/KDE Plasma: 
(available in About System)
KDE Plasma Version: 5.21.5
KDE Frameworks Version: 5.82.0
Qt Version: 5.15.2 on Wayland

ADDITIONAL INFORMATION
The logic in balooctl clear may be broken, bug 438527. If that were fixed, then you could repeatedly enter `balooctl clear /path/to/file` and eventually all the IDs would clear, and then you could `touch /path/to/file` and get Baloo to reindex.  However, I think this would first remove the ID that matches the file on-disk, and it seems generally useful to have a remove [IDs] subcommand.

Maybe removeID is a better subcommand name, but then you'd want arbitrary capitalization handling... "Rewrite it in Rust" 😉
Comment 1 tagwerk19 2021-07-13 16:43:16 UTC
Flag as "Sensible Suggestion"...