use of com.thinkbiganalytics.metadata.modeshape.service.JcrIndexService in project kylo by Teradata.
the class MetadataJcrConfig method indexService.
// should not run during upgrade
@Bean
@ConditionalOnProperty(prefix = "config", value = "search.engine")
@Profile("!kyloUpgrade")
public JcrIndexService indexService(final Search search, final DatasourceProvider datasourceProvider, final MetadataAccess metadataAccess, final Repository repository) {
final JcrIndexService indexService = new JcrIndexService(search, datasourceProvider, metadataAccess);
try {
final ObservationManager observationManager = repository.login().getWorkspace().getObservationManager();
observationManager.addEventListener(indexService, Event.NODE_ADDED | Event.NODE_REMOVED | Event.PROPERTY_ADDED | Event.PROPERTY_CHANGED | Event.PROPERTY_REMOVED, EntityUtil.pathForDerivedDatasource(), true, null, null, false);
} catch (final RepositoryException e) {
throw new MetadataRepositoryException("Failed to register index service: " + e, e);
}
return indexService;
}
Aggregations