Skip to content

Commit

Permalink
Cleaning up Lucene entries when updating the page. Closes #280.
Browse files Browse the repository at this point in the history
  • Loading branch information
impworks committed Feb 1, 2024
1 parent 262794b commit acf3b48
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/Bonsai/Code/Services/Search/LuceneNetService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,9 @@ public Task InitializeAsync()
/// </summary>
public Task AddPageAsync(Page page)
{
var query = new TermQuery(new Term("Id", page.Id.ToString()));
_writer.DeleteDocuments(query);

var luceneDoc = new LuceneDocument(page);
_writer.AddDocument(luceneDoc.Fields);
_writer.Commit();
Expand Down

0 comments on commit acf3b48

Please sign in to comment.