diff --git a/src/Umbraco.Tests/Umbraco.Tests.csproj b/src/Umbraco.Tests/Umbraco.Tests.csproj index a37e7d3bc7..142471a451 100644 --- a/src/Umbraco.Tests/Umbraco.Tests.csproj +++ b/src/Umbraco.Tests/Umbraco.Tests.csproj @@ -290,6 +290,7 @@ + True diff --git a/src/Umbraco.Tests/UmbracoExamine/IndexInitializer.cs b/src/Umbraco.Tests/UmbracoExamine/IndexInitializer.cs index 111e432b46..aac11954ea 100644 --- a/src/Umbraco.Tests/UmbracoExamine/IndexInitializer.cs +++ b/src/Umbraco.Tests/UmbracoExamine/IndexInitializer.cs @@ -2,6 +2,7 @@ using System.Linq; using Examine; using Examine.LuceneEngine.Providers; +using Lucene.Net.Analysis; using Lucene.Net.Analysis.Standard; using UmbracoExamine; using UmbracoExamine.PDF; @@ -13,9 +14,16 @@ namespace Umbraco.Tests.UmbracoExamine /// internal static class IndexInitializer { - public static UmbracoContentIndexer GetUmbracoIndexer(Lucene.Net.Store.Directory luceneDir) + public static UmbracoContentIndexer GetUmbracoIndexer( + Lucene.Net.Store.Directory luceneDir, + Analyzer analyzer = null) { + if (analyzer == null) + { + analyzer = new StandardAnalyzer(Lucene.Net.Util.Version.LUCENE_29); + } + var i = new UmbracoContentIndexer(new IndexCriteria( new[] { @@ -33,7 +41,7 @@ namespace Umbraco.Tests.UmbracoExamine -1), luceneDir, //custom lucene directory new TestDataService(), - new StandardAnalyzer(Lucene.Net.Util.Version.LUCENE_29), + analyzer, false); //i.IndexSecondsInterval = 1; @@ -42,10 +50,13 @@ namespace Umbraco.Tests.UmbracoExamine return i; } - public static UmbracoExamineSearcher GetUmbracoSearcher(Lucene.Net.Store.Directory luceneDir) + public static UmbracoExamineSearcher GetUmbracoSearcher(Lucene.Net.Store.Directory luceneDir, Analyzer analyzer = null) { - - return new UmbracoExamineSearcher(luceneDir, new StandardAnalyzer(Lucene.Net.Util.Version.LUCENE_29)); + if (analyzer == null) + { + analyzer = new StandardAnalyzer(Lucene.Net.Util.Version.LUCENE_29); + } + return new UmbracoExamineSearcher(luceneDir, analyzer); } //public static SimpleDataIndexer GetSimpleIndexer(Lucene.Net.Store.Directory luceneDir) //{ diff --git a/src/Umbraco.Web/DefaultPublishedMediaStore.cs b/src/Umbraco.Web/DefaultPublishedMediaStore.cs index afe1aa24d7..5b530605f3 100644 --- a/src/Umbraco.Web/DefaultPublishedMediaStore.cs +++ b/src/Umbraco.Web/DefaultPublishedMediaStore.cs @@ -149,8 +149,10 @@ namespace Umbraco.Web internal IPublishedContent ConvertFromSearchResult(SearchResult searchResult) { - //TODO: Some fields will not be included, that just the way it is unfortunatley until this is fixed: - // http://examine.codeplex.com/workitem/10350 + //NOTE: Some fields will not be included if the config section for the internal index has been + //mucked around with. It should index everything and so the index definition should simply be: + // + var values = new Dictionary(searchResult.Fields); //we need to ensure some fields exist, because of the above issue