I found the cause of the issue after trawling through the Cloud Foundry plugin source code inside AbstractCloudBeanPostprocessor. The method for populating the compass connection doesn't check if it is a RAM index or not but blindly sets it to a location on disk.
/**
* Update the location of the Searchable Lucene index.
* @param beanFactory the Spring bean factory
* @param appConfig the application config
*/
protected void fixCompass(ConfigurableListableBeanFactory beanFactory, ConfigObject appConfig) {
def compassBean = beanFactory.getBeanDefinition('compass')
String indexLocation = getCompassIndexRootLocation(appConfig) + '/searchable-index'
appConfig.searchable.compassConnection = indexLocation
compassBean.propertyValues.addPropertyValue 'compassConnection', indexLocation
log.debug "Updated Compass connection details: $indexLocation"
}
I think this should really check for presence of RAM index and only set it to disk location. One possible workaround would be to create my own BeanDefinitionRegistryPostProcessor and undo what the cloud foundry plugin does.