def _initialize_test_solr(): """ Try to initialize a pair of Solr cores for testing purposes """ # data_dir, if left blank, ends up bing put in /tmp/solr/... create_solr_core(settings.SOLR_OPINION_TEST_CORE_NAME) create_solr_core( settings.SOLR_AUDIO_TEST_CORE_NAME, schema=os.path.join(settings.INSTALL_ROOT, 'Solr', 'conf', 'audio_schema.xml'), instance_dir='/usr/local/solr/example/solr/audio', )
def setUp(self): # Set up testing cores in Solr and swap them in self.core_name_opinion = settings.SOLR_OPINION_TEST_CORE_NAME self.core_name_audio = settings.SOLR_AUDIO_TEST_CORE_NAME create_solr_core(self.core_name_opinion) create_solr_core( self.core_name_audio, schema=os.path.join(settings.INSTALL_ROOT, 'Solr', 'conf', 'audio_schema.xml'), instance_dir='/usr/local/solr/example/solr/audio', ) # swap_solr_core('collection1', self.core_name_opinion) # swap_solr_core('audio', self.core_name_audio) self.si_opinion = sunburnt.SolrInterface( settings.SOLR_OPINION_URL, mode='rw') self.si_audio = sunburnt.SolrInterface( settings.SOLR_AUDIO_URL, mode='rw') self.si_opinion.commit() self.si_audio.commit()
def setUp(self): # Set up testing cores in Solr and swap them in self.core_name_opinion = settings.SOLR_OPINION_TEST_CORE_NAME self.core_name_audio = settings.SOLR_AUDIO_TEST_CORE_NAME create_solr_core(self.core_name_opinion) create_solr_core( self.core_name_audio, schema=os.path.join(settings.INSTALL_ROOT, 'Solr', 'conf', 'audio_schema.xml'), instance_dir='/usr/local/solr/example/solr/audio', ) # swap_solr_core('collection1', self.core_name_opinion) # swap_solr_core('audio', self.core_name_audio) self.si_opinion = sunburnt.SolrInterface(settings.SOLR_OPINION_URL, mode='rw') self.si_audio = sunburnt.SolrInterface(settings.SOLR_AUDIO_URL, mode='rw') self.si_opinion.commit() self.si_audio.commit()
#!/usr/bin/python from cl.lib.solr_core_admin import create_solr_core from cl import settings import os create_solr_core( core_name="audio", data_dir=os.path.join(settings.INSTALL_ROOT, "Solr", "data_audio"), schema=os.path.join(settings.INSTALL_ROOT, "Solr", "conf", "audio_schema.xml"), instance_dir="/usr/local/solr/example/solr/audio", )