Just upgraded to beta 3 and pleased to see the upgrade of Examine, so that we can now use skip and take to implement pagination on the search results. Unfortunately, it doesn't seem to be working. If I skip any number of records, then 0 are returned - even if there are valid records to return.
You can see the same problem in the Examine Management section in the back office.
New install of beta 3.
Create a document type (allowed as root).
Create 21 pages under Content using that document type each with the same word in them (I used "page", e.g. "Page one", "Page two"...).
Search for "page" in the ExternalIndex under Examine Management in Settings.
First 20 pages are displayed, with 2 pages indicated.
Click on page 2.
No results are shown - I'd expect 1 more result to show on page 2.
To answer the second question first, there is a Take value you can pass, which is the replacement of the MaxResults setting.
Regarding the bug you found, I don't see anything already opened for that at https://github.com/Shazwazza/Examine/issues so I'd definitely recommend opening that there. I'm sure Shannon would love to know that people are already playing with the new release!
Thanks for the quick reply Benjamin! I'll raise that over there.
I'm not convinced the Take value is a replacement for MaxResults. Skip/Take shouldn't affect the TotalItemCount, whereas the MaxResults value did. I'll have a bit more of a play and come back when I'm more certain/convinced otherwise :)
I have a feeling the take is not the way to go.
Looking at the code it seems to be linq that is handling the skip and take and I think this might be bad for performance.
Yes, like that, but you only Take the pageSize - it's the number of records you want returned. I suspect it's more efficient to let Examine do the skip/take, that's certainly the way I'm going.
I suspect you'll find that this doesn't work in beta 3 (see the first comment above) if skip > 0. Will be interested to hear if you see the same thing.
I can conform if you are on page 1 it works fine but when you change to anything above this when no data is returned. All the other values like total results etc seem correct.
Examine Skip/Take
Just upgraded to beta 3 and pleased to see the upgrade of Examine, so that we can now use skip and take to implement pagination on the search results. Unfortunately, it doesn't seem to be working. If I skip any number of records, then 0 are returned - even if there are valid records to return.
You can see the same problem in the Examine Management section in the back office.
As an aside, is there still a MaxResults setting? How do we go about setting it?
To answer the second question first, there is a Take value you can pass, which is the replacement of the MaxResults setting.
Regarding the bug you found, I don't see anything already opened for that at https://github.com/Shazwazza/Examine/issues so I'd definitely recommend opening that there. I'm sure Shannon would love to know that people are already playing with the new release!
FYI - Stuart's Issue is here: https://github.com/Shazwazza/Examine/issues/234. Also, a related issue was raised for Umbraco 9 specifically: https://github.com/umbraco/Umbraco-CMS/issues/11377
Both are now closed for release 9.1.0, so this shouldn't be an issue any longer.
Thanks for the quick reply Benjamin! I'll raise that over there.
I'm not convinced the Take value is a replacement for MaxResults. Skip/Take shouldn't affect the TotalItemCount, whereas the MaxResults value did. I'll have a bit more of a play and come back when I'm more certain/convinced otherwise :)
Got it now thanks Benjamin. MaxResults didn't affect the TotalItemCount in V8 either. Thanks for your help.
Hi Stuart,
What was your solution for this the MaxResults.
V8 Example.
Since the MaxResults has been replaced did you change it to.
V9 Example.
I have a feeling the take is not the way to go. Looking at the code it seems to be linq that is handling the skip and take and I think this might be bad for performance.
What solution did you come up with?
Regards
David
Yes, like that, but you only Take the pageSize - it's the number of records you want returned. I suspect it's more efficient to let Examine do the skip/take, that's certainly the way I'm going.
I suspect you'll find that this doesn't work in beta 3 (see the first comment above) if skip > 0. Will be interested to hear if you see the same thing.
Hi Stuart,
Ok you are right. I looks like there is a bug for this. I will update your ticket you logged regarding this to say I have also tested it.
For future reference here is the correct code which unfortunately isn't working yet.
I can conform if you are on page 1 it works fine but when you change to anything above this when no data is returned. All the other values like total results etc seem correct.
Hi,
I have also followed up by writing two blog articles which might help people trying to get up and running with Examine on Umbraco 9.
Umbraco 9 Examine - Basic Search https://www.umbrajobs.com/blog/posts/2021/june/umbraco-9-examine-basic-search/
Umbraco 9 Examine - Creating a Custom Index https://www.umbrajobs.com/blog/posts/2021/june/umbraco-9-examine-creating-a-custom-index/
Regards
David
How would you increase the MaxResult?
is working on a reply...