From 524cda70681df098efb1f78326709684c6a36481 Mon Sep 17 00:00:00 2001 From: Sammi Sinno Date: Tue, 21 Nov 2023 11:55:18 -0500 Subject: [PATCH] Update README.md --- README.md | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 92f7457..6de24d1 100644 --- a/README.md +++ b/README.md @@ -9,7 +9,24 @@ It will need to be wired up with DI like so: services.AddLuceneProvider(); services.AddLuceneDocumentMapper(); - services.AddScoped(); + services.AddSingleton(); +``` + +In the configure app method in the Startup.cs file you will need to set up a config for each index and add the close session middleware: + +```c# +varr indexConfigManager = serviceProvider.GetService(); + indexConfigManager.AddConfiguration(new LuceneConfig() + { + BatchSize = 500000, + LuceneVersion = LuceneVersion.LUCENE_48, + IndexTypes = new List() + { + typeof(BlogPost), + } + }); + + app.UseMiddleware(); ``` You'll also want to setup a LocalIndexPathFactory class that implements `ILocalIndexPathFactory` and add it as an injected service.