def get_fields(self, collection_or_core_name): api = SolrApi(SOLR_URL.get(), self.user, SECURITY_ENABLED.get()) try: field_data = api.fields(collection_or_core_name) fields = self._format_flags(field_data['schema']['fields']) except Exception as e: LOG.warn('/luke call did not succeed: %s' % e) try: fields = api.schema_fields(collection_or_core_name) fields = Collection2._make_luke_from_schema_fields(fields) except: LOG.exception( _('Could not fetch fields for collection %s.') % collection_or_core_name) raise PopupException( _('Could not fetch fields for collection %s. See logs for more info.' ) % collection_or_core_name) try: uniquekey = api.uniquekey(collection_or_core_name) except: LOG.exception( _('Could not fetch unique key for collection %s.') % collection_or_core_name) raise PopupException( _('Could not fetch unique key for collection %s. See logs for more info.' ) % collection_or_core_name) return uniquekey, fields
def luke(self, collection): fields = self.schema_fields(collection) return {'fields': Collection2._make_luke_from_schema_fields(fields)}
def luke(self, collection): fields = self.schema_fields(collection) return {'fields': Collection2._make_luke_from_schema_fields(fields)}