diff --git a/docs/v2/articles/indexing.md b/docs/v2/articles/indexing.md index 94632837..34ee2dad 100644 --- a/docs/v2/articles/indexing.md +++ b/docs/v2/articles/indexing.md @@ -116,9 +116,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() @@ -252,4 +253,4 @@ private void IndexCommited(object sender, EventArgs e) { // Triggered when the index is commited } -``` \ No newline at end of file +```