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 authored Dec 18, 2023
2 parents 03d208b + c5a0403 commit 5004b13
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions docs/v2/articles/indexing.md
Original file line number Diff line number Diff line change
Expand Up @@ -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<string, object>()
Expand Down Expand Up @@ -252,4 +253,4 @@ private void IndexCommited(object sender, EventArgs e)
{
// Triggered when the index is commited
}
```
```

0 comments on commit 5004b13

Please sign in to comment.