Regression fix: searcher skip 10k not possible (#17977)

* Add new examine lucene option to restore functionality of earlier version

* Add reason comment for maxSkipTake
This commit is contained in:
Sven Geusens
2025-01-20 14:00:46 +01:00
committed by GitHub
parent dab932329b
commit 0e06c47ed7
2 changed files with 4 additions and 2 deletions

View File

@@ -45,7 +45,7 @@
<PackageVersion Include="Asp.Versioning.Mvc" Version="8.1.0" />
<PackageVersion Include="Asp.Versioning.Mvc.ApiExplorer" Version="8.1.0" />
<PackageVersion Include="Dazinator.Extensions.FileProviders" Version="2.0.0" />
<PackageVersion Include="Examine" Version="3.5.0" />
<PackageVersion Include="Examine" Version="3.6.0" />
<PackageVersion Include="Examine.Core" Version="3.5.0" />
<PackageVersion Include="HtmlAgilityPack" Version="1.11.71" />
<PackageVersion Include="JsonPatch.Net" Version="3.1.1" />

View File

@@ -1,5 +1,6 @@
using Asp.Versioning;
using Examine;
using Examine.Lucene.Search;
using Examine.Search;
using Lucene.Net.QueryParsers.Classic;
using Microsoft.AspNetCore.Http;
@@ -52,12 +53,13 @@ public class QuerySearcherController : SearcherControllerBase
ISearchResults results;
// NativeQuery will work for a single word/phrase too (but depends on the implementation) the lucene one will work.
// Due to examine changes we need to supply the skipTakeMaxResults, see https://github.com/umbraco/Umbraco-CMS/issues/17920 for more info
try
{
results = searcher
.CreateQuery()
.NativeQuery(term)
.Execute(QueryOptions.SkipTake(skip, take));
.Execute(new LuceneQueryOptions(skip, take, skipTakeMaxResults: skip + take));
}
catch (ParseException)
{