Manually Forcing the (Re-)Indexing of Folders is Easy

Ever since the unicode bug in Virtuoso 6.1.3 many of us have broken unicode strings in our Nepomuk databases. Completely re-creating the database is IMHO not an option since that would mean loosing all manual annotations and things like download source URLs. One solution would be restoring a backup but I simply do not trust the Nepomuk backup until I had a deeper look into it. The perfect solution would be if Nepomuk could simply fix the data automatically. While that is of course my goal and I am looking into that it will take a while.

In the meantime I threw together a small desktop file which adds two new actions to the context menu of folders.

  1. (Re-)index Folder contents will make the indexer update all the files in the folder indifferent of their state in Nepomuk. This includes fixed unicode strings.
  2. (Re-)index Folder contents recursive does the same as the above except that it also recurses into sub folders.

Simply put the following into a file called “nepomuk-index-folder.desktop” and save it in “~/.kde/share/kde4/services/ServiceMenus”. At the next start of Dolphin or Konqueror the two new actions will be available.

[Desktop Entry]
X-KDE-Submenu=Desktop Search

[Desktop Action indexFolder]
Name=(Re-)index Folder contents
Exec=qdbus /nepomukfileindexer org.kde.nepomuk.FileIndexer.indexFolder %f 0 1

[Desktop Action indexFolderRecursive]
Name=(Re-)index Folder contents recursive
Exec=qdbus /nepomukfileindexer org.kde.nepomuk.FileIndexer.indexFolder %f 1 1

Update: The code above does only work for KDE 4.8 since we renamed the “strigi service” to “file indexing service”. So in order to make this work in KDE 4.7 and before replace “nepomukfileindexer” with “nepomukstrigiservice” and “FileIndexer” with “Strigi”.

18 thoughts on “Manually Forcing the (Re-)Indexing of Folders is Easy

  1. That’s interesting! However, on my system (OpenSUSE 12.1 with KDE 4.7.3) this does not work.

    When I run

    qdbus /nepomukfileindexer org.kde.nepomuk.FileIndexer.indexFolder FolderToIndex 0 1

    on the command line, I get the error message:

    Cannot find ‘org.kde.nepomuk.FileIndexer.indexFolder’ in object /nepomukfileindexer at

    Any thoughts?

  2. If nepomuk backup is not trusted by its developer, should it be there at all?
    I don’t want to flame or anything, but I think it’s better to have no option than to have one that seems to work, but when you need it, it doesn’t.

  3. Nice tip! There should be a simple command to reindex all indexed folders – is it a smart idea to run

    qdbus /nepomukfileindexer org.kde.nepomuk.FileIndexer.updateFolder $HOME 1 1

    to achieve that?

    • Yes, this is correct indeed. There are “indexFolder” and “updateFolder”. The difference is that the latter does take the configuration into account and only updates what it configured to be updated.

  4. Please, force some reindexings. I’ve found trouble migrating Nepomuk databases from KDE 4.7 to KDE 4.8. Deleting my old database and creating a new one generated a performant and light database with almost no impact in resource usage.

  5. Pingback: detailed KDE Nepomuk Manual « kdenepomukmanual

  6. Hello Sebastian,

    really a big thank for this introduced solution of one of my problems. I really appreciate the work that you KDE-folks are doing. But the question of A Rojas is still unanswered. How to force a re-indexing of e-mails?
    And to get some more knowledge: where and in what form are the filters stored that I setup in system settings – desktop search? I mean the folders that shall be included and the MIME types and files to exclude from indexing. (My guess: they are stored in a MySQL table?) Are this filters considered in a forced re-indexing?


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s