simple search api (was Re: mimetype standardisation by testsets)

Jamie McCracken jamiemcc at blueyonder.co.uk
Fri Dec 15 16:12:00 EET 2006


Mikkel Kamstrup Erlandsen wrote:

> 
> Question 1 : Will it benefit the search engine to have a Session object 
> for each connection? Then Query objects are spawned by a call like 
> Magnus suggest; Query = NewQuery(Session, query_string)? Is it correct 
> that applications doesn't need to care about sessions - just gimme the 
> goddam query! ? :-)

In Dbus , there are no specific sessions exposed as such so Im not sure 
a "session" makes sense unless you are using P2P mode.

We do need to close a live query to free up resources on the server but 
theres no way to automate that as AFAIK the server does not receive 
client disconnect signals - the shared bus is the connection and thats 
never released.

> 
> Question 2 : Should the results be returned with the HitsAdded signal? 
> The Query object then has a Query.GetResults method to retrieve the 
> results. This is closer to libbeagle and spotlight and the application 
> only spends time retrieving hits when it really wants to. It does 
> introduce some extra method calls though...
> 

Dunno. It depends on the extra traffic it generates - individual dbus 
calls may have an overhead of a ms or two so they could add up when 
returning large result sets (IE  1000 hits could cost you 1 or 2 seconds 
in socket latency alone). I think sending one hit per signal is probably 
out of the question.

If we batched up the results in packets of 10 or 20 (or some config 
setting) then it might be okay to do that.

I would have to experiment with tracker to find the optimal packet size 
so maybe the packet size should be search engine specific.


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




More information about the xdg mailing list