public void AddUpdatedIndexesToGlobalSearchIndex(GlobalSearchAppDomainCreationResult domainData) { try { if (domainData != null) { var domainName = domainData.AppDomain.FriendlyName; using (var dir = new SimpleFSDirectory(GetLuceneDirectory(domainName))) { _indexWriter.AddIndexesNoOptimize(dir); } } _indexWriter.Commit(); _indexWriter.MaybeMerge(); } catch (Exception ex) { if (domainData != null && (domainData.AppDomain != null && !domainData.AppDomain.IsFinalizingForUnload())) { DeleteTemporaryDirectory(domainData.AppDomain.FriendlyName); AppDomain.Unload(domainData.AppDomain); } Logger.Log(LogSeverity.Error, "Global Search Error", "/GlobalSearchService/AddUpdatedIndexesToGlobalSearchIndex/" + ex); _error = "Global Search Error : " + ex.Message; throw; } }
public void DisposeCreatedAppdomain(GlobalSearchAppDomainCreationResult domainData) { if (domainData == null) { return; } try { var domainName = domainData.AppDomain.FriendlyName; domainData.DynamicAssembly.Dispose(); AppDomain.Unload(domainData.AppDomain); DeleteTemporaryDirectory(domainName); } catch (Exception ex) { if (domainData.AppDomain != null && !domainData.AppDomain.IsFinalizingForUnload()) { DeleteTemporaryDirectory(domainData.AppDomain.FriendlyName); AppDomain.Unload(domainData.AppDomain); } Logger.Log(LogSeverity.Error, "Global Search Error", "/GlobalSearchService/DisposeCreatedAppdomain/" + ex); throw; } }
public bool UppdateGlobalSearchForProcess(ProcessGSInfo process, GlobalSearchAppDomainCreationResult domainData) { if (process == null) { return false; } try { if (domainData == null || domainData.AppDomain == null) { throw new VeyronException("Given Domain is Null"); } var result = domainData.DynamicAssembly.UpdateGlobalSearchProcess(process.IsSystem, process.SystemName, process.DisplayName, process.FieldName.ToArray()); return result; } catch (Exception ex) { if (domainData != null && domainData.AppDomain != null && !domainData.AppDomain.IsFinalizingForUnload()) { DeleteTemporaryDirectory(domainData.AppDomain.FriendlyName); AppDomain.Unload(domainData.AppDomain); } Logger.Log(LogSeverity.Error, "Global Search Error", "/GlobalSearchService/UppdateGlobalSearchForProcess/" + ex); _error = "Global Search Error : " + ex.Message; throw; } }