[greenstone-users] Sort search results in reverse order

From Katherine of Greenstone Team
DateThu Jul 3 12:38:44 2008
Subject [greenstone-users] Sort search results in reverse order
In-Reply-To (000601c8dc7d$a9d15470$1a0101c1-SHAIO-COM)
Hi Alejandro

This option will be available in the next release. In the meantime,
here's a little hack that should get it working for you.

Please download the file
http://www.cs.waikato.ac.nz/~kjdon/greenstone/arcinfo.pm
and copy into your gsdl/perllib directory. Then reimport and rebuild the
collection.

At the top of the file, you'll notice the following:

sub new {
my ($class) = @_;
my $self = {'info'=>{},
'order'=>[],
'reverse_sort'=>1};

return bless $self, $class;
}

If you want to go back to the normal sort, then set reverse_sort to 0.
In the next release there will be an option to import.pl so you won't
need to modify the file.

Regards,
Katherine

PS I haven't tested this, so please let me know if it doesn't work.

Biblioteca wrote:
> Hello Quan.
>
> Thanks, I tried it and it works. However, the thing is, I want to sort
> the documents by date, and I want the newer documents to show up
> first. As the metadata consists of years, the older documents show up
> first.
> Can this be done?
>
> Alejandro Vesga
>
> ----- Original Message ----- From: <qq6@cs.waikato.ac.nz>
> To: "Biblioteca" <biblioteca@shaio.com>
> Cc: <greenstone-users@list.scms.waikato.ac.nz>
> Sent: Tuesday, July 01, 2008 3:35 PM
> Subject: Re: [greenstone-users] Sort search results in reverse order
>
>
>> Hi Alejandro
>>
>> If you want the search results sorted based on a specific metadata
>> element, you have to force users to do an "all" search, the documents
>> returned are in build order. That is, the order in which the documents
>> were processed by buildcol.pl is the order in which they'll be returned.
>> The build order can be changed by using the sortmeta option to
>> import.pl.
>> If a metadata element is specified here, then documents will be sorted
>> during import by that metadata.
>>
>> If you are using GLI, go to the "Create" panel, select "Import Options"
>> from the left hand, then enable the "sortmeta" option and choose a
>> metadata from the list on the right hand. The collection has to be
>> re-imported and re-built.
>>
>> Regards
>> Quan
>>
>>> Hello.
>>>
>>> I'm using Greenstone 2.72 and I have a rather large collection indexed
>>> with MG. I want to sort the search results according to a specific
>>> metadata element, and it needs to be sorted in Z-A order.
>>> How do I do this? I've searched the mailing list archives, but all the
>>> responses are way too technical. If you can help me by giving me
>>> step by
>>> step instructions, I would be very grateful.
>>>
>>> Thank you,
>>>
>>> Alejandro Vesga
>>> _______________________________________________
>>> greenstone-users mailing list
>>> greenstone-users@list.scms.waikato.ac.nz
>>> https://list.scms.waikato.ac.nz/mailman/listinfo/greenstone-users
>>>
>>
>>
>
>
> _______________________________________________
> greenstone-users mailing list
> greenstone-users@list.scms.waikato.ac.nz
> https://list.scms.waikato.ac.nz/mailman/listinfo/greenstone-users
>