Open Sven883 opened 1 year ago
Hi, Examine will execute the Lucene query lazily one time when either TotalItemCount is resolved, or when the search results are enumerated. My gut feeling is that you are resolving TotalItemCount first which will seem to indicate the performance problem is reading that property, however what is most likely occurring is that it is executing the search at that time.
I'm not sure if you are doing paging correctly, here's an example: https://github.com/Shazwazza/Examine/blob/release/2.0/src/Examine.Test/Examine.Lucene/Search/FluentApiTests.cs#L2372
Hello!
We're using Umbraco v8.14.1 with Examine dll v1.2.2.0 & Lucene v3.0.3. We're also using this package for our search functionality of the website: https://github.com/skttl/umbraco-fulltextsearch8 I've been debugging for a while using the Umbraco mini profiler and I've noticed one line of code slowing down the whole code by a lot.
First we get the results, no issues there with a maxResults of 12
var results = searcher.CreateQuery().NativeQuery(query.ToString()).Execute(_search.PageLength * _currentPage);
results type is 'Examine.ISearchResults'
The slow code:
result.TotalResults = results.TotalItemCount;
Our indexCreator:
Any ideas how we could fix this problem? Thanks in advance and happy holidays!