[Kde-pim] ItemFetchJob - Only fetching items which have a payload

Vishesh Handa me at vhanda.in
Thu May 23 20:25:45 BST 2013


On Thu, May 23, 2013 at 11:52 PM, Kevin Krammer <krammer at kde.org> wrote:

> On Thursday, 2013-05-23, Vishesh Handa wrote:
> > Hey guys
> >
> > In the Akonadi Nepomuk Feeder we have this ItemFetchJob which fetches all
> > the items in a collection, and then sends them for indexing if they
> aren't
> > already indexed.
> >
> > The problem is that many of these items often do not have a payload, so
> > when we try to fetch the payload in order to index its contents, the
> fetch
> > fails. This skews the progress and results in the akonadi feeder
> attempting
> > to fetch a large number of payload-less items on startup.
> >
> > Is there any way to only fetch the items which have a payload in a cache,
> > but not fetch the actual payload?
>
> Not sure I understand you correctly, but are you looking for
> Item::cachedPayloadParts()?
>

No. That doesn't seem to give me what I want.

I basically have 6014 items which do not have any data in their RFC822 data
field


I got the number by executing this query - "select count(*) from parttable
where data is null". When I try to fetch any of these 6014 emails it
complains that there is no payload. The debug messages look like this -


210405 no payload
210404 no payload
210403 no payload
210402 no payload
210401 no payload
210340 no payload
210337 no payload
210289 no payload
210288 no payload
210287 no payload
210286 no payload
210285 no payload
210284 no payload
210283 no payload
210282 no payload
210281 no payload


But these items are still returned by the ItemFetchJob even with
cachedPayloadParts(true) or fetchFullPayload(true)


I do not want these items to be returned.



> Cheers,
> Kevin
> --
> Kevin Krammer, KDE developer, xdg-utils developer
> KDE user support, developer mentoring
>
> _______________________________________________
> 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/
>



-- 
Vishesh Handa
_______________________________________________
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