Re: [Tracker] Tags, metadata and date fields



Hi,
However, I wasn't really able to find any information on how to get the
metadata into my index in the first place. Could you give me some
information where to start? Do I move the documents into a
tracker-watched folder and manually modify the database after the
documents have been indexed? Or do I explicitly ask tracker to add a
specific file with specific metadata to the index? Or do I add the
metadata as extended attributes of the file and put it in a watched
folder? Or something else entirely?

 Check ~/.config/tracker/tracker-miner-fs.cfg file to know/configure what directories is tracker watching. Either you move your files to any of those locations, or you add your documents path there.

 Wait for tracker to index that folder (tracker-status should show the progress), and then run a query with:

 tracker-sparql -q 'SELECT ?u ?f WHERE ?f a nfo:TextDocument; nie:url ?u. }'

 ?u is the location (the usual "path" of the file) and ?f is a tracker URL. Then you can run:

tracker-info [tracker URL] and see what tracker knows about that file. Check that all the data coming from the file is there.

Now, if you want to add more information (like your tags or some custom date), you need to insert it from your program in tracker. To do that there is a command line tool (tracker-sparql -u ) or by code using the DBus API. Here is an example in python. It contains more things, but it is not difficult to extract the bits you need:

http://git.gnome.org/browse/tracker/tree/examples/rss-reader/tracker_backend.py

Regards,

Ivan



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