Commit 7a93d214 authored by Ard Schrijvers's avatar Ard Schrijvers

HSTTWO-4270 Do not require sort order properties to be present

Sort order properties are something else than where clause constraints
so should not be mixed
parent e2f5ca66
/*
* Copyright 2015-2017 Hippo B.V. (http://www.onehippo.com)
* Copyright 2015-2018 Hippo B.V. (http://www.onehippo.com)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
......@@ -209,10 +209,6 @@ public class DocumentsResource extends AbstractResource {
.where(QueryUtils.text().contains(parsedQuery == null ? "" : parsedQuery))
.and(QueryUtils.text(HIPPO_AVAILABILITY).isEqualTo(availability));
for (String ob : parsedOrderBys) {
andClause = andClause.and(new ExistsConstraint(ob));
}
final Query query = addOrdering(andClause, parsedOrderBys, parsedSortOrders).offsetBy(offset)
.limitTo(max);
......
/*
* Copyright 2016-2017 Hippo B.V. (http://www.onehippo.com)
* Copyright 2016-2018 Hippo B.V. (http://www.onehippo.com)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
......@@ -206,7 +206,7 @@ public class DocumentsResourceIT extends AbstractRestApiIT {
for (Map<String, Object> item : itemsList) {
final Node handleNode = liveUser.getNodeByIdentifier((String) item.get("id"));
final Node node = handleNode.getNode(handleNode.getName());
if (!node.hasProperty(PROPERTY_TITLE) && !node.hasProperty(PROPERTY_DATE)) {
if (!node.hasProperty(PROPERTY_TITLE) || !node.hasProperty(PROPERTY_DATE)) {
continue;
}
String current = node.getProperty(PROPERTY_TITLE).getString();
......@@ -322,7 +322,7 @@ public class DocumentsResourceIT extends AbstractRestApiIT {
for (Map<String, Object> item : itemsList) {
final Node handleNode = liveUser.getNodeByIdentifier((String) item.get("id"));
final Node node = handleNode.getNode(handleNode.getName());
if (!node.hasProperty(PROPERTY_TITLE) && !node.hasProperty(PROPERTY_DATE)) {
if (!node.hasProperty(PROPERTY_TITLE) || !node.hasProperty(PROPERTY_DATE)) {
continue;
}
final String currentTitle = node.getProperty(PROPERTY_TITLE).getString();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment