Re: [Tracker] Get search result from specified offset?
- From: Jamie McCracken <jamiemcc blueyonder co uk>
- To: Mikkel Kamstrup Erlandsen <mikkel kamstrup gmail com>
- Cc: Tracker List <tracker-list gnome org>
- Subject: Re: [Tracker] Get search result from specified offset?
- Date: Mon, 31 Jul 2006 22:05:29 +0100
Mikkel Kamstrup Erlandsen wrote:
Say I want to add paged search results to Barracuda, showing 100 per 
hits per page. How would I do this optimally?
My first intuition tells me that I should do to like this (symbolically 
speaking) tracker_query(String query, int offset, int numHits), with 
numHits=100 and offset=0 for the first page, offset=100 for the second 
page etc. This is not possible with the current tracker api though.
I'm a bit hesitant to beg for an api addition since with these kind of 
examples we might end up with a really cluttered api if we add 
everything that comes to mind.
Right now I hard code 512 hits as a max. I could page these with 100 
hits/page but I often have >512 hits for my test queries. When I hit 
page 5 i could re-query with 1024 hits, but I'm hesitant to do so....
Any thoughts?
yeah good point - its an important feature so its definitely worth having
mysql supports offest so you can tell it to get result 10-20 say easily 
enough so it wont be too much work.
I should probably add it before doing a release as I want to get API 
stable ASAP. For now I will add it to the API and if I find time 
tomorrow I will implement it but I want to release in next few days. (I 
would have done earlier were it not for all the crashes and build 
problems reported)
Will let you know when its in cvs as you will need to update deskbar 
handler as well.
btw you might be interested in method FilesByText in the search 
interface as it retrieves all results grouped (and sorted) by the file 
service type.
Also method  MatchingFields will be good for showing a snippet of the 
matching metadata for a search hit - a bit like the bottom of Beagle's 
Holmes where it shows the matching text for the selected entry.
(the above 2 methods are untested though!)
--
Mr Jamie McCracken
http://jamiemcc.livejournal.com/
[
Date Prev][
Date Next]   [
Thread Prev][Thread Next]   
[
Thread Index]
[
Date Index]
[
Author Index]