Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 0e06c47

Browse files
authoredJan 20, 2025··
Regression fix: searcher skip 10k not possible (#17977)
* Add new examine lucene option to restore functionality of earlier version * Add reason comment for maxSkipTake
1 parent dab9323 commit 0e06c47

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed
 

‎Directory.Packages.props

+1-1
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@
4545
<PackageVersion Include="Asp.Versioning.Mvc" Version="8.1.0" />
4646
<PackageVersion Include="Asp.Versioning.Mvc.ApiExplorer" Version="8.1.0" />
4747
<PackageVersion Include="Dazinator.Extensions.FileProviders" Version="2.0.0" />
48-
<PackageVersion Include="Examine" Version="3.5.0" />
48+
<PackageVersion Include="Examine" Version="3.6.0" />
4949
<PackageVersion Include="Examine.Core" Version="3.5.0" />
5050
<PackageVersion Include="HtmlAgilityPack" Version="1.11.71" />
5151
<PackageVersion Include="JsonPatch.Net" Version="3.1.1" />

‎src/Umbraco.Cms.Api.Management/Controllers/Searcher/QuerySearcherController.cs

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
using Asp.Versioning;
22
using Examine;
3+
using Examine.Lucene.Search;
34
using Examine.Search;
45
using Lucene.Net.QueryParsers.Classic;
56
using Microsoft.AspNetCore.Http;
@@ -52,12 +53,13 @@ public async Task<ActionResult<PagedViewModel<SearchResultResponseModel>>> Query
5253
ISearchResults results;
5354

5455
// NativeQuery will work for a single word/phrase too (but depends on the implementation) the lucene one will work.
56+
// Due to examine changes we need to supply the skipTakeMaxResults, see https://github.com/umbraco/Umbraco-CMS/issues/17920 for more info
5557
try
5658
{
5759
results = searcher
5860
.CreateQuery()
5961
.NativeQuery(term)
60-
.Execute(QueryOptions.SkipTake(skip, take));
62+
.Execute(new LuceneQueryOptions(skip, take, skipTakeMaxResults: skip + take));
6163
}
6264
catch (ParseException)
6365
{

0 commit comments

Comments
 (0)
Please sign in to comment.