&gt;You give up any hope of implementing sorting (explicit or using relevance).<br><br>I think if we allways block iterator.next() until we have at least a value of each node , we can apply sort in this values (since every node already made this). That&#39;s what you said, Navin?<br>

<br><div class="gmail_quote">On Wed, Sep 15, 2010 at 8:16 AM, Navin Surtani <span dir="ltr">&lt;<a href="mailto:nsurtani@redhat.com">nsurtani@redhat.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">

Isn&#39;t that an issue that comes with lots of hits in a lazyIterator anyway?<br>
<br>
I mean, if you&#39;re only going to load up a &#39;few hits at a time&#39; then you<br>
can in theory only sort the few hits that you have loaded up anyway<br>
right? :S<br>
<div><div></div><div class="h5"><br>
On 15/09/10 12:01, Emmanuel Bernard wrote:<br>
&gt; You give up any hope of implementing sorting (explicit or using relevance).<br>
&gt;<br>
&gt; On 15 sept. 2010, at 12:16, Manik Surtani wrote:<br>
&gt;<br>
&gt;&gt; How about something like:<br>
&gt;&gt;<br>
&gt;&gt; - Broadcast the query<br>
&gt;&gt; - Every node creates the QueryHits inst, runs the query and collects<br>
&gt;&gt; results. Starts streaming the results back immediately.<br>
&gt;&gt; - The lazy iterator returns to the user immediately, and maintains an<br>
&gt;&gt; internal cache of results coming in from N remote QueryHits instances<br>
&gt;&gt; - iterator.next() blocks until this cache has available entries to return.<br>
&gt;&gt; - on an implementation level, the GetHItsCommand (or something like<br>
&gt;&gt; that) could return with a single hit, or N hits, with a flag of<br>
&gt;&gt; whether more hits are available or not.<br>
&gt;&gt;<br>
&gt;&gt; Does that help?<br>
&gt;&gt;<br>
&gt;&gt; Manik<br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt; On 14 Sep 2010, at 20:46, Israel Lacerra wrote:<br>
&gt;&gt;<br>
&gt;&gt;&gt; Hi guys,<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; I&#39;m still thinking about it, but I don&#39;t have a really good idea<br>
&gt;&gt;&gt; about the lazy iterator yet. The only way (that I see) I could make<br>
&gt;&gt;&gt; it more lazily is:<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; - Broadcast the query.<br>
&gt;&gt;&gt; - Every node creates a QueryHits instance with the query and keep it<br>
&gt;&gt;&gt; in a simple little cache (array, hash, etc)<br>
&gt;&gt;&gt; - A &quot;state&quot; of the query is created and every lazyIterator.next()<br>
&gt;&gt;&gt; must send a command to a node and get the next hit (the next key).<br>
&gt;&gt;&gt; - After a certain time, the instances of queryHits &quot;dies&quot;.<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; It seems to me that this is not too efficient. But I don&#39;t have any<br>
&gt;&gt;&gt; other ideas.<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; Do you have any suggestions about it?<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; thanks!<br>
&gt;&gt;&gt; Israel<br>
&gt;&gt;&gt;<br>
<br>
<br>
</div></div>--<br>
<div><div></div><div class="h5">Navin Surtani<br>
Intern Infinispan<br>
_______________________________________________<br>
infinispan-dev mailing list<br>
<a href="mailto:infinispan-dev@lists.jboss.org">infinispan-dev@lists.jboss.org</a><br>
<a href="https://lists.jboss.org/mailman/listinfo/infinispan-dev" target="_blank">https://lists.jboss.org/mailman/listinfo/infinispan-dev</a><br>
</div></div></blockquote></div><br>