Files
Umbraco-CMS/src/Umbraco.Examine.Lucene/LuceneRAMDirectoryFactory.cs
Shannon Deminick eb70bc313a Implements Examine/Lucene index syncing for use on Azure (#10386)
* Updates to latest examine, ensures indexes are unlocked on startup, adds more info to the diagnostics and allows for the new sync directory factory to work.

* Gets index syncing working correct and fixes reindexing to not overprocess indexes

* fix duplicate package ref

* rebuilds empty indexes and fixes config with enum

* missing file
2021-06-07 14:58:49 +02:00

31 lines
794 B
C#

// Copyright (c) Umbraco.
// See LICENSE for more details.
using System;
using System.IO;
using System.Threading;
using Examine.Lucene.Directories;
using Examine.Lucene.Providers;
using Lucene.Net.Store;
using Directory = Lucene.Net.Store.Directory;
namespace Umbraco.Cms.Infrastructure.Examine
{
public class LuceneRAMDirectoryFactory : DirectoryFactoryBase
{
public LuceneRAMDirectoryFactory()
{
}
protected override Directory CreateDirectory(LuceneIndex luceneIndex, bool forceUnlock)
=> new RandomIdRAMDirectory();
private class RandomIdRAMDirectory : RAMDirectory
{
private readonly string _lockId = Guid.NewGuid().ToString();
public override string GetLockID() => _lockId;
}
}
}