Skip to content

Commit

Permalink
Fixes #351
Browse files Browse the repository at this point in the history
  • Loading branch information
Shazwazza committed Jun 14, 2024
1 parent c8c9579 commit 7899063
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/Examine.Lucene/Providers/LuceneIndex.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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
{
Expand Down Expand Up @@ -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);

/// <summary>
/// This queues up a commit for the index so that a commit doesn't happen on every individual write since that is quite expensive
/// </summary>
Expand Down
1 change: 1 addition & 0 deletions src/Examine.Lucene/PublicAPI.Unshipped.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
virtual Examine.Lucene.Providers.LuceneIndex.UpdateLuceneDocument(Lucene.Net.Index.Term term, Lucene.Net.Documents.Document doc) -> long?

0 comments on commit 7899063

Please sign in to comment.