Skip to content

Commit 9c8e981

Browse files
committed
Release 3.1.0
1 parent 1585f06 commit 9c8e981

File tree

2 files changed

+16
-14
lines changed

2 files changed

+16
-14
lines changed

CHANGELOG.md

+9-1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,13 @@ All notable changes to this project will be documented in this file.
44

55
The format is based on [Keep a Changelog](https://keepachangelog.com/) and this project adheres to [Semantic Versioning](https://semver.org/).
66

7+
## [3.1.0] - 2023-06-22
8+
### Added
9+
* Easier paging of `ISearchResults` with new `Page` extensions
10+
11+
### Changed
12+
* `SearchHelper` is now obsolete and will be removed in a future version, use extensions instead
13+
714
## [3.0.2] - 2023-02-08
815
### Added
916
* Overload for the `Page` method within `SearchHelper` that returns a page count
@@ -91,7 +98,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/) and this
9198
### Added
9299
* Initial release of Search Extensions for Umbraco 8.1
93100

94-
[Unreleased]: https://github.com/callumbwhyte/umbraco-search-extensions/compare/release-3.0.2...HEAD
101+
[Unreleased]: https://github.com/callumbwhyte/umbraco-search-extensions/compare/release-3.1.0...HEAD
102+
[3.1.0]: https://github.com/callumbwhyte/umbraco-search-extensions/compare/release-3.0.2...release-3.1.0
95103
[3.0.2]: https://github.com/callumbwhyte/umbraco-search-extensions/compare/release-3.0.1...release-3.0.2
96104
[3.0.1]: https://github.com/callumbwhyte/umbraco-search-extensions/compare/release-3.0.0...release-3.0.1
97105
[3.0.0]: https://github.com/callumbwhyte/umbraco-search-extensions/compare/release-2.0.0...release-3.0.0

README.md

+7-13
Original file line numberDiff line numberDiff line change
@@ -70,31 +70,25 @@ query.And().GroupedOr(string[] fields, string culture)
7070

7171
### Searching
7272

73-
The `SearchHelper` class contains logic for commonly performed actions when searching, particularly helpful for creating paged search functionality.
74-
75-
The `Get<T>` method gets all results for a query cast to a given type, including `IPublishedContent`.
73+
The `Page<T>` extension methods efficiently get a given number of items *(`perPage`)* at a specific position *(`page`)* from Examine's `ISearchResults`. An optional type constraint can be added to also return paged results cast to `IPublishedContent`.
7674

7775
```
7876
var query = searcher.CreatePublishedQuery();
7977
80-
var results = searchHelper.Get<T>(query, out int totalResults);
78+
var searchResults = query.Execute();
79+
80+
var results = searchResults.Page<T>(query, int page, int perPage, out int totalPages, out int totalResults);
8181
```
8282

83-
The `Page<T>` method efficiently gets a given number of items *(`perPage`)* at a specific position *(`page`)* in the results for a query. An optional type constraint can be added to also return paged results cast to `IPublishedContent`.
83+
The total number of pages and results are exposed as an `out` parameter, but can be disgarded if not needed like so:
8484

8585
```
86-
var query = searcher.CreatePublishedQuery();
87-
88-
var results = searchHelper.Page<T>(query, int page, int perPage, out int totalResults);
86+
searchResults.Page<T>(query, int page, int perPage, out _, out _);
8987
```
9088

91-
All helper methods provide the total number of results found as an `out` parameter.
92-
9389
### Results
9490

95-
For more specific cases where the `SearchHelper` is not appropriate, the same features for accessing strongly typed results are available as extension methods.
96-
97-
An entire results collection can be cast to a type like this:
91+
An entire results collection can be cast to a list of a given type like this:
9892

9993
```
10094
var results = query.Execute().GetResults<T>();

0 commit comments

Comments
 (0)