Пример #1
0
 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;
 }
Пример #2
0
 private static SolrCore GetCoreFrom(SolrServerElement server)
 {
     var id = server.Id ?? Guid.NewGuid().ToString();
     var documentType = GetCoreDocumentType(server);
     var coreUrl = GetCoreUrl(server);
     ValidateUrl(coreUrl);
     return new SolrCore(id, documentType, coreUrl);
 }
Пример #3
0
        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;
        }
Пример #4
0
 public void Add(SolrServerElement configurationElement)
 {
     base.BaseAdd(configurationElement);
 }
Пример #5
0
 public void Add(SolrServerElement configurationElement)
 {
     base.BaseAdd(configurationElement);
 }