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:
Graham Triggs
2008-01-15 15:59:53 +00:00
parent 1c068b2132
commit 00f7b2b8cf
2 changed files with 3 additions and 3 deletions

View File

@@ -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

View File

@@ -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));
}