<table><tr><td style="">michaelh added a comment.
</td><a style="text-decoration: none; padding: 4px 8px; margin: 0 8px 8px; float: right; color: #464C5C; font-weight: bold; border-radius: 3px; background-color: #F7F7F9; background-image: linear-gradient(to bottom,#fff,#f1f0f1); display: inline-block; border: 1px solid rgba(71,87,120,.2);" href="https://phabricator.kde.org/D11038">View Revision</a></tr></table><br /><div><div><p>Baloo is in bad need for something like this. Unfortunately in cannot be done so easily.<br />
We have to account for indexed net shares and removable drives which are only temporarily unavailable. Files on those should not be removed. And most likely some user interaction is needed here.</p>

<p><a href="https://phabricator.kde.org/tag/baloo/" style="background-color: #e7e7e7;
          border-color: #e7e7e7;
          border-radius: 3px;
          padding: 0 4px;
          font-weight: bold;
          color: black;text-decoration: none;">#Baloo</a> has it own Project page now. Please have a look and file your plans for Baloo as tasks there. Also I'm very much interested in your opinion about the tasks filed there specially about  <a href="https://phabricator.kde.org/T8054" style="background-color: #e7e7e7;
          border-color: #e7e7e7;
          border-radius: 3px;
          padding: 0 4px;
          font-weight: bold;
          color: black;text-decoration: none;">T8054</a> and .</p></div></div><br /><div><strong>INLINE COMMENTS</strong><div><div style="margin: 6px 0 12px 0;"><div style="border: 1px solid #C7CCD9; border-radius: 3px;"><div style="padding: 0; background: #F7F7F7; border-color: #e3e4e8; border-style: solid; border-width: 0 0 1px 0; margin: 0;"><div style="color: #74777d; background: #eff2f4; padding: 6px 8px; overflow: hidden;"><a style="float: right; text-decoration: none;" href="https://phabricator.kde.org/D11038#inline-53368">View Inline</a><span style="color: #4b4d51; font-weight: bold;">transaction.cpp:264</span></div>
<div style="font: 11px/15px "Menlo", "Consolas", "Monaco", monospace; white-space: pre-wrap; clear: both; padding: 4px 0; margin: 0;"><div style="padding: 0 8px; margin: 0 4px; background: rgba(151, 234, 151, .6);">    <span class="n">QTextStream</span> <span style="color: #004012">out</span><span class="p">(</span><span class="n">stdout</span><span class="p">);</span>
</div><div style="padding: 0 8px; margin: 0 4px; background: rgba(151, 234, 151, .6);">    <span class="n">out</span> <span style="color: #aa2211"><<</span> <span style="color: #766510">"Total Document IDs: "</span> <span style="color: #aa2211"><<</span> <span class="n">map</span><span class="p">.</span><span class="n">size</span><span class="p">()</span> <span style="color: #aa2211"><<</span> <span class="n">endl</span><span class="p">;</span>
</div></div></div>
<div style="margin: 8px 0; padding: 0 12px;"><p style="padding: 0; margin: 8px;">This should go to stderr so only pruned files go to stdout</p></div></div><br /><div style="border: 1px solid #C7CCD9; border-radius: 3px;"><div style="padding: 0; background: #F7F7F7; border-color: #e3e4e8; border-style: solid; border-width: 0 0 1px 0; margin: 0;"><div style="color: #74777d; background: #eff2f4; padding: 6px 8px; overflow: hidden;"><a style="float: right; text-decoration: none;" href="https://phabricator.kde.org/D11038#inline-53386">View Inline</a><span style="color: #4b4d51; font-weight: bold;">transaction.cpp:270</span></div>
<div style="font: 11px/15px "Menlo", "Consolas", "Monaco", monospace; white-space: pre-wrap; clear: both; padding: 4px 0; margin: 0;"><div style="padding: 0 8px; margin: 0 4px; background: rgba(151, 234, 151, .6);">        <span style="color: #aa4000">if</span> <span class="p">(</span><span style="color: #aa2211">!</span><span class="n">QFileInfo</span><span style="color: #aa2211">::</span><span class="n">exists</span><span class="p">(</span><span class="n">url</span><span class="p">))</span> <span class="p">{</span>
</div><div style="padding: 0 8px; margin: 0 4px; background: rgba(151, 234, 151, .6);">            <span class="n">out</span> <span style="color: #aa2211"><<</span> <span style="color: #766510">"Purging "</span> <span style="color: #aa2211"><<</span> <span class="n">id</span> <span style="color: #aa2211"><<</span> <span class="n">endl</span><span class="p">;</span>
</div><div style="padding: 0 8px; margin: 0 4px; background: rgba(151, 234, 151, .6);">            <span class="n">m_writeTrans</span><span style="color: #aa2211">-></span><span class="n">removeDocument</span><span class="p">(</span><span class="n">id</span><span class="p">);</span>
</div></div></div>
<div style="margin: 8px 0; padding: 0 12px;"><p style="padding: 0; margin: 8px;">Place this at the end of the loop and also print url, please. E.g. <tt style="background: #ebebeb; font-size: 13px;">out << "Removed" << id << ":" << url;</tt> would be easily parseable. So one could catch stdout with</p>

<div class="remarkup-code-block" style="margin: 12px 0;" data-code-lang="text" data-sigil="remarkup-code-block"><pre class="remarkup-code" style="font: 11px/15px "Menlo", "Consolas", "Monaco", monospace; padding: 12px; margin: 0; background: rgba(71, 87, 120, 0.08);">balooctl pruneDb | tr '-d:' -f2 >removed_files.lst</pre></div></div></div><br /><div style="border: 1px solid #C7CCD9; border-radius: 3px;"><div style="padding: 0; background: #F7F7F7; border-color: #e3e4e8; border-style: solid; border-width: 0 0 1px 0; margin: 0;"><div style="color: #74777d; background: #eff2f4; padding: 6px 8px; overflow: hidden;"><a style="float: right; text-decoration: none;" href="https://phabricator.kde.org/D11038#inline-53389">View Inline</a><span style="color: #4b4d51; font-weight: bold;">transaction.cpp:271</span></div>
<div style="font: 11px/15px "Menlo", "Consolas", "Monaco", monospace; white-space: pre-wrap; clear: both; padding: 4px 0; margin: 0;"><div style="padding: 0 8px; margin: 0 4px; background: rgba(151, 234, 151, .6);">            <span class="n">out</span> <span style="color: #aa2211"><<</span> <span style="color: #766510">"Purging "</span> <span style="color: #aa2211"><<</span> <span class="n">id</span> <span style="color: #aa2211"><<</span> <span class="n">endl</span><span class="p">;</span>
</div><div style="padding: 0 8px; margin: 0 4px; background: rgba(151, 234, 151, .6);">            <span class="n">m_writeTrans</span><span style="color: #aa2211">-></span><span class="n">removeDocument</span><span class="p">(</span><span class="n">id</span><span class="p">);</span>
</div><div style="padding: 0 8px; margin: 0 4px; background: rgba(151, 234, 151, .6);">            <span class="n">count</span><span style="color: #aa2211">++</span><span class="p">;</span>
</div></div></div>
<div style="margin: 8px 0; padding: 0 12px;"><p style="padding: 0; margin: 8px;">Can we or should we check the result of the operation here?</p></div></div><br /><div style="border: 1px solid #C7CCD9; border-radius: 3px;"><div style="padding: 0; background: #F7F7F7; border-color: #e3e4e8; border-style: solid; border-width: 0 0 1px 0; margin: 0;"><div style="color: #74777d; background: #eff2f4; padding: 6px 8px; overflow: hidden;"><a style="float: right; text-decoration: none;" href="https://phabricator.kde.org/D11038#inline-53369">View Inline</a><span style="color: #4b4d51; font-weight: bold;">transaction.cpp:276</span></div>
<div style="font: 11px/15px "Menlo", "Consolas", "Monaco", monospace; white-space: pre-wrap; clear: both; padding: 4px 0; margin: 0;"><div style="padding: 0 8px; margin: 0 4px; background: rgba(151, 234, 151, .6);">    <span class="n">out</span> <span style="color: #aa2211"><<</span> <span style="color: #766510">"Removed Entries: "</span> <span style="color: #aa2211"><<</span> <span class="n">count</span> <span style="color: #aa2211"><<</span> <span style="color: #766510">" ("</span> <span style="color: #aa2211"><<</span> <span class="n">count</span> <span style="color: #aa2211">*</span> <span style="color: #601200">100.0</span> <span style="color: #aa2211">/</span> <span class="n">map</span><span class="p">.</span><span class="n">size</span><span class="p">()</span> <span style="color: #aa2211"><<</span> <span style="color: #766510">"%)"</span> <span style="color: #aa2211"><<</span> <span class="n">endl</span><span class="p">;</span>
</div><div style="padding: 0 8px; margin: 0 4px; background: rgba(151, 234, 151, .6);"><span class="p">}</span>
</div></div></div>
<div style="margin: 8px 0; padding: 0 12px;"><p style="padding: 0; margin: 8px;">Same as above</p></div></div><br /><div style="border: 1px solid #C7CCD9; border-radius: 3px;"><div style="padding: 0; background: #F7F7F7; border-color: #e3e4e8; border-style: solid; border-width: 0 0 1px 0; margin: 0;"><div style="color: #74777d; background: #eff2f4; padding: 6px 8px; overflow: hidden;"><a style="float: right; text-decoration: none;" href="https://phabricator.kde.org/D11038#inline-53370">View Inline</a><span style="color: #4b4d51; font-weight: bold;">main.cpp:90</span></div>
<div style="font: 11px/15px "Menlo", "Consolas", "Monaco", monospace; white-space: pre-wrap; clear: both; padding: 4px 0; margin: 0;"><div style="padding: 0 8px; margin: 0 4px; ">    <span class="n">parser</span><span class="p">.</span><span class="n">addPositionalArgument</span><span class="p">(</span><span class="n">QStringLiteral</span><span class="p">(</span><span style="color: #766510">"monitor"</span><span class="p">),</span> <span class="n">i18n</span><span class="p">(</span><span style="color: #766510">"Monitor the file indexer"</span><span class="p">));</span>
</div><div style="padding: 0 8px; margin: 0 4px; background: rgba(151, 234, 151, .6);">    <span class="n">parser</span><span class="p">.</span><span class="n">addPositionalArgument</span><span class="p">(</span><span class="n">QStringLiteral</span><span class="p">(</span><span style="color: #766510">"pruneDb"</span><span class="p">),</span> <span class="n">i18n</span><span class="p">(</span><span style="color: #766510">"Purge invalid index entries"</span><span class="p">));</span>
</div><div style="padding: 0 8px; margin: 0 4px; ">    <span class="n">parser</span><span class="p">.</span><span class="n">addPositionalArgument</span><span class="p">(</span><span class="n">QStringLiteral</span><span class="p">(</span><span style="color: #766510">"indexSize"</span><span class="p">),</span> <span class="n">i18n</span><span class="p">(</span><span style="color: #766510">"Display the disk space used by index"</span><span class="p">));</span>
</div></div></div>
<div style="margin: 8px 0; padding: 0 12px;"><p style="padding: 0; margin: 8px;">Just 'prune'?</p></div></div><br /><div style="border: 1px solid #C7CCD9; border-radius: 3px;"><div style="padding: 0; background: #F7F7F7; border-color: #e3e4e8; border-style: solid; border-width: 0 0 1px 0; margin: 0;"><div style="color: #74777d; background: #eff2f4; padding: 6px 8px; overflow: hidden;"><a style="float: right; text-decoration: none;" href="https://phabricator.kde.org/D11038#inline-53387">View Inline</a><span style="color: #4b4d51; font-weight: bold;">main.cpp:326</span></div>
<div style="font: 11px/15px "Menlo", "Consolas", "Monaco", monospace; white-space: pre-wrap; clear: both; padding: 4px 0; margin: 0;"><div style="padding: 0 8px; margin: 0 4px; background: rgba(151, 234, 151, .6);">    <span style="color: #aa4000">if</span> <span class="p">(</span><span class="n">command</span> <span style="color: #aa2211">==</span> <span class="n">QStringLiteral</span><span class="p">(</span><span style="color: #766510">"pruneDb"</span><span class="p">))</span> <span class="p">{</span>
</div><div style="padding: 0 8px; margin: 0 4px; background: rgba(151, 234, 151, .6);">        <span class="n">Database</span> <span style="color: #aa2211">*</span><span class="n">db</span> <span style="color: #aa2211">=</span> <span class="n">globalDatabaseInstance</span><span class="p">();</span>
</div></div></div>
<div style="margin: 8px 0; padding: 0 12px;"><p style="padding: 0; margin: 8px;">see above</p></div></div><br /><div style="border: 1px solid #C7CCD9; border-radius: 3px;"><div style="padding: 0; background: #F7F7F7; border-color: #e3e4e8; border-style: solid; border-width: 0 0 1px 0; margin: 0;"><div style="color: #74777d; background: #eff2f4; padding: 6px 8px; overflow: hidden;"><a style="float: right; text-decoration: none;" href="https://phabricator.kde.org/D11038#inline-53381">View Inline</a><span style="color: #4b4d51; font-weight: bold;">main.cpp:329</span></div>
<div style="font: 11px/15px "Menlo", "Consolas", "Monaco", monospace; white-space: pre-wrap; clear: both; padding: 4px 0; margin: 0;"><div style="padding: 0 8px; margin: 0 4px; background: rgba(151, 234, 151, .6);">        <span style="color: #aa4000">if</span> <span class="p">(</span><span style="color: #aa2211">!</span><span class="n">db</span><span style="color: #aa2211">-></span><span class="n">open</span><span class="p">(</span><span class="n">Database</span><span style="color: #aa2211">::</span><span class="n">ReadOnlyDatabase</span><span class="p">))</span> <span class="p">{</span>
</div><div style="padding: 0 8px; margin: 0 4px; background: rgba(151, 234, 151, .6);">            <span class="n">out</span> <span style="color: #aa2211"><<</span> <span style="color: #766510">"Baloo Index could not be opened</span><span style="color: #bb6622">\n</span><span style="color: #766510">"</span><span class="p">;</span>
</div><div style="padding: 0 8px; margin: 0 4px; background: rgba(151, 234, 151, .6);">            <span style="color: #aa4000">return</span> <span style="color: #601200">1</span><span class="p">;</span>
</div></div></div>
<div style="margin: 8px 0; padding: 0 12px;"><p style="padding: 0; margin: 8px;">stderr</p></div></div><br /><div style="border: 1px solid #C7CCD9; border-radius: 3px;"><div style="padding: 0; background: #F7F7F7; border-color: #e3e4e8; border-style: solid; border-width: 0 0 1px 0; margin: 0;"><div style="color: #74777d; background: #eff2f4; padding: 6px 8px; overflow: hidden;"><a style="float: right; text-decoration: none;" href="https://phabricator.kde.org/D11038#inline-53382">View Inline</a><span style="color: #4b4d51; font-weight: bold;">main.cpp:334</span></div>
<div style="font: 11px/15px "Menlo", "Consolas", "Monaco", monospace; white-space: pre-wrap; clear: both; padding: 4px 0; margin: 0;"><div style="padding: 0 8px; margin: 0 4px; background: rgba(151, 234, 151, .6);">        <span class="n">Transaction</span> <span class="n">tr</span><span class="p">(</span><span class="n">db</span><span class="p">,</span> <span class="n">Transaction</span><span style="color: #aa2211">::</span><span class="n">ReadOnly</span><span class="p">);</span>
</div><div style="padding: 0 8px; margin: 0 4px; background: rgba(151, 234, 151, .6);">        <span class="n">out</span> <span style="color: #aa2211"><<</span> <span style="color: #766510">"Checking file paths .. "</span> <span style="color: #aa2211"><<</span> <span class="n">endl</span><span class="p">;</span>
</div><div style="padding: 0 8px; margin: 0 4px; background: rgba(151, 234, 151, .6);">        <span class="n">tr</span><span class="p">.</span><span class="n">pruneFsTree</span><span class="p">();</span>
</div></div></div>
<div style="margin: 8px 0; padding: 0 12px;"><p style="padding: 0; margin: 8px;">stderr</p></div></div></div></div></div><br /><div><strong>REPOSITORY</strong><div><div>R293 Baloo</div></div></div><br /><div><strong>REVISION DETAIL</strong><div><a href="https://phabricator.kde.org/D11038">https://phabricator.kde.org/D11038</a></div></div><br /><div><strong>To: </strong>smithjd, Baloo, Frameworks<br /><strong>Cc: </strong>michaelh, ashaposhnikov, spoorun, nicolasfella, alexeymin<br /></div>