There's a problem with Search.Text not returning enough results when I
supply a service other than 'Files'.  I'm attaching a test program
that:

1. Searches for $input with serivce='Files' and returns the first 256 results.
2. Calls Files.GetServiceType on each result and counts the number of
'Images' occurances.
3. Searches for $input with service='Images' and returns the first 20 results.
4. Print the number of results returned.

For example:
#  ./search_by_service.py duffy
Searching for duffy in the "Files" service...
Found 135 images
Searching for duffy in the "Images" service...
Found 7 images

So, I have 135 matches for files in the 'Images' service, but when I
request 20 I only get 7 back.

On 9/26/06, Jamie McCracken <[EMAIL PROTECTED]> wrote:
Edward Duffy wrote:
> Looks like its working. One more bug in the image thumbnails, nice is
> missing '-n' before the niceness.  Patch attached (I can handle this
> one!).
>

thanks - fixed in cvs

--
Mr Jamie McCracken
http://jamiemcc.livejournal.com/

#!/usr/bin/env python

import dbus
import sys
import os

bus = dbus.SessionBus()
obj = bus.get_object('org.freedesktop.Tracker',
                     '/org/freedesktop/tracker')
Files = dbus.Interface(obj, 'org.freedesktop.Tracker.Files')
Search = dbus.Interface(obj, 'org.freedesktop.Tracker.Search')

print 'Searching for %s in the "Files" service...' % sys.argv[1]
results = Search.Text(-1, 'Files', sys.argv[1], 0, 256, False)
image_count = 0
for f in results:
   if Files.GetServiceType(f) == 'Images':
      image_count += 1
print 'Found %d images' % image_count
print 'Searching for %s in the "Images" service...' % sys.argv[1]
results = Search.Text(-1, 'Images', sys.argv[1], 0, 20, False)
print 'Found %d images' % len(results)
_______________________________________________
tracker-list mailing list
[email protected]
http://mail.gnome.org/mailman/listinfo/tracker-list

Reply via email to