mirror of
https://github.com/DSpace/DSpace.git
synced 2025-10-17 06:53:09 +00:00
port pr1890 minus jspui
This commit is contained in:
@@ -18,6 +18,7 @@ import org.apache.log4j.Logger;
|
|||||||
import org.dspace.authorize.factory.AuthorizeServiceFactory;
|
import org.dspace.authorize.factory.AuthorizeServiceFactory;
|
||||||
import org.dspace.authorize.service.AuthorizeService;
|
import org.dspace.authorize.service.AuthorizeService;
|
||||||
import org.dspace.content.Collection;
|
import org.dspace.content.Collection;
|
||||||
|
import org.dspace.content.Community;
|
||||||
import org.dspace.content.DCDate;
|
import org.dspace.content.DCDate;
|
||||||
import org.dspace.content.DSpaceObject;
|
import org.dspace.content.DSpaceObject;
|
||||||
import org.dspace.content.Item;
|
import org.dspace.content.Item;
|
||||||
@@ -98,15 +99,20 @@ public class Harvest {
|
|||||||
discoverQuery.addFilterQueries("search.resourcetype:" + Constants.ITEM);
|
discoverQuery.addFilterQueries("search.resourcetype:" + Constants.ITEM);
|
||||||
|
|
||||||
if (scope != null) {
|
if (scope != null) {
|
||||||
discoverQuery.addFieldPresentQueries("location:" + scope.getID());
|
if (scope instanceof Community) {
|
||||||
|
discoverQuery.addFilterQueries("location:m" + scope.getID());
|
||||||
|
} else if (scope instanceof Collection) {
|
||||||
|
discoverQuery.addFilterQueries("location:l" + scope.getID());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (startDate != null) {
|
if (startDate != null && endDate != null) {
|
||||||
discoverQuery.addFilterQueries("lastModified => " + new DCDate(startDate).toString());
|
discoverQuery.addFilterQueries("lastModified:[" + new DCDate(startDate).toString()
|
||||||
}
|
+ " TO " + new DCDate(endDate).toString()+ "]");
|
||||||
|
} else if (startDate != null) {
|
||||||
if (endDate != null) {
|
discoverQuery.addFilterQueries("lastModified:[" + new DCDate(startDate).toString() + " TO *]");
|
||||||
discoverQuery.addFilterQueries("lastModified <= " + new DCDate(startDate).toString());
|
} else if (endDate != null) {
|
||||||
|
discoverQuery.addFilterQueries("lastModified:[* TO " + new DCDate(endDate).toString()+ " ]");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!withdrawn) {
|
if (!withdrawn) {
|
||||||
|
Reference in New Issue
Block a user