Skip to content

Commit

Permalink
feat(doc): bump to v5.0.0, update docs
Browse files Browse the repository at this point in the history
  • Loading branch information
fialafilip committed Apr 2, 2024
1 parent 6f911ca commit 522ca80
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
2 changes: 1 addition & 1 deletion Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<Authors>$(Company)</Authors>
<Copyright>Copyright © $(Company) $([System.DateTime]::Now.Year)</Copyright>
<Trademark>$(Company)™</Trademark>
<VersionPrefix>4.2.0</VersionPrefix>
<VersionPrefix>5.0.0</VersionPrefix>
<VersionSuffix></VersionSuffix>
<PackageLicenseExpression>MIT</PackageLicenseExpression>

Expand Down
11 changes: 7 additions & 4 deletions docs/Search-index-querying.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ public class GlobalSearchResultModel

## Create a search service

Execute a search with a customized Lucene `Query` (like the `MatchAllDocsQuery`) using the ILuceneSearchService.
Execute a search with a customized Lucene `Query` (like the `MatchAllDocsQuery`) using the ILuceneSearchService.
You can use your `GlobalSearchResultModel` as a generic parameter of prepared class template `LuceneSearchResultModel<T>` class to retrieve the most often desired data from `ILuceneSearchService`.

```csharp
Expand All @@ -36,13 +36,16 @@ public class SearchService
private const int MAX_RESULTS = 1000;

private readonly ILuceneSearchService luceneSearchService;
private readonly ILuceneIndexManager luceneIndexManager;
private readonly ExampleSearchIndexingStrategy strategy;

public SearchService(
ILuceneSearchService luceneSearchService,
ILuceneIndexManager luceneIndexManager
ExampleSearchIndexingStrategy strategy)
{
this.luceneSearchService = luceneSearchService;
this.luceneIndexManager = luceneIndexManager;
this.strategy = strategy;
}

Expand All @@ -54,7 +57,7 @@ public class SearchService
string? facet = null,
string? sortBy = null)
{
var index = LuceneIndexStore.Instance.GetRequiredIndex(indexName);
var index = luceneIndexManager.GetRequiredIndex(indexName);
var query = GetTermQuery(searchText, facet, sortBy);

var combinedQuery = new BooleanQuery
Expand Down Expand Up @@ -158,7 +161,7 @@ Create a Controller which uses `SearchService` to display view with search bar.
public class SearchController : Controller
{
private readonly SearchService searchService;

private const string NAME_OF_DEFAULT_INDEX = "Default";

public SearchController(SearchService searchService)
Expand Down Expand Up @@ -278,4 +281,4 @@ The controller retrieves `Index.cshtml` stored in `Views/Search/` solution folde
</ul>
</div>
```
```

0 comments on commit 522ca80

Please sign in to comment.