Simple search API proposal, take 2

Jean-Francois Dockes jean-francois.dockes at wanadoo.fr
Thu Jan 18 23:16:00 PST 2007


Mikkel Kamstrup Erlandsen writes:
 > About the Simple api:
 > 
 > Picking up on an "old" issue. There was semi-agreement that the properties
 > to be retrieved from a Query should be passed to GetHits, as GetHits(handle,
 > offset, limit, props).
 > 
 > Each time I look at this it makes me feel very weird. Are you guys sure this
 > is what we want? Think about stateless find/grep implementations, ultra
 > light search daemons... I would guess that at least some servers might
 > benefit greatly from knowing what fields to extract as soon as possible.

I believe that many servers don't need the metadata selection information
when preparing the query. In any case, they'll get it with the first
request for results, one d-bus handshake later, which is not going to make
any difference.

find/grep-like, backends might possibly use the information at once, but
they are not well suited to the simple api anyway. Because the arrival of
their results is typically slow and erratic, they're probably more suited
for an event based interface. In any case, even for them, it's just a
question of waiting for one more fraction of a millisecond before
starting. 

The current interface is nice and regular. The one you propose to get
around this non-problem is less so, and doesn't bring any significant
benefit IMHO. I'm quite ready to change my mind if someone comes up with a
real reason, but I just can't find any.

jf



 > To this end I re-propose to add the props list to the Query constructor.
 > Giving us an api like:
 > 
 >   Query (xml, props,handle)  --> handle
 >   GetHits (handle, offset, limit)  --> hits
 > 
 > The most obvious problem is that it leaves the Snippets to be retrieved
 > along side other properties - which we agreed on was a bad idea. Since each
 > hit is uniquely determined in a query context by its sequence number, we
 > could use that to look up additional hit metadata, fx. the snippet. Adding
 > API like so:
 > 
 >   GetHitMetadata (in s handle, in ai hits, in as props)  --> results
 > 
 > What do you guys say? If you decline again I shall accept it and hold my
 > peace regarding this issue. Cheers,
 > 
 > Mikkel



More information about the xdg mailing list