Re: [Tracker] Integratin Tracker and Apple Spotlight



Hi Martyn,

2012/7/2 Martyn Russell <martyn lanedo com>:
Most use cases will be indexing and searching shored storage spaces
(volumes, shares) which are accessed by multiple users. Netatalk
creates distinct UNIX processes for every user session on the server,
running with the priviliges of the users UNIX account.

Can someone please give me a hint if and now this can be done with
Tracker? From what I've researched as of now (mostly checking the
available Tracker query API), Tracker is built around the assumption
of one Tracker instance per user. So I always just assumed that well,
let that user be root and index whatever I configure.


That's one way, though I wouldn't advise using root for that sort of thing
but a dedicated user instead (perhaps in teh same group)?

Yes, possibly once I've gotten my head around dbus and tracker. ;)
Until then I resorted to start a dbus session and tracker via a small
shell script:
---8<---
#!/bin/sh
eval `dbus-launch --sh-syntax
--config-file=/usr/local/netatalk/etc/dbus-session.conf`
echo "D-Bus per-session daemon address is: $DBUS_SESSION_BUS_ADDRESS"
nohup /usr/lib/tracker/trackerd &
---8<---

I've put a <listen> directive with a TCP address (127.0.0.1:12345) in
the dbus-session.conf so DBUS_SESSION_BUS_ADDRESS is a known value
which I can export to my a shell where I play with tracker-search and
putenv() to the environment of the relevant Netatalk process (afpd)
which will call tracker-sparql C API stuff.

Btw, we're now facing the interesting problem of translating Apple's
Spotlight query syntax to SPARQL. An example for a more complex
Spotlight query:

((true) && (((kMDItemResolutionHeightDPI < 72) && (_kMDItemGroupId =
13) && InRange(kMDItemContentModificationDate,360453600.000000,363132000.000000))))
&& ((* = "pic*"cdw || kMDItemTextContent = "pic*"cdw))

That's a search for a picture (_kMDItemGroupId 13) with a string "pic"
a the beginning of any metadata attribute or filename, changed within
the last 30 days (kMDItemContentModificationDate) and a resolution
smaller then 72 dpi.

We're looking for interested persons or companies who might be
interested in doing paid work on this. In case you're interested
please contact me off-list. Thanks!

-f



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