Re: Opinions on multi-source search



On Thu, 2010-06-03 at 16:06 +0200, Iago Toral wrote:
> On Thu, 03 Jun 2010 09:14:01 +0200, "Juan A. Suarez Romero"
> <jasuarez igalia com> wrote:
> >   - I would like to see a multiple_search() api as similar as
> > single_search() one. For instance, 'skip' parameter has been removed.
> 
> There is a reason for this. Since we are merging results from various different 
> sources and we cannot ensure the order of them (at least not if we want to have 
> a quick response time and we want to have results from various sources), we 
> cannot have this parameter because results have no order.
> 

Yes I'm totally aware of it. Rather, my opinion was two-fold:

- Keeping consistency with single-source search (minor issue, indeed; i
can live without it)
- Though it isn't guaranteed that results are always returning in the
same order, and in fact this should be strongly encouraged in
documentation, still skip can be used for other purposes. For instance,
if I want to retrieve a randomly set of results, I can use the skip
randomly to get different sets of results.

> And now that I think about it, if I change the implementation to follow your 
> previous suggestion and ask "count" items to each searchable source then we 
> have the risk that the first source providing results provides all 100 items 
> before the others (not strange at all) and  I would really like to avoid that, 
> we should really try to get results from various sources. Maybe we could use 
> the flags parameter to define various search policies.

Yep, maybe having different policies can be a good idea. Still, I've
answered previous email with a new solution that can resolve this issue
too.

> 
> >   - This complain is quite picky, so ignore it if you don't like ;):
> > grl_multiple_search() sounds like performing search for multiple text
> > words. Something like grl_media_source_search_all() would sound better
> > for me.
> 
> The reason I did not use a name like this is that this API is not a method of 
> the GrlMediaSource object and thus, I would find this naming misleading, but 
> I don't have a strong opinion. What do others think?


I see...

Well, when you mentioned for first time the multiple search, I had
thought about something like a GrlMediaSource class method, having thus
the same iface instance-method search(), but without the "source" first
parameter.

Anyway, as I told, a picky opinion :)

	J.A.





[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]