diff --git a/src/Umbraco.Tests/Umbraco.Tests.csproj b/src/Umbraco.Tests/Umbraco.Tests.csproj
index c6895268ca..60821ba828 100644
--- a/src/Umbraco.Tests/Umbraco.Tests.csproj
+++ b/src/Umbraco.Tests/Umbraco.Tests.csproj
@@ -56,7 +56,7 @@
True
- ..\packages\Examine.2.0.0-beta012\lib\net45\Examine.dll
+ ..\packages\Examine.2.0.0-beta013\lib\net45\Examine.dll
True
diff --git a/src/Umbraco.Tests/UmbracoExamine/IndexTest.cs b/src/Umbraco.Tests/UmbracoExamine/IndexTest.cs
index b0070e8b58..c4b2f4a6ba 100644
--- a/src/Umbraco.Tests/UmbracoExamine/IndexTest.cs
+++ b/src/Umbraco.Tests/UmbracoExamine/IndexTest.cs
@@ -7,6 +7,7 @@ using Examine.LuceneEngine.Config;
using Examine.LuceneEngine.Providers;
using Examine.LuceneEngine.SearchCriteria;
using Examine.SearchCriteria;
+using Examine.Session;
using Lucene.Net.Analysis.Standard;
using Lucene.Net.Index;
using Lucene.Net.Search;
@@ -115,6 +116,7 @@ namespace Umbraco.Tests.UmbracoExamine
{
using (var luceneDir = new RAMDirectory())
using (var indexer = IndexInitializer.GetUmbracoIndexer(ProfilingLogger, luceneDir))
+ using (var session = new ThreadScopedIndexSession(indexer.SearcherContext))
{
var searcher = indexer.GetSearcher();
@@ -131,6 +133,12 @@ namespace Umbraco.Tests.UmbracoExamine
//ensure it's indexed
indexer.ReIndexNode(node, IndexTypes.Media);
+ session.WaitForChanges();
+
+ //now ensure it's deleted
+ var results = searcher.Search(searcher.CreateSearchCriteria().Id(2112).Compile());
+ Assert.AreEqual(1, results.Count());
+
//change the parent node id to be the one it used to exist under
var existingCriteria = indexer.IndexerData;
indexer.IndexerData = new IndexCriteria(existingCriteria.StandardFields, existingCriteria.UserFields, existingCriteria.IncludeNodeTypes, existingCriteria.ExcludeNodeTypes,
@@ -148,8 +156,10 @@ namespace Umbraco.Tests.UmbracoExamine
indexer.IndexerData = new IndexCriteria(existingCriteria.StandardFields, existingCriteria.UserFields, existingCriteria.IncludeNodeTypes, existingCriteria.ExcludeNodeTypes,
null);
+ session.WaitForChanges();
+
//now ensure it's deleted
- var results = searcher.Search(searcher.CreateSearchCriteria().Id(2112).Compile());
+ results = searcher.Search(searcher.CreateSearchCriteria().Id(2112).Compile());
Assert.AreEqual(0, results.Count());
}
}
diff --git a/src/Umbraco.Tests/packages.config b/src/Umbraco.Tests/packages.config
index e0fcc875aa..a4f996aad3 100644
--- a/src/Umbraco.Tests/packages.config
+++ b/src/Umbraco.Tests/packages.config
@@ -2,7 +2,7 @@
-
+
diff --git a/src/Umbraco.Web.UI/Umbraco.Web.UI.csproj b/src/Umbraco.Web.UI/Umbraco.Web.UI.csproj
index 71aded5e55..94b9fb5882 100644
--- a/src/Umbraco.Web.UI/Umbraco.Web.UI.csproj
+++ b/src/Umbraco.Web.UI/Umbraco.Web.UI.csproj
@@ -121,7 +121,7 @@
True
- ..\packages\Examine.2.0.0-beta012\lib\net45\Examine.dll
+ ..\packages\Examine.2.0.0-beta013\lib\net45\Examine.dll
True
diff --git a/src/Umbraco.Web.UI/packages.config b/src/Umbraco.Web.UI/packages.config
index 9990510cd3..67a8067584 100644
--- a/src/Umbraco.Web.UI/packages.config
+++ b/src/Umbraco.Web.UI/packages.config
@@ -3,7 +3,7 @@
-
+
diff --git a/src/Umbraco.Web/Umbraco.Web.csproj b/src/Umbraco.Web/Umbraco.Web.csproj
index fe1e006701..c8d715911e 100644
--- a/src/Umbraco.Web/Umbraco.Web.csproj
+++ b/src/Umbraco.Web/Umbraco.Web.csproj
@@ -114,7 +114,7 @@
..\packages\dotless.1.4.1.0\lib\dotless.Core.dll
- ..\packages\Examine.2.0.0-beta012\lib\net45\Examine.dll
+ ..\packages\Examine.2.0.0-beta013\lib\net45\Examine.dll
True
diff --git a/src/Umbraco.Web/packages.config b/src/Umbraco.Web/packages.config
index 227d0b7dfc..92b488bcfe 100644
--- a/src/Umbraco.Web/packages.config
+++ b/src/Umbraco.Web/packages.config
@@ -3,7 +3,7 @@
-
+
diff --git a/src/UmbracoExamine/BaseUmbracoIndexer.cs b/src/UmbracoExamine/BaseUmbracoIndexer.cs
index b0d2af6762..a373cdecc8 100644
--- a/src/UmbracoExamine/BaseUmbracoIndexer.cs
+++ b/src/UmbracoExamine/BaseUmbracoIndexer.cs
@@ -34,17 +34,13 @@ namespace UmbracoExamine
/// Used to store the path of a content object
///
public const string IndexPathFieldName = "__Path";
-
public const string NodeTypeAliasFieldName = "__NodeTypeAlias";
public const string IconFieldName = "__Icon";
-
///
/// The prefix added to a field when it is duplicated in order to store the original raw value.
///
public const string RawFieldPrefix = "__Raw_";
- #region Constructors
-
///
/// Default constructor
///
@@ -52,6 +48,7 @@ namespace UmbracoExamine
: base()
{
ProfilingLogger = ApplicationContext.Current.ProfilingLogger;
+ _configBased = true;
}
protected BaseUmbracoIndexer(
@@ -67,8 +64,7 @@ namespace UmbracoExamine
ProfilingLogger = profilingLogger;
}
- #endregion
-
+ private bool _configBased = false;
private readonly LocalTempStorageIndexer _localTempStorageIndexer = new LocalTempStorageIndexer();
///
@@ -98,9 +94,7 @@ namespace UmbracoExamine
new StaticField( "nodeTypeAlias", FieldIndexTypes.ANALYZED, false, string.Empty),
new StaticField( "path", FieldIndexTypes.NOT_ANALYZED, false, string.Empty)
};
-
- #region Properties
-
+
protected ProfilingLogger ProfilingLogger { get; private set; }
public bool UseTempStorage
@@ -125,9 +119,7 @@ namespace UmbracoExamine
///
/// the supported indexable types
///
- protected abstract IEnumerable SupportedTypes { get; }
-
- #endregion
+ protected abstract IEnumerable SupportedTypes { get; }
#region Initialize
@@ -270,14 +262,21 @@ namespace UmbracoExamine
/// Returns true if the Umbraco application is in a state that we can initialize the examine indexes
///
///
+ ///
+ /// This only affects indexers that are config file based, if an index was created via code then
+ /// this has no affect, it is assumed the index would not be created if it could not be initialized.
+ ///
protected bool CanInitialize()
{
- //We need to check if we actually can initialize, if not then don't continue
- if (ApplicationContext.Current == null
- || !ApplicationContext.Current.IsConfigured
- || !ApplicationContext.Current.DatabaseContext.IsDatabaseConfigured)
+ if (_configBased)
{
- return false;
+ //We need to check if we actually can initialize, if not then don't continue
+ if (ApplicationContext.Current == null
+ || ApplicationContext.Current.IsConfigured == false
+ || ApplicationContext.Current.DatabaseContext.IsDatabaseConfigured == false)
+ {
+ return false;
+ }
}
return true;
@@ -441,15 +440,34 @@ namespace UmbracoExamine
base.AddSingleNodeToIndex(node, type);
}
+ protected override void OnTransformingIndexValues(TransformingIndexDataEventArgs e)
+ {
+ base.OnTransformingIndexValues(e);
+
+ if (e.OriginalValues.ContainsKey("path"))
+ {
+ e.IndexItem.ValueSet.Values[IndexPathFieldName] = new List