private static string GetCoreUrl(SolrServerElement server) { var url = server.Url; if (string.IsNullOrEmpty(url)) { throw new ConfigurationErrorsException("Core url missing in SolrNet core configuration"); } return url; }
private static SolrCore GetCoreFrom(SolrServerElement server) { var id = server.Id ?? Guid.NewGuid().ToString(); var documentType = GetCoreDocumentType(server); var coreUrl = GetCoreUrl(server); UriValidator.ValidateHTTP(coreUrl); return new SolrCore(id, documentType, coreUrl); }
private static Type GetCoreDocumentType(SolrServerElement server) { var documentType = server.DocumentType; if (string.IsNullOrEmpty(documentType)) { throw new ConfigurationErrorsException("Document type missing in SolrNet core configuration"); } Type type; try { type = Type.GetType(documentType); } catch (Exception e) { throw new ConfigurationErrorsException(string.Format("Error getting document type '{0}'", documentType), e); } if (type == null) throw new ConfigurationErrorsException(string.Format("Error getting document type '{0}'", documentType)); return type; }
public void Add(SolrServerElement configurationElement) { base.BaseAdd(configurationElement); }
public void Add(SolrServerElement configurationElement) { base.BaseAdd(configurationElement); }