Re: Sort order for search results?

From Stefan Boddie
DateTue, 11 Feb 2003 17:14:29 +1300
Subject Re: Sort order for search results?
In-Reply-To (20030207154016V-tao-lib-uchicago-edu)
> A couple questions about search results have come up at our site:
> 1. How are search results sorted? Do we have any control over the sort
> order? Our site is currently use mg, though we plan to experiment
> with mgpp once some other issues are resolved, if that makes a
> difference.

If you do a "some" search (also known as "ranked" if you're in advanced
query mode) mg returns the results in "ranked" order. That is, it attempts
to work out which documents best matched your query and presents the best
matches first. If you do an "all" search (otherwise known as "boolean") the
search results are returned in build order. That is, the order in which the
documents were processed by is the order in which they'll be
returned. If you want complete control over the ordering of your search
results your only option is to force your users to do boolean searches and
manipulate the order in which the documents in your collection are built.
There's an option to called "-sortmeta" that might help in
altering the build order.

> 2. We want to change the default maximum documents returned by a
> search from 50 to all documents matching the search. Similarly, we
> want to change the default hits per page to show all hits on one
> page. Reading _maxdocoption_ and _hitsperpageoption_ in,
> this seems a bit unlikely. Ideas?

Add the following lines to your gsdl/etc/main.cfg file

cgiarg shortname=m argdefault=-1
cgiarg shortname=o argdefault=-1

This should make the "m" (maximum documents) and "o" (hits per page) options
default to -1 (unlimited). I can't actually remember if -1 works for these
options. If it doesn't, try making them default to 1000000 or something