Tracker3 search Command-line expression syntax

Hello, with the tracker3 search command-line utility, what is the syntax of the expression arguments?

As far as I can tell, it’s not defined in the tracker-miners documentation.

Are these expressions simple full-text search terms, or are they fragments of SPARQL, or something else?

I was looking for a quick way of listing entries in the tracker index which are files with a certain path prefix.

Thanks

Hi Rodney,

The terms passed to tracker3 search are simple text terms, which are 'AND’ed together. You can pass --or to get them 'OR’ed together instead.

If you have time to contribute, it’d be nice to document this in the tracker3 man page. (which is defined here)

If you want to do more advanced stuff, you can use tracker3 sparql. You could try this to list entries with a certain path prefix:

tracker3 sparql --dbus-service org.freedesktop.Tracker3.Miner.Files -q \
  'SELECT ?url {
       ?r a nfo:FileDataObject ;
           nie:url ?url .
       FILTER (fn:starts-with(?url, "file:///home/sam/Music"))
    }'

It seems tracker3 search --or support is currently broken. It does still rely on the FTS syntax leaking through our own FTS support, but Tracker does no longer let FTS do that.

We don’t need FTS syntax for --or support, so a new issue to tracker-miners would be appreciated to fix it back.

Thanks for the info about the search syntax/sqlite FTS.

The sparql query works for me.

This topic was automatically closed 45 days after the last reply. New replies are no longer allowed.