2007/3/13, jamie &lt;<a href="mailto:jamiemcc@blueyonder.co.uk">jamiemcc@blueyonder.co.uk</a>&gt;:<div><span class="gmail_quote"></span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
On Tue, 2007-03-13 at 21:56 +0800, Fabrice Colin wrote:<br>&gt; On 3/13/07, Mikkel Kamstrup Erlandsen &lt;<a href="mailto:mikkel.kamstrup@gmail.com">mikkel.kamstrup@gmail.com</a>&gt; wrote:<br>&gt; &gt; Please give <a href="http://freedesktop.org/wiki/WasabiSearchLive">
http://freedesktop.org/wiki/WasabiSearchLive</a> a<br>&gt; &gt; good look before we set this in stone. It is the last call if you have any<br>&gt; &gt; objections - I really mean it this time. Anything from critisizing the
<br>&gt; &gt; fundamental structure down to nitpicking on the session property names is<br>&gt; &gt; welcome.<br>&gt; &gt;<br>&gt; There&#39;s a couple of things I am not clear about :<br>&gt;<br>&gt; - &quot;search.blocking
 : Whether or not calls will block until the<br>&gt; requested items are available.&quot;<br>&gt; Do you really mean this ? Should NewSearch block ad vitam eternam if<br>&gt; there are no<br>&gt; results for the given query ? ;-)
<br>&gt;<br>&gt; - &quot;CountHits (in s search, out i count) Returns the current number of<br>&gt; found hits. If<br>&gt; search.blocking==true this call blocks until the index has been fully searched.&quot;<br>&gt; Shouldn&#39;t this read &quot;if 
search.live==false this call blocks...&quot; ?<br>&gt;<br>&gt; - &quot;These signals are only used if the session property search.blocking is true.&quot;<br>&gt; Again, shouldn&#39;t it be &quot;if search.live is true&quot; ?
<br>&gt;<br>&gt; - GetState<br>&gt; if the first string is &quot;FULL_INDEX&quot;, shouldn&#39;t the second string<br>&gt; always be &quot;100&quot; ?<br>&gt;<br>&gt; - signal HitsAdded<br>&gt; is count the number of new hits, or the new number of hits ? I assume the latter
<br>&gt; since the example at the bottom shows a call to &quot;GetHits(session, count)&quot; after<br>&gt; receiving &quot;HitsAdded(count)&quot;.<br>&gt;<br>&gt; - signal StateChanged<br>&gt; An example would be welcome here. For indexers that monitor sources, eg monitor
<br>&gt; the filesystem with inotify, the state will switch between UPDATING<br>&gt; and IDLE and/or FULL_INDEX very often. Is the indexer supposed to send<br>&gt; a signal every time ?<br>&gt;<br>&gt; - properties and field names
<br>&gt; You may want to clarify what differences, if any, there are between<br>&gt; properties and<br>&gt; field names.<br>&gt;<br><br>On top of all that if this API were to be usable in our tracker GUI we<br>would need the following:
<br><br>1) in tracker the service type being searched is mandatory - I would<br>prefer it to be a session property or even better a param in the<br>NewSearch method. If it remains part of the xml then that bit should be<br>
mandatory in the xml schema/dtd</blockquote><div><br>Having it in a session property seems really odd, since it seems a natural part of the query (ie. the query also contains &quot;what to query&quot;). Putting it in a param to NewSearch also is not biggest desire since the current approach where you only need a session and a query to start a search is very clean. Currently a query is &quot;self-contained&quot; - doesn&#39;t require anything else to be runnable, if it required additional info to be useful, then that is a drawback (in my head atleast).
<br><br>Making &quot;type&quot; a mandatory attribute on the query element could be fine by me. I just fail to see the problem in defaulting to all. It would not only be slow, but also undefined in which objects you search. But why not allow it for convenience? It wouldn&#39;t require much documentation to explain this.
<br></div><br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">2) GetHits/GetHitData<br><br>There are two use cases as far as tracker goes:<br>
<br>a ) if i need metadata for all hits then it will always be quicker to<br>have them in GetHits<br><br>b) for things like our tile we need to fetch extra metadata for a single<br>hit so GetHitData would only ever be used for a single hit not multiple
<br>ones - would be easier for us if that was changed to:<br><br>GetHitData (in s ID, in as fields out av values)<br><br>(I cant think of a single case where we would want to get metadata<br>*separately* for more than one hit at a time)
</blockquote><div><br>Well, the trick is that GetHitData is also used when you receive a HitsModified signal. Then you re-fetch&nbsp; metadata for all the hit-ids. Consider the case where I move a directory and I have 50 files inside it all giving me matches (this will fire a HitsModified since moving files just amount to changing the uri field of the hit).
<br>&nbsp;</div><br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">3) for separate snippets we would like to include a max length of the<br>returned snippet so I&#39;m not sure if a dedicated call for this would be
<br>better? Might not matter for a general purpose API like Wasabi?</blockquote><div><br><br>Well, generally Wasabi is designed around &quot;sane defaults&quot; (in many places atleast). Wouldn&#39;t it suffice to return a &quot;sanely sized&quot; snippet and let the UI trim it to an appropriate size?
<br></div><br><br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">I dont think we can freeze the api until we have a working<br>implementation (which may uncover the need for more changes) - I plan on
<br>implementing it in tracker next month.</blockquote><div><br><br>I agree, and that&#39;s also why I have not&nbsp; pressed harder on this.&nbsp;  I&#39;m working on some Python gobject bindings+tools to help test Wasabi services. They will also include a dummy server implementation. Having a real service to search against would be really nice ofcourse :-)
<br></div><br><br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">things still blocking implementation:<br><br>1) list of applicable metadata names - I would suggest a mandatory set
<br>(IE metadata supported by all) and an optional set (this would always<br>return NULL if not supported)<br><br>2) list of applicable service types (emails, files, conversations etc)</blockquote><div><br><br>I deliberately didn&#39;t push this debate much lately because I wanted to hear what the Nepomuk guys had to say about this. Now that I know that they are open to having the Wasabi metadata fields map to their fully sematic types I think it should be safe to move on. - But yes, we are really starting to need this.
<br></div><br><br><br>Cheers,<br>Mikkel<br></div>