Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add full type name for Lucene lock type #14805

Merged
merged 7 commits into from
Dec 19, 2023
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
using Lucene.Net.Search;
using Lucene.Net.Spatial.Prefix;
using Lucene.Net.Spatial.Prefix.Tree;
using Lucene.Net.Store;
using LStore = Lucene.Net.Store;
sebastienros marked this conversation as resolved.
Show resolved Hide resolved
using Microsoft.Extensions.Logging;
using Microsoft.Extensions.Options;
using OrchardCore.Contents.Indexing;
Expand Down Expand Up @@ -362,7 +362,7 @@ private Document CreateLuceneDocument(DocumentIndex documentIndex, LuceneIndexSe
return doc;
}

private BaseDirectory CreateDirectory(string indexName)
private LStore.BaseDirectory CreateDirectory(string indexName)
sebastienros marked this conversation as resolved.
Show resolved Hide resolved
sebastienros marked this conversation as resolved.
Show resolved Hide resolved
{
lock (this)
{
Expand All @@ -376,7 +376,7 @@ private BaseDirectory CreateDirectory(string indexName)
// Lucene is not thread safe on this call.
lock (_synLock)
{
return FSDirectory.Open(path);
return LStore.FSDirectory.Open(path);
sebastienros marked this conversation as resolved.
Show resolved Hide resolved
}
}
}
Expand All @@ -395,7 +395,7 @@ private async Task WriteAsync(string indexName, Action<IndexWriter> action, bool
var config = new IndexWriterConfig(LuceneSettings.DefaultVersion, analyzer)
{
OpenMode = OpenMode.CREATE_OR_APPEND,
WriteLockTimeout = Lock.LOCK_POLL_INTERVAL * 3
WriteLockTimeout = LStore.Lock.LOCK_POLL_INTERVAL * 3
sebastienros marked this conversation as resolved.
Show resolved Hide resolved
};

writer = new IndexWriterWrapper(directory, config);
Expand Down Expand Up @@ -428,7 +428,7 @@ private IndexReaderPool.IndexReaderLease GetReader(string indexName)
var pool = _indexPools.GetOrAdd(indexName, n =>
{
var path = new DirectoryInfo(PathExtensions.Combine(_rootPath, indexName));
var reader = DirectoryReader.Open(FSDirectory.Open(path));
var reader = DirectoryReader.Open(LStore.FSDirectory.Open(path));
sebastienros marked this conversation as resolved.
Show resolved Hide resolved
return new IndexReaderPool(reader);
});

Expand Down