Simple search API proposal, take 2

Jamie McCracken jamiemcc at blueyonder.co.uk
Thu Jan 11 13:52:30 PST 2007


Mikkel Kamstrup Erlandsen wrote:
> 2007/1/11, Jamie McCracken <jamiemcc at blueyonder.co.uk>:
>> Joe Shaw wrote:
>> > Hi,
>> >
>> > On Thu, 2007-01-11 at 11:48 +0100, Mikkel Kamstrup Erlandsen wrote:
>> >> Query (in s query_string, in as requested_properties, out s 
>> query_handle)
>> >
>> > Is the idea here that the query will actually be run when Query is
>> > called, or is there just some server-side preparation for it?
>>
>> just prep I hope - the idea is it will return a query handle for use in
>> other methods
>>
>> >
>> >> CountHits (in s query_handle, out i count)
>> >>
>> >> GetHitProperties (in s query_handle, in i offset, in i limit, out
>> >> a{sa{sas}} response )
>> >
>> > Then these calls would be racy, because the index could change between
>> > calls.  I believe you want the query to run on demand, however, because
>> > of the limit passed in.
>>
>> yes this should run the query
>>
>> although its actually now:
>> GetHitProperties ( in s query_handle, in i offset, in i limit, in as
>> properties, out a{sa{sas}} response )
>>
>> see page:
>> http://wiki.freedesktop.org/wiki/WasabiSearchSimple
>>
>> note the extra properties field where you pass an array of metadata
>> field names you want returned
> 
> 
> There are two GetHitProperties method signatures mixed up here.
> Magnus' original take 2 proposal was :
> 
> Query (in s query_string, out i query_handle)
> GetHitProperties ( in s query_handle, in i offset, in i limit, in as
> properties, out a{sa{sas}} response )
> 
> I suggested that it was changed to :
> 
> Query (in s query_string, in as properties, out i query_handle)
> GetHitProperties ( in s query_handle, in i offset, in i limit, out
> a{sa{sas}} response )
> 

I prefer Magnus's version. There is nothing to be gained from having it 
in the query object as far as I can tell?

> - allowing the search engine to know which fields to look up as early
> as possible. It has the drawback of mixing bad with snippets, hence I
> suggested re-instatting the GetSnippets method for this.
> 
> 
>> the only thing I dont like is snippets now being a property in the above
>> - I would want to get these individually and I suspect likewise for 
>> Beagle?
>>
> 
> I also suggested this a few mails back in this thread.

yeah sorry was paying more attention to the wiki
> 
>> >
>> > Could you define what the a{sa{sas}} map is?
>>
>> it should probably be a{sv} where s is the uri and v is the variant
>> holding an array of metadata values for that uri (the order of the
>> metadata fields will match the fields specified in the properties array)
>>
>> >
>> > I think you probably also want an API where you just get a list of 
>> URIs;
>> > sometimes that's all you care about.  (This is a weakness in the Beagle
>> > API, and one which we're going to be fixing.)
>>
>> yes definitely - if the properties array above is empty it should just
>> fetch uri.
> 
> I'm not totally against that, but is it really that hard to pass
> ["uri"] in the arguments compared to []?

oh right - no problem :)


-- 
Mr Jamie McCracken
http://jamiemcc.livejournal.com/




More information about the xdg mailing list