[Nepomuk] Strigi indexer in email feeder

Christian Mollekopf chrigi_1 at fastmail.fm
Mon Sep 26 21:17:11 UTC 2011


Hey,

In the email feeder we used to be leaving some indexing tasks up to strigi,
which was done by code like this:

KProcess proc;
proc.setOutputChannelMode( KProcess::ForwardedChannels );
proc.setProgram( KStandardDirs::findExe( "nepomukindexer" ); );
proc << "--uri" << url.url().toLocal8Bit();
proc << "--mtime" << QString::number( mtime.toTime_t() );
proc.start();
if ( proc.waitForStarted() ) {
  proc.write( data );
  proc.waitForBytesWritten();
  proc.closeWriteChannel();
}
proc.waitForFinished();

Now that I switched to the dms, I don't think forcing the uri works any 
longer.

One usecase for this is the indexing of attachments. Right now I'm only 
creating a Nepomuk::NCAL::Attachment, but don't know how to index the data 
with strigi. The attachment is just a QByteArray of data, so not a regular file 
in the filesystem. There is ncal:attachmentContent, but I don't know if that 
would result in the same.
The old version just forced an uri in the style of 
"akonadi:?item=123#attachmentName", when indexing the QByteArray with strigi.


The second usecase is the indexing of non plaintext messages. Here I have 
again the problem how to index the data (again a QByteArray) that it ends up 
being associated with the email, of which I don't know the resource uri yet 
because of the dms.
Also here, the old version was to force the uri of the indexed data to be the 
akonadi-uri of the email.

Any ideas how this could be done in a sane way?

Cheers,

Christian


More information about the Nepomuk mailing list