Currently, beagle restricts searches to return a maximum of 100 hits from each backend. As discussed on IRC, it would be nice if clients could modify this limit, as for some apps (e.g. dashboard) this is overkill. The maximum allow is still 100. Index: BeagleClient/Query.cs =================================================================== RCS file: /cvs/gnome/beagle/BeagleClient/Query.cs,v retrieving revision 1.24.2.1 diff -u -B -p -r1.24.2.1 Query.cs --- BeagleClient/Query.cs 25 Apr 2005 19:34:54 -0000 1.24.2.1 +++ BeagleClient/Query.cs 3 May 2005 12:39:04 -0000 @@ -267,6 +267,14 @@ namespace Beagle { /////////////////////////////////////////////////////////////// + private int max_hits = 100; + public int MaxHits { + get { return max_hits; } + set { max_hits = value; } + } + + /////////////////////////////////////////////////////////////// + [XmlIgnore] public bool IsEmpty { get { return text.Count == 0 Index: beagled/HitRegulator.cs =================================================================== RCS file: /cvs/gnome/beagle/beagled/HitRegulator.cs,v retrieving revision 1.6.2.1 diff -u -B -p -r1.6.2.1 HitRegulator.cs --- beagled/HitRegulator.cs 25 Apr 2005 19:35:01 -0000 1.6.2.1 +++ beagled/HitRegulator.cs 3 May 2005 12:39:05 -0000 @@ -33,7 +33,11 @@ namespace Beagle.Daemon { public class HitRegulator : IQueryResult { - const int max_n_hits = 100; + private int max_n_hits = 100; + public int MaxHits { + get { return max_n_hits; } + set { max_n_hits = (value > 100)? 100 : value; } + } Queryable queryable; Index: beagled/QueryDriver.cs =================================================================== RCS file: /cvs/gnome/beagle/beagled/QueryDriver.cs,v retrieving revision 1.26.2.1 diff -u -B -p -r1.26.2.1 QueryDriver.cs --- beagled/QueryDriver.cs 25 Apr 2005 19:35:01 -0000 1.26.2.1 +++ beagled/QueryDriver.cs 3 May 2005 12:39:05 -0000 @@ -250,6 +250,7 @@ namespace Beagle.Daemon { public void DoWork () { HitRegulator regulator = result.GetHitRegulator (queryable); + regulator.MaxHits = query.MaxHits; queryable.DoQuery (query, regulator, change_data); regulator.Flush (result); } Index: tools/Query.cs =================================================================== RCS file: /cvs/gnome/beagle/tools/Query.cs,v retrieving revision 1.40.2.2 diff -u -B -p -r1.40.2.2 Query.cs --- tools/Query.cs 25 Apr 2005 21:59:08 -0000 1.40.2.2 +++ tools/Query.cs 3 May 2005 12:39:05 -0000 @@ -134,6 +134,8 @@ class QueryTool { " \t\t\tquery changes.\n" + " --stats-only\t\t\tOnly display statistics about the query, not\n" + " \t\t\tthe actual results.\n" + + " --max-hits\t\t\tLimit number of search results per backend\n" + + " \t\t\t(default = 100, max = 100)\n" + " --help\t\t\tPrint this usage message.\n"; Console.WriteLine (usage); @@ -181,6 +183,10 @@ class QueryTool { case "--stats-only": verbose = true; display_hits = false; + break; + case "--max-hits": + if (++i >= args.Length) PrintUsageAndExit (); + query.MaxHits = Int32.Parse (args[i]); break; default: Index: tools/beagle-query.1 =================================================================== RCS file: /cvs/gnome/beagle/tools/beagle-query.1,v retrieving revision 1.3 diff -u -B -p -r1.3 beagle-query.1 --- tools/beagle-query.1 11 Mar 2005 01:52:12 -0000 1.3 +++ tools/beagle-query.1 3 May 2005 12:39:05 -0000 @@ -34,6 +34,10 @@ specified multiple times. .B --source=\fIsource\fP Constrain query to the specified search source. A source list can be obtained from the beagle-status command. +.TP +.B --max-hits +Reduce the number of search results returned per backend. The default is 100, +and this is also the maximum allowed. .SH AUTHOR Novell, Inc. .SH "REPORTING BUGS"