boolean concurrentEnabled = !"".equals(concurrent);
System.out.println("concurrent = "+concurrent);
System.out.println("concurrentEnabled = "+concurrentEnabled);
boolean create = mustCreateIndex(element);
BeanDefinitionRegistry registry = parserContext.getRegistry();
//Definition of the FS Directory
RootBeanDefinition fsDirectoryBeanDefinition = new RootBeanDefinition(
FSDirectoryFactoryBean.class);
fsDirectoryBeanDefinition.setPropertyValues(new MutablePropertyValues());
fsDirectoryBeanDefinition.getPropertyValues()
.addPropertyValue(LOCATION_ATTRIBUTE, location);
registry.registerBeanDefinition(FS_DIRECTORY_ID_PREFIX + id, fsDirectoryBeanDefinition);
//Definition of the index factory
RootBeanDefinition simpleIndexFactoryBeanDefinition = new RootBeanDefinition(
SimpleIndexFactoryBean.class);
simpleIndexFactoryBeanDefinition.setPropertyValues(new MutablePropertyValues());
simpleIndexFactoryBeanDefinition.getPropertyValues()
.addPropertyValue(DIRECTORY_ATTRIBUTE, new RuntimeBeanReference(FS_DIRECTORY_ID_PREFIX + id));
simpleIndexFactoryBeanDefinition.getPropertyValues()
.addPropertyValue(CREATE_ATTRIBUTE, new Boolean(create));
//Configuration of the analyzer of the factory
configureAnalyzer(element, simpleIndexFactoryBeanDefinition, parserContext);
String idIndexFactory = concurrentEnabled ? TARGET_INDEX_FACTORY_ID_PREFIX + id : id;
registry.registerBeanDefinition(idIndexFactory, simpleIndexFactoryBeanDefinition);
if( concurrentEnabled ) {
configureConcurrentIndexFactory(id, concurrent, registry, idIndexFactory);
}
}