updating various references to use examine constants.

This commit is contained in:
Claus
2016-08-16 13:27:46 +02:00
parent fe7efa4fba
commit ca9f3bbd5a
6 changed files with 18 additions and 23 deletions

View File

@@ -1,10 +1,4 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Umbraco.Core
namespace Umbraco.Core
{
public static partial class Constants
{

View File

@@ -130,7 +130,7 @@ namespace Umbraco.Web.PublishedCache.XmlPublishedCache
try
{
//by default use the InternalSearcher
var indexer = eMgr.IndexProviderCollection["InternalIndexer"];
var indexer = eMgr.IndexProviderCollection[Constants.Examine.InternalIndexer];
if (indexer.IndexerData.IncludeNodeTypes.Any() || indexer.IndexerData.ExcludeNodeTypes.Any())
{
LogHelper.Warn<PublishedMediaCache>("The InternalIndexer for examine is configured incorrectly, it should not list any include/exclude node types or field names, it should simply be configured as: " + "<IndexSet SetName=\"InternalIndexSet\" IndexPath=\"~/App_Data/TEMP/ExamineIndexes/Internal/\" />");
@@ -157,7 +157,7 @@ namespace Umbraco.Web.PublishedCache.XmlPublishedCache
try
{
//by default use the InternalSearcher
return eMgr.SearchProviderCollection["InternalSearcher"];
return eMgr.SearchProviderCollection[Constants.Examine.InternalSearcher];
}
catch (FileNotFoundException)
{

View File

@@ -53,12 +53,12 @@ namespace Umbraco.Web.Search
CacheRefresherBase<MemberCacheRefresher>.CacheUpdated += MemberCacheRefresherCacheUpdated;
CacheRefresherBase<ContentTypeCacheRefresher>.CacheUpdated += ContentTypeCacheRefresherCacheUpdated;
var contentIndexer = ExamineManager.Instance.IndexProviderCollection["InternalIndexer"] as UmbracoContentIndexer;
var contentIndexer = ExamineManager.Instance.IndexProviderCollection[Constants.Examine.InternalIndexer] as UmbracoContentIndexer;
if (contentIndexer != null)
{
contentIndexer.DocumentWriting += IndexerDocumentWriting;
}
var memberIndexer = ExamineManager.Instance.IndexProviderCollection["InternalMemberIndexer"] as UmbracoMemberIndexer;
var memberIndexer = ExamineManager.Instance.IndexProviderCollection[Constants.Examine.InternalMemberIndexer] as UmbracoMemberIndexer;
if (memberIndexer != null)
{
memberIndexer.DocumentWriting += IndexerDocumentWriting;

View File

@@ -29,9 +29,9 @@ namespace Umbraco.Web.WebServices
{
var total = Services.MemberService.Count();
var criteria = ExamineManager.Instance.SearchProviderCollection["InternalMemberSearcher"]
var criteria = ExamineManager.Instance.SearchProviderCollection[Constants.Examine.InternalMemberSearcher]
.CreateSearchCriteria().RawQuery("__IndexType:member");
var totalIndexed = ExamineManager.Instance.SearchProviderCollection["InternalMemberSearcher"].Search(criteria);
var totalIndexed = ExamineManager.Instance.SearchProviderCollection[Constants.Examine.InternalMemberSearcher].Search(criteria);
return total == totalIndexed.TotalItemCount;
}
@@ -45,9 +45,9 @@ namespace Umbraco.Web.WebServices
{
var total = Services.MediaService.Count();
var criteria = ExamineManager.Instance.SearchProviderCollection["InternalSearcher"]
var criteria = ExamineManager.Instance.SearchProviderCollection[Constants.Examine.InternalSearcher]
.CreateSearchCriteria().RawQuery("__IndexType:media");
var totalIndexed = ExamineManager.Instance.SearchProviderCollection["InternalSearcher"].Search(criteria);
var totalIndexed = ExamineManager.Instance.SearchProviderCollection[Constants.Examine.InternalSearcher].Search(criteria);
return total == totalIndexed.TotalItemCount;
}
@@ -61,9 +61,9 @@ namespace Umbraco.Web.WebServices
{
var total = Services.ContentService.Count();
var criteria = ExamineManager.Instance.SearchProviderCollection["InternalSearcher"]
var criteria = ExamineManager.Instance.SearchProviderCollection[Constants.Examine.InternalSearcher]
.CreateSearchCriteria().RawQuery("__IndexType:content");
var totalIndexed = ExamineManager.Instance.SearchProviderCollection["InternalSearcher"].Search(criteria);
var totalIndexed = ExamineManager.Instance.SearchProviderCollection[Constants.Examine.InternalSearcher].Search(criteria);
return total == totalIndexed.TotalItemCount;
}

View File

@@ -8,6 +8,7 @@ using System.Xml;
using umbraco.presentation.preview;
using Examine.Providers;
using Examine;
using Umbraco.Core;
namespace umbraco.presentation
{
@@ -183,7 +184,7 @@ namespace umbraco.presentation
{
get
{
return ExamineManager.Instance.SearchProviderCollection["InternalSearcher"];
return ExamineManager.Instance.SearchProviderCollection[Constants.Examine.InternalSearcher];
}
}
@@ -195,7 +196,7 @@ namespace umbraco.presentation
{
get
{
return ExamineManager.Instance.SearchProviderCollection["InternalMemberSearcher"];
return ExamineManager.Instance.SearchProviderCollection[Constants.Examine.InternalMemberSearcher];
}
}
}

View File

@@ -30,11 +30,11 @@ namespace umbraco.MacroEngines
{
//first check in Examine as this is WAY faster
var criteria = ExamineManager.Instance
.SearchProviderCollection["InternalSearcher"]
.SearchProviderCollection[Constants.Examine.InternalSearcher]
.CreateSearchCriteria("media");
var filter = criteria.Id(id);
var results = ExamineManager
.Instance.SearchProviderCollection["InternalSearcher"]
.Instance.SearchProviderCollection[Constants.Examine.InternalSearcher]
.Search(filter.Compile());
if (results.Any())
{
@@ -299,12 +299,12 @@ namespace umbraco.MacroEngines
private BaseIndexProvider GetIndexer()
{
return _indexer ?? ExamineManager.Instance.IndexProviderCollection["InternalIndexer"];
return _indexer ?? ExamineManager.Instance.IndexProviderCollection[Constants.Examine.InternalIndexer];
}
private BaseSearchProvider GetSearcher()
{
return _searcher ?? ExamineManager.Instance.SearchProviderCollection["InternalSearcher"];
return _searcher ?? ExamineManager.Instance.SearchProviderCollection[Constants.Examine.InternalSearcher];
}
private DateTime GetvalueAsDateTime(string key)