[Kde-pim] akonadi indexing agent: Where does it check on what folders to index?

Daniel Vrátil dvratil at kde.org
Thu Feb 11 12:27:56 GMT 2016


On Thursday, February 11, 2016 1:21:12 PM CET Martin Steigerwald wrote:
> Am Donnerstag, 11. Februar 2016, 13:08:19 CET schrieb Daniel Vrátil:
> > On Thursday, February 11, 2016 12:22:29 PM CET Martin Steigerwald wrote:
> > > (asking new devel related questions here instead of continuing on
> > > kdepim-
> > > users)
> > > 
> > > Hello!
> > 
> > Hi!
> > 
> > > I am trying to get a clue on where it selects which folders to index?
> > > For
> > > my huge maildir it can help to tell it not to index the large LKML
> > > folders and some other large folders, and there is setting in KMail
> > > folder properties for that in the maintenance tab. "Enable full text
> > > indexing" which I disabled for the LKML folders.
> > > 
> > > I am not sure whether Akonadi indexing agent actually uses that setting
> > > tough.
> > 
> > Indeed the agent completely ignores the settings :(
> 

<snip>

> > 
> > All you need to do is to check whether a collection has
> > Akonadi::IndexPolicyAttribute set and what's the value of
> > indexingEnabled().
> > 
> > One part is adding the check to Scheduler::scheduleCollection, as you
> > already found.
> 
> I think I could have a go at this first.
> 
> > The other part is little more tricky, because we also want
> > to ignore changes happening to and within those Collections, like renaming
> > the Collection or new Item being added or Item being changed (marked as
> > read, etc. etc). Right now we just get the changed or new Item/Collection,
> > and index it straight away.
> 
> Is that stuff like:
> 
> 180 void Index::index(const Akonadi::Collection &collection)
> 181 {
> 182     if (m_collectionIndexer) {
> 183         m_collectionIndexer->index(collection);
> 184         m_collectionIndexer->commit();
> 185     }
> 186     qCDebug(AKONADI_INDEXER_AGENT_LOG) << "indexed " << collection.id();
> 187 }
> 188
> 189 void Index::change(const Akonadi::Collection &col)
> 190 {
> 191     if (m_collectionIndexer) {
> 192         m_collectionIndexer->change(col);
> 193         m_collectionIndexer->commit();
> 194     }
> 195 }
> 
> in "index.cpp" – also move and remove of course. What else?

I think it might be better to implement that on a "lower" level, directly in 
AkonadIndexingAgent (agent.cpp). All the methods that handle changes are 
itemAdded, itemChanged, itemFlagsChanged, itemRemoved, itemMoved, 
collectionAdded, collectionChanged, collectionRemoved and collectionMoved.

This way you can discard the Item/Collection without it even entering the 
actual indexing system (Index).

Dan

> 
> Thanks,


-- 
Daniel Vrátil
www.dvratil.cz | dvratil at kde.org
IRC: dvratil on Freenode (#kde, #kontact, #akonadi, #fedora-kde)

GPG Key: 0x4D69557AECB13683
Fingerprint: 0ABD FA55 A4E6 BEA9 9A83 EA97 4D69 557A ECB1 3683
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: This is a digitally signed message part.
URL: <http://mail.kde.org/pipermail/kde-pim/attachments/20160211/4de9d87e/attachment.sig>
-------------- next part --------------
_______________________________________________
KDE PIM mailing list kde-pim at kde.org
https://mail.kde.org/mailman/listinfo/kde-pim
KDE PIM home page at http://pim.kde.org/


More information about the kde-pim mailing list