[Xesam] Why is vendor.maxhits read-only?

Mikkel Kamstrup Erlandsen mikkel.kamstrup at gmail.com
Tue Dec 18 07:22:37 PST 2007


On 18/12/2007, Anders Rune Jensen <anders at iola.dk> wrote:
> On Dec 18, 2007 1:48 PM, Mikkel Kamstrup Erlandsen
> <mikkel.kamstrup at gmail.com> wrote:
> > On 18/12/2007, Anders Rune Jensen <anders at iola.dk> wrote:
> > > On Dec 18, 2007 11:48 AM, Mikkel Kamstrup Erlandsen
> > > <mikkel.kamstrup at gmail.com> wrote:
> > > > > So far I can work around all of this, but it really would be much
> > > > > nicer to have those two interfaces.
> > > >
> > > > Would it not be just as good had you had a xesam client lib (exposing
> > > > these features) with GObjects for C#?
> > >
> > > Not if I want performance. Lets say I want to get metadata from beagle
> > > for 1000 files. In current beagle-xesam-adaptor this translates into
> > > 40 dbus calls of 25 results just to get all the results. Furthermore I
> > > have to do 10 seperate searches since beagle will only return me 100
> > > hits per search and I can't change this in any way even though the
> > > native beagle api allows me to do it.
> >
> > According to http://xesam.org/main/XesamSearch90 calls to GetHits
> > should block until the data is available or the entire index has been
> > searched. Considering this why would calling GetHits (1000) not do
> > what you want? (except that you can't do this with Beagle)
>
> Excellent, that's exactly what I need, well yeah except that I have to
> do it in chunks of 100. I didn't know I could specify a number
> different from what I got in HitsAdded.

Ah. The underlying idea is that it should be possible to use the API
as a synchronous one by ignoring the signals. So if an app only wants
to say "gimme the first god damn 10 hits" it can just do

ses = NewSession()
sh = NewSearch(ses, "<query>...")
SearchStart(sh)
hits = GetHits(10)
CloseSession(ses)

> > If you want better responsiveness you probably want to fetch the hits
> > in smaller batches anyway.
> >
> > > I know the current api is optimized for returning results used in a
> > > page-style. But it's really sad that if you want to use it in another
> > > way you have to jump through hoops to get it to do that :-)
> >
> > It should be possible to do more massive "hit-harvesting" to do
> > additional bulk analysis like I assume you want.
> >
> > If this is hard then it is a "bug" in the spec. If you could outline
> > you use case a bit more it might shed some light...
>
> Lets say I want to migrate from tracker to beagle or the other way
> around, and I want to write a script that takes all my tags and
> applies them to the other datastore.

Very valid use case indeed. However I am not sure why Beagle has
problems delivering more than 100 hits/search.

Perhaps this is something that is of lesser issue when clients use the
xesam API - because the hit reading is sequential. The doc data can be
resolved on request since beagled knows how many docs are requested...
Perhaps a Beagle dev can enlighten us?

Cheers,
Mikkel


More information about the Xesam mailing list