public SyndicationFeedFormatter GetSearchResultsJson(string q, string namedIndexes, string offset, string limit, string accessKey, string sort) { if (!SecurityHandler.Instance.IsAuthenticated(accessKey, AccessLevel.Read)) { IndexingServiceSettings.SetResponseHeaderStatusCode(401); return(null); } return(this.GetSearchResults(q, namedIndexes, int.Parse(offset, System.Globalization.CultureInfo.InvariantCulture), int.Parse(limit, System.Globalization.CultureInfo.InvariantCulture), sort)); }
public SyndicationFeedFormatter GetNamedIndexes(string accessKey) { if (!SecurityHandler.Instance.IsAuthenticated(accessKey, AccessLevel.Read)) { IndexingServiceSettings.SetResponseHeaderStatusCode(401); return(null); } return(IndexingServiceHandler.Instance.GetNamedIndexes()); }
public virtual void UpdateIndex(string accessKey, SyndicationFeedFormatter formatter) { if (!SecurityHandler.Instance.IsAuthenticated(accessKey, AccessLevel.Modify)) { IndexingServiceSettings.SetResponseHeaderStatusCode(401); return; } IndexingServiceHandler.Instance.UpdateIndex(formatter.Feed); }
public void ResetIndex(string namedIndex, string accessKey) { IndexingServiceSettings.IndexingServiceServiceLog.Debug(string.Format("Reset of index: {0} requested", namedIndex)); if (!SecurityHandler.Instance.IsAuthenticated(accessKey, AccessLevel.Modify)) { IndexingServiceSettings.SetResponseHeaderStatusCode(401); return; } IndexingServiceHandler.Instance.ResetNamedIndex(namedIndex); }
private static void Init() { IndexingServiceSettings.IndexingServiceServiceLog = LogManager.GetLogger(typeof(Niteco.Search.IndexingService.IndexingService).Name); IndexingServiceSettings.LuceneVersion = Lucene.Net.Util.Version.LUCENE_29; IndexingServiceSettings.LoadConfiguration(); IndexingServiceSettings.LoadIndexes(); IndexingServiceSettings.LoadFieldProperties(); IndexingServiceSettings.LoadAnalyzer(); IndexingServiceSettings.IndexingServiceServiceLog.Info("EPiServer Indexing Service Started!"); }
static IndexingServiceSettings() { IndexingServiceSettings._clientElements = new System.Collections.Generic.Dictionary <string, ClientElement>(); IndexingServiceSettings._namedIndexElements = new System.Collections.Generic.Dictionary <string, NamedIndexElement>(); IndexingServiceSettings._namedIndexDirectories = new System.Collections.Generic.Dictionary <string, Lucene.Net.Store.Directory>(); IndexingServiceSettings._referenceIndexDirectories = new System.Collections.Generic.Dictionary <string, Lucene.Net.Store.Directory>(); IndexingServiceSettings._mainDirectoryInfos = new System.Collections.Generic.Dictionary <string, System.IO.DirectoryInfo>(); IndexingServiceSettings._referenceDirectoryInfos = new System.Collections.Generic.Dictionary <string, System.IO.DirectoryInfo>(); IndexingServiceSettings._indexWriteCounters = new System.Collections.Generic.Dictionary <string, int>(); IndexingServiceSettings._indexAnalyzers = new System.Collections.Generic.Dictionary <string, Analyzer>(); IndexingServiceSettings._readerWriterLocks = new System.Collections.Generic.Dictionary <string, ReaderWriterLockSlim>(); IndexingServiceSettings._fieldProperties = new System.Collections.Generic.Dictionary <string, FieldProperties>(); IndexingServiceSettings._lowercaseFields = new System.Collections.Generic.List <string> { DefaultFieldName, IndexingServiceSettings.TitleFieldName, IndexingServiceSettings.DisplayTextFieldName, IndexingServiceSettings.AuthorsFieldName }; IndexingServiceSettings.Init(); }
internal static void HandleServiceError(string errorMessage) { IndexingServiceSettings.IndexingServiceServiceLog.Error(errorMessage); Niteco.Search.IndexingService.IndexingService.OnInternalServerError(null, new InternalServerErrorEventArgs(errorMessage)); IndexingServiceSettings.SetResponseHeaderStatusCode(500); }