2008/5/6 Jamie McCracken &lt;<a href="mailto:jamie.mccrack@googlemail.com">jamie.mccrack@googlemail.com</a>&gt;:<br><div class="gmail_quote"><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
you mean pull results over dbus and then page at client?<br>
</blockquote><div><br>No. The signature of GetHitData is (in s search_handle, in au hit_ids, in as fields, out aav hits)<br><br>Ie you request which hits ids to fetch. To fetch a page pass [n, n+1, ..., n+page_size] as hit_ids.<br>
&nbsp;</div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><br>
thats inefficient - pulling 10,000 hits over dbus is insanely slow (even<br>
just the URI)<br>
</blockquote><div><br>Hmmm, how slow is &quot;insanely slow&quot;? I doubt that this is true (by my standards of insanely slow).<br>&nbsp;</div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<br>
Paging is a must have im my book otherwise tracker api will have to be<br>
used a lot instead of xesam whenever paged results are desired (more<br>
likely we will add Paged search to xesam on top of the standard)<br>
<font color="#888888"></font></blockquote><div><br>With a seekable API paging is easy to implement on the client.<br>&nbsp;<br>Cheers,<br>Mikkel<br><br></div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<font color="#888888"><br></font><div><div class="Wj3C7c"><br>
On Tue, 2008-05-06 at 17:12 +0200, Mikkel Kamstrup Erlandsen wrote:<br>
&gt; 2008/5/6 Jamie McCracken &lt;<a href="mailto:jamie.mccrack@googlemail.com">jamie.mccrack@googlemail.com</a>&gt;:<br>
&gt;<br>
&gt;<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; On Tue, 2008-05-06 at 16:57 +0200, Mikkel Kamstrup Erlandsen<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; wrote:<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; &gt; 2008/5/2 Mikkel Kamstrup Erlandsen<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; &lt;<a href="mailto:mikkel.kamstrup@gmail.com">mikkel.kamstrup@gmail.com</a>&gt;:<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; &gt; &nbsp; &nbsp; &nbsp; &nbsp; I have a handful comments about this (Jos also asked<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; about the<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; &gt; &nbsp; &nbsp; &nbsp; &nbsp; same on<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; &gt; &nbsp; &nbsp; &nbsp; &nbsp; IRC recently).<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; &gt; &nbsp; &nbsp; &nbsp; &nbsp; It was in fact a design decision, but i am writing<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; this from<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; &gt; &nbsp; &nbsp; &nbsp; &nbsp; my mobile<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; &gt; &nbsp; &nbsp; &nbsp; &nbsp; since I&#39;m on holiday, so I&#39;ll elaborate when I get<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; home<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; &gt; &nbsp; &nbsp; &nbsp; &nbsp; tuesday.<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; &gt;<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; &gt; &nbsp; &nbsp; &nbsp; &nbsp; Cheers,<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; &gt; &nbsp; &nbsp; &nbsp; &nbsp; Mikkel<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; &gt;<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; &gt; As promised...<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; &gt;<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; &gt; Let&#39;s first establish some terminology. A Paged Model is one<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; where you<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; &gt; can request hits with an offset and a count. A Streaming<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; Model is one<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; &gt; like we have now, where you specify how many hits to read on<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; each<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; &gt; request and then read hits sequentially (like file reading<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; without<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; &gt; seeking).<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; &gt;<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; &gt; It should be noted that the Xesam Search spec is designed<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; for desktop<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; &gt; search (and not generic search on a database or Google-style<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; web<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; &gt; search with millions of hits). Furthermore it should be<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; feasible to<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; &gt; implement in a host of different backends, not just full<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; fledged<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; &gt; search engines.<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; &gt;<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; &gt; There are basically three backends where a paged model can<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; be<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; &gt; problematic. Web services, Aggregated searches, and<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; Grep/Find-like<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; &gt; implementations.<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; &gt;<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; &gt; &nbsp;* Web services. While Google&#39;s GData Query API does allow<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; paging, not<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; &gt; all webservices does this. For example the OAI-PMH[1]<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; standard does<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; &gt; not do paging, merely sequential reading. Ofcourse OAI-PMH<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; is a<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; &gt; standard for harvesting metadata, but I could imagine a<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; &quot;search<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; &gt; engine&quot; extracting metadata from the OAI-PMH result on the<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; fly.<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; &gt;<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; &gt; &nbsp;* Aggregated search. Consider a setup where the Xesam<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; search engine<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; &gt; is proxying a collection of other search engines. It is a<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; classical<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; &gt; problem to look up hits 1000-1010 in this setup. The search<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; engine<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; &gt; will have to retrieve the first 1010 hits from all<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; sub-search engines<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; &gt; to get it right. Maybe there is a clever algorithm to do<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; this &nbsp;more<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; &gt; cleverly, but I have not heard of it. This is ofcourse also<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; a problem<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; &gt; in a streaming model, but it will not trick developers into<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; believing<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; &gt; that GetHits(s, 1000, 1010) is a cheap call.<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; &gt;<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; &gt; &nbsp;* Grep-like backends or more generally backends where the<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; search<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; &gt; results will roll in sequentially.<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; &gt;<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; &gt; I think it is a bad time to break the API like this. It is<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; in fact a<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; &gt; quite big break if you ask me, since our current approach<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; has been<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; &gt; stream-based and what you propose is changing the paradigm<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; to a page<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; &gt; based model. Also bad because it is the wrong signal to send<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; with such<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; &gt; and important change in the last minute.<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; &gt;<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; &gt; I see a few API-stable alternatives though.<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; &gt;<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; &gt; 1) Add a SeekHit(in s search, in i hit_id, out i new_pos).<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; This<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; &gt; basically adds a cursoring mechanism to the API<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; &gt; 2) In style of 1) but lighter - add SkipHits(in s search, in<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; i count,<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; &gt; out i new_pos)<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; &gt;<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; &gt; These options also stay within the standard streaming<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; terminology. We<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; &gt; could make them optional by making them throw exceptions if<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; the (new)<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; &gt; session property vendor.paging is True.<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; &gt;<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; &gt; As Jos also points out later in the thread GetHitData is<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; actually<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; &gt; paging and the workaround he describes can actually be made<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; very<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; &gt; efficient since we already have the hit.fields.extended<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; session prop<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; &gt; to hint what properties we will fetch.<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; &gt;<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; &gt; Let me make it clear that I am not refusing the change to a<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; paging<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; &gt; model if that is what the majority rules. We should just<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; make an<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; &gt; informed decision that we are sure we agree on.<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; &gt;<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; im proposing adding new api not breaking existing ones. The<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; existing<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; stuff can easily emulate paging if it lacks native support<br>
&gt;<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; I would prefer new api that takes a start point param and a<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; count/length<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; param sow e have full random access<br>
&gt;<br>
&gt; And how is GetHitData not good enough for that?<br>
&gt;<br>
&gt; Cheers,<br>
&gt; Mikkel<br>
&gt;<br>
<br>
</div></div></blockquote></div><br>