Package org.alfresco.solr.tracker
Class PropertyRouter
- java.lang.Object
-
- org.alfresco.solr.tracker.PropertyRouter
-
- All Implemented Interfaces:
DocRouter
public class PropertyRouter extends java.lang.Object implements DocRouter
Routes based on a text property field. In this method, the value of some property is hashed and this hash is used to assign the node to a random shard. All nodes with the same property value will be assigned to the same shard. Each shard will duplicate all the ACL information. To use this method, when creating a shard add the new configuration properties:- shard.key=cm:creator
- shard.method=PROPERTY
- shard.instance=<shard.instance>
- shard.count=<shard.count>
- shard.regex=^\d{4}
- Author:
- Gethin James
- See Also:
- Search Services sharding methods
-
-
Constructor Summary
Constructors Constructor Description PropertyRouter(java.lang.String propertyRegEx)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.Map<java.lang.String,java.lang.String>getProperties(java.util.Optional<org.alfresco.service.namespace.QName> shardProperty)Get additional properties to "shardProperty" depending on the Shard Method.java.lang.BooleanrouteAcl(int shardCount, int shardInstance, org.alfresco.solr.client.Acl acl)Checks if the incoming ACL document must be indexed on this shard.java.lang.BooleanrouteNode(int shardCount, int shardInstance, org.alfresco.solr.client.Node node)Checks if the incoming Node must be indexed on this shard.
-
-
-
Method Detail
-
routeAcl
public java.lang.Boolean routeAcl(int shardCount, int shardInstance, org.alfresco.solr.client.Acl acl)Description copied from interface:DocRouterChecks if the incoming ACL document must be indexed on this shard.
-
routeNode
public java.lang.Boolean routeNode(int shardCount, int shardInstance, org.alfresco.solr.client.Node node)Description copied from interface:DocRouterChecks if the incoming Node must be indexed on this shard.- Specified by:
routeNodein interfaceDocRouter- Parameters:
shardCount- the total shard count.shardInstance- the owning shard instance (i.e. instance number).node- theNodeinstance.- Returns:
- true if the
Nodeinstance must be indexed in the shard which owns thisDocRouterinstance, false otherwise.
-
getProperties
public java.util.Map<java.lang.String,java.lang.String> getProperties(java.util.Optional<org.alfresco.service.namespace.QName> shardProperty)
Description copied from interface:DocRouterGet additional properties to "shardProperty" depending on the Shard Method.- Specified by:
getPropertiesin interfaceDocRouter- Parameters:
shardProperty- custom property used to configure the Router. Note not all routers need that.- Returns:
- pair of key, value
-
-