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