indexManager.addContainedEntity( mappedClass );
providers[index] = indexManager;
}
//define sharding strategy for this entity:
IndexShardingStrategy shardingStrategy;
//any indexProperty will do, the indexProps[0] surely exists.
String shardingStrategyName = indexProps[0].getProperty( SHARDING_STRATEGY );
if ( shardingStrategyName == null ) {
if ( indexProps.length == 1 ) {
shardingStrategy = new NotShardedStrategy();
}
else {
shardingStrategy = new IdHashShardingStrategy();
}
}
else {
shardingStrategy = ClassLoaderHelper.instanceFromName(
IndexShardingStrategy.class,
shardingStrategyName, DirectoryProviderFactory.class, "IndexShardingStrategy"
);
}
shardingStrategy.initialize(
new MaskedProperty( indexProps[0], SHARDING_STRATEGY ), providers
);
//define the Similarity implementation:
// warning: it can also be set by an annotation at class level