diff --git a/src/Examine.Lucene/Providers/LuceneIndex.cs b/src/Examine.Lucene/Providers/LuceneIndex.cs index 66958bf2..e9f0fcfa 100644 --- a/src/Examine.Lucene/Providers/LuceneIndex.cs +++ b/src/Examine.Lucene/Providers/LuceneIndex.cs @@ -18,6 +18,7 @@ using Lucene.Net.Analysis.Standard; using Examine.Lucene.Indexing; using Examine.Lucene.Directories; +using static Lucene.Net.Queries.Function.ValueSources.MultiFunction; namespace Examine.Lucene.Providers { @@ -757,9 +758,11 @@ protected virtual void AddDocument(Document doc, ValueSet valueSet) } // TODO: try/catch with OutOfMemoryException (see docs on UpdateDocument), though i've never seen this in real life - _latestGen = IndexWriter.UpdateDocument(new Term(ExamineFieldNames.ItemIdFieldName, valueSet.Id), doc); + _latestGen = UpdateLuceneDocument(new Term(ExamineFieldNames.ItemIdFieldName, valueSet.Id), doc); } + protected virtual long? UpdateLuceneDocument(Term term, Document doc) => IndexWriter.UpdateDocument(term, doc); + /// /// This queues up a commit for the index so that a commit doesn't happen on every individual write since that is quite expensive /// diff --git a/src/Examine.Lucene/PublicAPI.Unshipped.txt b/src/Examine.Lucene/PublicAPI.Unshipped.txt index e69de29b..b31f1482 100644 --- a/src/Examine.Lucene/PublicAPI.Unshipped.txt +++ b/src/Examine.Lucene/PublicAPI.Unshipped.txt @@ -0,0 +1 @@ +virtual Examine.Lucene.Providers.LuceneIndex.UpdateLuceneDocument(Lucene.Net.Index.Term term, Lucene.Net.Documents.Document doc) -> long? \ No newline at end of file