I’ve been working with desktop search solutions, and I’ve determined through a great deal of perspiration that strigi seems to be the only Linux based desktop search engine that reliably indexes the majority of files that I’m interested in searching (Microsoft Office, Open Office, and files containing RF822 compliant email).

While the core engine for strigi might be the best I found, the client interface and tools leave a great deal to be desired.  In fact, to really figure out how to use strigi I needed to download and peruse the source.

In the source I found an elegant command line Perl script ( which demonstrated how to submit queries to strigi through a Linux socket.  The script was easy to port over to PHP5, and in doing so I added some enhancements in my core routines to make it easier to use to write a search client — that is I organized the results as array elements so that I could easily manipulate them rather than needing to attempt to parse them apart.

I haven’t gone any further than just writing some basis PHP5 functions and a harness that drives it from the command line; but I’m posting the code for others.  Just run the script from the command line, and provide the query as arguments (if the query has a space, make sure you enclose it in quotes — and you can put multiple queries on the command line as well).

Running the program and seeing the dump of the data is by far the easiest way to understand what I’ve done.