LOL--nicely done!
All searches in gnutella as far as I know, are
ANDS, though Acquisition for OSX used to be able to filter the results display.
I can't help on the code behind the 'document type' searches, but including the extensions as part of the 'all types' searches seems to work best, since the more specific the search the better it works.
Cheers