U4-7614 - Allow Examine's local temp storage to exist in the current User's temp storage location - useful for Azure

Created by Shannon Deminick 28 Dec 2015, 12:32:55 Updated by Shannon Deminick 16 Mar 2016, 14:13:22

Tags: Needs Docs

Currently the useTempStorage option for Examine will store the local indexes in the ASP.Net Codegen folder. This works 'ok' but it's not ideal because the codegen folder gets cleared out when the /bin folder contents changes which means (depending on your config) that either the index will need to be rebuilt or re-synced.

On Azure websites, each user/site has it's own %temp% location which is persistent for the user, which means it won't get cleared out. This is what AzureDirectory for Lucene uses, for example this location:

System.IO.Path.Combine(Environment.ExpandEnvironmentVariables("%temp%"), "AzureDirectory");

We can make an option to include a custom provider to locate the temp storage folder. Here's what the config would look like:

      <add name="InternalIndexer" type="UmbracoExamine.UmbracoContentIndexer, UmbracoExamine"
           analyzer="Lucene.Net.Analysis.WhitespaceAnalyzer, Lucene.Net"
		   tempStorageDirectory="UmbracoExamine.LocalStorage.AzureLocalStorageDirectory, UmbracoExamine"/>

By default it will still use Codegen folder if useTempStorage is used, but we can specify another option: tempStorageDirectory which needs to be an instance of UmbracoExamine.LocalStorage.ILocalStorageDirectory. We will include an AzureLocalStorageDirectory type in the core for this circumstance... which should be used for UaaS.

NOTE: Just like the useTempStorage option, this would need to be specified for the searcher as well.


Shannon Deminick 28 Dec 2015, 12:38:19

PR here: https://github.com/umbraco/Umbraco-CMS/pull/980

Sebastiaan Janssen 05 Jan 2016, 18:40:12

@Shandem Could this be a 7.3.5 candidate too?

Shannon Deminick 05 Jan 2016, 19:27:00

Yup totally! I'll re-target and then we'll need to cherry pick.

Priority: Normal

Type: Feature (request)

State: Fixed


Difficulty: Normal


Backwards Compatible: True

Fix Submitted:

Affected versions:

Due in version: 7.3.5

Sprint: Sprint 6

Story Points: