Just to illustrate that this is possible, here is a link to a collection in
my repository with a default sort by date created.

https://repository.library.georgetown.edu/handle/10822/761426/discover?query=school&submit=Search

Note that the search filters will illustrate the default sort  that is
enabled (creation date).

Taking a closer look at discovery.xml, there are 2 references in which a
default sort can be configured.

   -
   
https://github.com/DSpace/DSpace/blob/master/dspace/config/spring/api/discovery.xml#L118
   -
   
https://github.com/DSpace/DSpace/blob/master/dspace/config/spring/api/discovery.xml#L225


Perhaps you need to update the second reference.

Terry

On Tue, Jun 14, 2016 at 3:08 AM, madhan muthu <mu.mad...@gmail.com> wrote:

> Thanks.
>
> I am using DSpace 4.2.  In the instance, the "search results" are ordered
> by relevance. I want to display the search results in descending order of
> date_issued.
>
> Even after I uncommented <property name="defaultSort"
> ref="sortDateIssued"/>, I dont see any effect in the results.  I will be
> grateful for suggestions.
>
> Madhan
>
>
>
> On Tue, Jun 14, 2016 at 3:30 PM, Terry Brady <terry.br...@georgetown.edu>
> wrote:
>
>> I am taking this discussion back to the list in case others have advice
>> to offer.
>>
>> What sort do you currently see on your site?  The default is to sort by
>> date issued.
>>
>> What metadata field do you wish to use for your sort?  If you would like
>> to sort by a different date field, clone the sortDateIssued element and
>> configure a different sort option.  You can then reference that element as
>> the default sort filed.
>>
>> Terry
>>
>> On Tue, Jun 14, 2016 at 2:19 AM, madhan muthu <mu.mad...@gmail.com>
>> wrote:
>>
>>> Thanks Terry.  I tried there, but failed.  Perhaps I do not know how to
>>> set the parameter.  I uncommented  and enbaled the *defaultSort* by *date
>>> issued*.  I rebuilt the index and restarted tomcat.  I dont see any
>>> effect.  What else, should I do?
>>>
>>>
>>>
>>> <property name="searchSortConfiguration">
>>>             <bean
>>> class="org.dspace.discovery.configuration.DiscoverySortConfiguration">
>>>                 *<property name="defaultSort" ref="sortDateIssued"/>*
>>>                 <!--DefaultSortOrder can either be desc or asc (desc is
>>> default)-->
>>>                 <property name="defaultSortOrder" value="desc"/>
>>>                 <property name="sortFields">
>>>                     <list>
>>>                         <ref bean="sortTitle" />
>>>                         <ref bean="sortDateIssued" />
>>>                     </list>
>>>                 </property>
>>>             </bean>
>>> </property>
>>>
>>> There sort properties are at the bottom:
>>>
>>> <!--Sort properties-->
>>>     <bean id="sortTitle"
>>> class="org.dspace.discovery.configuration.DiscoverySortFieldConfiguration">
>>>         <property name="metadataField" value="dc.title"/>
>>>     </bean>
>>>
>>>     <bean id="sortDateIssued"
>>> class="org.dspace.discovery.configuration.DiscoverySortFieldConfiguration">
>>>         <property name="metadataField" value="dc.date.issued"/>
>>>         <property name="type" value="date"/>
>>>     </bean>
>>>
>>>
>>>
>>> On Tue, Jun 14, 2016 at 2:13 PM, Terry Brady <terry.br...@georgetown.edu
>>> > wrote:
>>>
>>>> Take a look at the following configuration file.
>>>>
>>>>
>>>> https://github.com/DSpace/DSpace/blob/master/dspace/config/spring/api/discovery.xml#L116-L128
>>>>
>>>> It is possible that you will want to change the date field that is used
>>>> for the default sort.
>>>>
>>>> Terry
>>>>
>>>> On Mon, Jun 13, 2016 at 11:49 PM, madhan muthu <mu.mad...@gmail.com>
>>>> wrote:
>>>>
>>>>> I would like to display the search results of DSpace in reverse
>>>>> chronological order.  What should I do?
>>>>>
>>>>> Madhan
>>>>> India
>>>>>
>>>>> --
>>>>> You received this message because you are subscribed to the Google
>>>>> Groups "DSpace Technical Support" group.
>>>>> To unsubscribe from this group and stop receiving emails from it, send
>>>>> an email to dspace-tech+unsubscr...@googlegroups.com.
>>>>> To post to this group, send email to dspace-tech@googlegroups.com.
>>>>> Visit this group at https://groups.google.com/group/dspace-tech.
>>>>> For more options, visit https://groups.google.com/d/optout.
>>>>>
>>>>
>>>>
>>>>
>>>> --
>>>> Terry Brady
>>>> Applications Programmer Analyst
>>>> Georgetown University Library Information Technology
>>>> http://georgetown-university-libraries.github.io/
>>>> <https://www.library.georgetown.edu/lit/code>
>>>> 425-298-5498 (Seattle, WA)
>>>>
>>>
>>>
>>>
>>> --
>>> Madhan, M
>>>
>>>
>>
>>
>> --
>> Terry Brady
>> Applications Programmer Analyst
>> Georgetown University Library Information Technology
>> http://georgetown-university-libraries.github.io/
>> <https://www.library.georgetown.edu/lit/code>
>> 425-298-5498 (Seattle, WA)
>>
>
>
>
> --
> Madhan, M
>
>


-- 
Terry Brady
Applications Programmer Analyst
Georgetown University Library Information Technology
http://georgetown-university-libraries.github.io/
<https://www.library.georgetown.edu/lit/code>
425-298-5498 (Seattle, WA)

-- 
You received this message because you are subscribed to the Google Groups 
"DSpace Technical Support" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to dspace-tech+unsubscr...@googlegroups.com.
To post to this group, send email to dspace-tech@googlegroups.com.
Visit this group at https://groups.google.com/group/dspace-tech.
For more options, visit https://groups.google.com/d/optout.

Reply via email to