<br><br><div><span class="gmail_quote">2006/11/26, Kevin Krammer <<a href="mailto:kevin.krammer@gmx.at">kevin.krammer@gmx.at</a>>:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
On Sunday 26 November 2006 18:17, Jean-Francois Dockes wrote:<br>> Jos van den Oever writes:<br>> > 2006/11/26, Jean-Francois Dockes <<a href="mailto:jean-francois.dockes@wanadoo.fr">jean-francois.dockes@wanadoo.fr
</a>>:<br>> > > 1- A need for trivial enabling of text search in any (non-search)<br>> > > application, with minimal fuss, (better described by Fabrice in<br>> > > the quoted message).
<br>> ><br>> > For this, we also need a way to search in documents that have not been<br>> > indexed. Indexes can take up a lot of space and the user might not<br>> > want to have an index of all her data, but still want to search that
<br>> > data now and then.<br>> > Since searching in this way is a lot slower, there would need to be a<br>> > more asynchroneous method of reporting the search results.<br>><br>> I'm not a d-bus expert, but at least with the qt4 bindings, it seems that
<br>> you have a choice of waiting for the reply to a d-bus message, or be called<br>> later when it arrives. There doesn't seem to be anything inherently<br>> synchronous in d-bus, so I would imagine that other bindings or adaptors
<br>> have similar capabilities.<br><br>Technically correct, this is a feature of the low-level D-Bus library.<br><br>However this is a different use case.<br><br>The asynchronous D-Bus call is for getting _the_ result later.
<br><br>The use case discussed here is slightly different (unless I am<br>misunderstanding) it is about returning _some_ results later.<br><br>Example: a user searches through a lot of emails. The program should be able<br>
to display results as soon as possible. At this point the results do not need<br>to be complete, matches can trickle in when found.<br><br>An asynchronous call would still have to wait for all results, i.e. a<br>completed query. The user would have to wait for the slowest match.
<br><br>An option would be to have the initial query call return a query identifier<br>instead of results and results would be transported by D-Bus signals using<br>this identifier as a reference.<br><br>A bonus would be to have the possibility of cancelling a query using this
<br>identifier. The user might already have found what they were looking for and<br>cancel the search operation in their program. An ongoing searching operation<br>would not be a problem for the program (it can just ignore any further
<br>results), but it could be hard to explain to a user why their harddisk keeps<br>accessing files like mad.</blockquote><div><br>I think you raise a really good question Kevin. Let me first introduce some terminology to ease the communication.
<br><br>Page Query: All results for a given query is returned in one chunk. This call is still *async* since it is over dbus. This is how it is sugegstedin on the WasabiDraft wiki page.<br><br>Async Query: Query results trickle in as the search engine picks them up. Ie all query results are not returned in one batch.
<br></div><br>In the page query the client can simulate an async query by requesting several blocking queries with the same query string, but different page-ranges. This gives a small problem with page ordering, but nothing that the client app could not work around. The big benefit for page queries is that server side sorting (score, relevance, date, whatever) is a no-brainer for the client. Just append the "sort:<sorttype>" switch to the query string.
<br><br>In the async query you have a sorting problem. The client cannot sort the hits, unless each returned URI also has metadata associated with it (it looks this stuff up with another dbus call). I see a huge benefit in allowing the results to trickle in (and allows for canceling queries as Kevin points out). The async query is also much more suitable for live queries (in the sense of updating the query when the on-disk files change - or are deleted/created).
<br><br>So what do I think? I see 2 options:<br><br>1) Change the Query method name to PageQuery and add another AsyncQuery with a signature and behavior we need to think a bit about.<br><br>2) Don't change the org.freedesktop.search.simple
interface, but create another interface generally aimed at live queries - or maybe include this in the "advanced" search interface when we get to defining that.<br><br>I don't really know what I like/dislike the most... Any other ideas, or comments, will be highly appreciated :-)
<br><br>Cheers,<br>Mikkel <br><br><br></div><br>