Re: [Tracker] Tags, metadata and date fields

On 06/04/10 09:16, Ivan Frade wrote:

    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.

In addition, we added recently this command:

  tracker-miner-fs --eligible <file>

It will tell you if a file will be indexed and/or monitored.

  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. }'

You can also use tracker-search -t SEARCH (to list all documents and also to search using criteria 'SEARCH' for that document).

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:

For tagging examples also see src/tracker-utils/tracker-tag.c


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