Re: [Tracker] Using tracker extractors from other applications



On 17/11/10 00:02, Nikolaus Rath wrote:
Hello,

Hi,

I would like to use tracker's apparently quite extensive data-extraction
facilities in my own program. It seems that "tracker-extract -f<file>"
provides all the functionality that I want, but I am wondering if there
is a way to avoid having to re-parse output.

The -f command line is a convenience for testing. There is a d-bus API you can use which tracker-miner-fs uses, for the spec see:

http://git.gnome.org/browse/tracker/tree/data/dbus/tracker-extract.xml

For examples, see how miner-fs uses it:

http://git.gnome.org/browse/tracker/tree/src/miners/fs/tracker-miner-files.c#n2045

I should add, we use the "Fast" interface, which uses file descriptor passing to avoid memory fragmentation and copious copying. There is also a non-fast API you can use for testing purposes or if you're not intending to send/receive a lot of requests anyway (though we discourage it generally if possible).

Is there a way to talk to tracker-extract via the DBUS API and e.g. tell
it to return just the nie:plainTextContent attribute? Or some secret,
undocumented command line option?

You can't ask for just one attribute no, you will have to filter that for the moment.

It would also be nice if there would be a way to process multiple files
without having to start a new tracker-extract instance for every file.

Using d-bus you shouldn't need to worry about the invocation of tracker-extract.

Happy to help,

--
Regards,
Martyn



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]