[Xesam] Need paged search mode for xesam

Mikkel Kamstrup Erlandsen mikkel.kamstrup at gmail.com
Wed May 7 06:30:45 PDT 2008


2008/5/7 Jamie McCracken <jamie.mccrack at googlemail.com>:

>
> On Wed, 2008-05-07 at 12:37 +0200, Mikkel Kamstrup Erlandsen wrote:
>
> >
> >
> >         The current spec requires that the server keep a list of all
> >         uris
> >         mapped to hit ids somehow. Of you know the index will not
> >         change you
> >         can rerun the query.
> >
> >         There is no need to fetch  a single uri via GetHits. The
> >         HitsAdded
> >         signal tells you how many hits there. You do not have to use
> >         GetHits
> >         at all. If you use GetHitData exclusively for getting the
> >         data, you
> >         basically are paging.
> >
> >         So the current spec is fine for sequential access _and_
> >         paging.
> >
> > I would think so too - no matter what the conclusion on the
> > misunderstanding above is.
> >
> > I am still very open for discussions, but I have yet to see a
> > (realistic) use case where the current spec would fail. I think we
> > need a good use case and detailed spec of the suggested new API (what
> > it does in error conditions, is it correlated with GetHits sequential
> > access, does it use hit.fields or take requested fields as params -
> > like GetHitdata, etc).
>
> Well pls give example where I get all hit URI for results 100-110 for a
> search
>

Say you receive HitsAdded (search, 2768). If this is the first HitsAdded
this means that hits with ids 0..2767 are ready.

Now
  hits = GetHitData (search, [99, 100, ..., 109], [xesam:url])

This will give you an array of hits matching the hit_ids provided in the
method, each hit being an array of Values matching the field names you
requested (just xesam:url):
  hits = [
    [file:///home/mikkel/illegal_rip.mp3]
    [file:///home/mikkel/x-rated-III.avi]
    ...
    [file:///home/mikkel/pink_pony.jpg]
  ]

Cheers,
Mikkel
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.freedesktop.org/archives/xesam/attachments/20080507/b79bff42/attachment-0001.htm 


More information about the Xesam mailing list