Files
Umbraco-CMS/src/Umbraco.Examine.Lucene/LuceneRAMDirectoryFactory.cs
Mole efe4162027 Align Umbraco.Examine.Lucene to Umbraco.Cms.Infrastructure.Examine
The namespace has to be the same as in Infrastructure/Examine otherwise linux build fails.
2021-02-15 14:45:02 +01:00

28 lines
663 B
C#

// Copyright (c) Umbraco.
// See LICENSE for more details.
using System;
using Lucene.Net.Store;
namespace Umbraco.Cms.Infrastructure.Examine
{
public class LuceneRAMDirectoryFactory : ILuceneDirectoryFactory
{
public LuceneRAMDirectoryFactory()
{
}
public Lucene.Net.Store.Directory CreateDirectory(string indexName) => new RandomIdRAMDirectory();
private class RandomIdRAMDirectory : RAMDirectory
{
private readonly string _lockId = Guid.NewGuid().ToString();
public override string GetLockId()
{
return _lockId;
}
}
}
}