From 9f29ee8870f59f69845bf56ad7c62de4eedb60ca Mon Sep 17 00:00:00 2001 From: Shannon Date: Wed, 20 Dec 2023 09:49:33 -0700 Subject: [PATCH] Merge pull request #371 from jakoss/feature/fix-sync-import-docs Fix docs for synchronous index building --- docs/articles/indexing.md | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/docs/articles/indexing.md b/docs/articles/indexing.md index 7ad7ca84..bf7b539d 100644 --- a/docs/articles/indexing.md +++ b/docs/articles/indexing.md @@ -115,9 +115,10 @@ myIndex.IndexItem(new ValueSet( Be default all indexing is done asynchronously. If you need to run indexing synchronously you should create a synchronous scope. This is for instance a necessary step for unit tests. ```cs -using (myIndex.ProcessNonAsync()) +using (var luceneIndex = (LuceneIndex)myIndex) +using (var syncIndexContext = luceneIndex.WithThreadingMode(IndexThreadingMode.Synchronous)) { - myIndex.IndexItem(new ValueSet( + luceneIndex.IndexItem(new ValueSet( "SKU987", "Product", new Dictionary() @@ -251,4 +252,4 @@ private void IndexCommited(object sender, EventArgs e) { // Triggered when the index is commited } -``` \ No newline at end of file +```