mirror of
https://github.com/DSpace/DSpace.git
synced 2025-10-13 13:03:11 +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));
|
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
|
// 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));
|
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
|
// want to be able to search for uri, so use keyword
|
||||||
|
@@ -166,11 +166,11 @@ public class DSQuery
|
|||||||
Hits hits = null;
|
Hits hits = null;
|
||||||
if (args.getSortOption() == 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
|
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));
|
hits = searcher.search(myquery, new Sort(sortFields));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user