Spotlight support

Ralph Böhme rb at
Thu Apr 10 11:18:57 MDT 2014

Hi David

On Thu, Apr 10, 2014 at 02:33:52PM +0200, David Disseldorp wrote:
> On Thu, 10 Apr 2014 13:42:48 +0200, Ralph Böhme wrote:
> > Samba acts as a proxy fowarding search queries to Gnome Tracker after
> > mapping Apple's Spotlight query language to SPARQL.
> Oh, I naively thought that Spotlight made use of the Windows Search
> Protocol (MS-WSP) to query the remote indexing service. Skimming through
> the code it looks like a separate named pipe (mdssvc) is used, with
> presumably a different protocol.

You bet!

> How does Apple's protocol differ?

Completely. :)

Not being familiar with MS-WSP I can't comment on that, but Apple's
implementation is something like binary-SML-RPC (Spotlight Markup
Language, just invented the name :).

A search request when unmarshalled from binary to text format looks
like this: <>

The search string is "kMDQueryString" which in above case was:


I'm using a flex/bison generated parser that translates this into
SPARQL which is then fed to Tracker.

So the nice thing is, it's all text. The bad thing is, ...

> Is it at all documented?'s completey undocumented. :)

> > Comments welcome :-)
> I'll take a closer look in the coming days. Just a comment from
> skimming through: please avoid the macros added with
> They're generally frowned upon, as they affect control-flow (by jumping
> a magic label), and also rely on externally defined variables.

they're actually local variables and imo well defined and consistent
error checking is the best thing since sliced break. :) Anyway, I'm
not eager to introduce this idiom and can exchange that for explicit


SerNet GmbH, Bahnhofsallee 1b, 37081 Göttingen
phone: +49-551-370000-0, fax: +49-551-370000-9
AG Göttingen, HRB 2816, GF: Dr. Johannes Loxen,

More information about the samba-technical mailing list