[Owncloud] Trackerd based server side search app

Jörn Friedrich Dreyer jfd at butonic.de
Fri Apr 6 03:15:47 UTC 2012


Hi all,

after scratching my itch of server side searching I cleaned up the
code a bit, removed /most/ hardcoded paths and commited a shiny new
app to github: https://gitorious.org/~butonic/owncloud/butonics-owncloud

On the one hand, the installation is fairly easy on a ubuntu system
(running precise):

# install trackerd and pear
sudo apt-get install tracker php5-pear
# use pecl to install the php dbus extension
sudo pecl install dbus-beta
# activate the dbus extension
sudo echo "extension=dbus.so" > /etc/php5/conf.d/dbus.ini
# restart apache
sudo service apache2 restart

On the other hand, running the app is a little more ... hackerish and
I admit: it needs some more love to make it end user ready, so
consider it EXPERIMENTAL!
Before using the app, we need to run a shell script that brings up a
dbus-daemon and starts a headless version of trackerd:

# open a screen session
screen
# become your webserver user
sudo su www-data
# change into the trackerd_search app directory
cd /var/www/owncloud/apps/trackerd_search
# or cd /home/yourhomedir/public_html/owncloud/apps/trackerd_search
# manually fix the OC_CONFIG_DATADIRECTORY in the trackerd_headless.sh
script. I could propably generate that script when first running
owncloud
vi trackerd_headless.sh
# run it
sh trackerd_headless.sh
# it should now start a dbus-daemon for our trackerd communication,
bring up the tracker store and launch our tracker-miner. It should
auto create any directories and files and start indexing. Maybe you
need to configure the indexed paths:
vi /var/www/owncloud/data/trackerd_search/config/tracker/tracker-miner-fs.cfg

If you are lucky you will now be able to search through your file
contents and meta information by using the standard search field of
owncloud with the power of a desktop search engine.
Fixing problems requires a bit of knowledge about dbus and trackerd
... or time on my side, which is kinda scarce at the moment as I am
writing my PhD.
If you want to kill the processes do not forget to also kill the dbus
daemon running for www-data:

$ ps axu | grep tracker | grep www-data | grep -v grep
www-data  9235  0.0  0.0  24040  1500 ?        Ss   03:23   0:00
dbus-daemon --config-file=session.conf
--address=unix:path=/pth/to/your/owncloud/data/trackerd_search/owncloud_trackerd_dbus_socket
--fork
www-data  9236  0.0  0.0 323260  8764 pts/1    Sl   03:23   0:00
/usr/lib/tracker/tracker-store
www-data  9248  0.0  0.0 325720  8504 pts/1    SNl  03:23   0:00
/usr/lib/tracker/tracker-miner-fs

The plugin itself is only about 160 LoC. I do have some plans for the
plugin but I wanted to let others try it out and hopefully provide a
starting point for a useful server side search. The php / dbus /
tracker hack was originally inpired by providing a sever side search
for a samba share but that also requires a browser plugin or
configuration hack to circumvent the same origin policy for file://
urls. Nevertheless, clicking links in the browser and having them open
files on a mounted webdav share is really nice ...

Anyway, I'm tired ...

so long, feedback welcome

Jörn


--
A. Because it breaks the logical sequence of discussion
Q. Why is top posting bad?



More information about the Owncloud mailing list