mirror of
https://github.com/DSpace/DSpace.git
synced 2025-10-07 01:54:22 +00:00
Fix problem with ordering community / collection / items
git-svn-id: http://scm.dspace.org/svn/repo/trunk@2532 9c30dcfa-912a-0410-8fc2-9e0234be79fd
This commit is contained in:
@@ -1067,7 +1067,7 @@ public class DSIndexer
|
||||
doc.add(new Field("type", Integer.toString(type), Field.Store.YES, Field.Index.NO));
|
||||
|
||||
// New fields to weaken the dependence on handles, and allow for faster list display
|
||||
doc.add(new Field("search.resourcetype", Integer.toString(type), Field.Store.YES, Field.Index.NO));
|
||||
doc.add(new Field("search.resourcetype", Integer.toString(type), Field.Store.YES, Field.Index.UN_TOKENIZED));
|
||||
doc.add(new Field("search.resourceid", Integer.toString(id), Field.Store.YES, Field.Index.NO));
|
||||
|
||||
// want to be able to search for uri, so use keyword
|
||||
|
@@ -166,11 +166,11 @@ public class DSQuery
|
||||
Hits hits = null;
|
||||
if (args.getSortOption() == null)
|
||||
{
|
||||
hits = searcher.search(myquery, new Sort(new SortField[] { new SortField("type"), SortField.FIELD_SCORE }));
|
||||
hits = searcher.search(myquery, new Sort(new SortField[] { new SortField("search.resourcetype"), SortField.FIELD_SCORE }));
|
||||
}
|
||||
else
|
||||
{
|
||||
SortField[] sortFields = new SortField[] { new SortField("type"), new SortField("sort_" + args.getSortOption().getName(), SortOption.DESCENDING.equals(args.getSortOrder())), SortField.FIELD_SCORE };
|
||||
SortField[] sortFields = new SortField[] { new SortField("search.resourcetype"), new SortField("sort_" + args.getSortOption().getName(), SortOption.DESCENDING.equals(args.getSortOrder())), SortField.FIELD_SCORE };
|
||||
hits = searcher.search(myquery, new Sort(sortFields));
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user