mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-14 17:58:59 +00:00
Merged 5.2.N (5.2.1) to HEAD (5.2)
130285 gjames: Merged searchapi (5.2.1) to 5.2.N (5.2.1) 130022 gjames: Merged 5.2.N-AHIND (5.2.1) to searchapi (5.2.1) 129926 ahind: SEARCH-31 SOLR 6 - Shard based on date - SOLR implementation - Support returning a date, datetime or string property to use for sharding git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@130357 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -53,6 +53,7 @@
|
||||
"txnId": ${node.txnId?c},
|
||||
"status": "<#if node.deleted>d<#else>u</#if>",
|
||||
<#if node.aclId??>"aclId": ${node.aclId?c},</#if>
|
||||
<#if node.shardPropertyValue??>"shardPropertyValue": "${node.shardPropertyValue?string}",</#if>
|
||||
"tenant": "${node.tenant}"
|
||||
}
|
||||
</#macro>
|
||||
|
@@ -35,6 +35,7 @@ import java.util.Set;
|
||||
|
||||
import org.alfresco.repo.domain.node.Node;
|
||||
import org.alfresco.repo.domain.qname.QNameDAO;
|
||||
import org.alfresco.repo.search.impl.QueryParserUtils;
|
||||
import org.alfresco.repo.security.authentication.AuthenticationUtil;
|
||||
import org.alfresco.repo.solr.NodeParameters;
|
||||
import org.alfresco.repo.solr.SOLRTrackingComponent;
|
||||
@@ -166,6 +167,8 @@ public class NodesGet extends DeclarativeWebScript
|
||||
}
|
||||
}
|
||||
|
||||
String shardProperty = o.has("shardProperty") ? o.getString("shardProperty") : null;
|
||||
|
||||
NodeParameters nodeParameters = new NodeParameters();
|
||||
nodeParameters.setTransactionIds(txnIds);
|
||||
nodeParameters.setFromTxnId(fromTxnId);
|
||||
@@ -176,6 +179,7 @@ public class NodesGet extends DeclarativeWebScript
|
||||
nodeParameters.setIncludeAspects(includeAspects);
|
||||
nodeParameters.setExcludeNodeTypes(excludeNodeTypes);
|
||||
nodeParameters.setIncludeNodeTypes(includeNodeTypes);
|
||||
nodeParameters.setShardProperty(shardProperty);
|
||||
|
||||
StoreRef storeRef = null;
|
||||
|
||||
@@ -226,6 +230,7 @@ public class NodesGet extends DeclarativeWebScript
|
||||
private final String nodeRef;
|
||||
private final String tenant;
|
||||
private final Long aclId;
|
||||
private final String shardPropertyValue;
|
||||
|
||||
public NodeRecord(Node node, QNameDAO qnameDAO, TenantService tenantService)
|
||||
{
|
||||
@@ -235,6 +240,7 @@ public class NodesGet extends DeclarativeWebScript
|
||||
this.nodeRef = node.getNodeRef().toString();
|
||||
this.tenant = tenantService.getDomain(node.getNodeRef().getStoreRef().getIdentifier());
|
||||
this.aclId = node.getAclId();
|
||||
this.shardPropertyValue = node.getShardKey();
|
||||
}
|
||||
|
||||
public Long getId()
|
||||
@@ -267,7 +273,10 @@ public class NodesGet extends DeclarativeWebScript
|
||||
return aclId;
|
||||
}
|
||||
|
||||
|
||||
public String getShardPropertyValue()
|
||||
{
|
||||
return this.shardPropertyValue;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
Reference in New Issue
Block a user