The namespace has to be the same as in Infrastructure/Examine otherwise linux build fails.
28 lines
663 B
C#
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;
|
|
}
|
|
}
|
|
}
|
|
}
|