Skip to content

Commit

Permalink
Merge pull request #371 from jakoss/feature/fix-sync-import-docs
Browse files Browse the repository at this point in the history
Fix docs for synchronous index building
  • Loading branch information
Shazwazza committed Dec 20, 2023
1 parent 1025060 commit 9f29ee8
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions docs/articles/indexing.md
Original file line number Diff line number Diff line change
Expand Up @@ -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<string, object>()
Expand Down Expand Up @@ -251,4 +252,4 @@ private void IndexCommited(object sender, EventArgs e)
{
// Triggered when the index is commited
}
```
```

0 comments on commit 9f29ee8

Please sign in to comment.