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;
        }
Example #4
0
 public void Add(SolrServerElement configurationElement)
 {
     base.BaseAdd(configurationElement);
 }
Example #5
0
 public void Add(SolrServerElement configurationElement)
 {
     base.BaseAdd(configurationElement);
 }