I'm implementing an examine search system on umbraco 4.0.3 and so far it's really great. I have a fast and stable front end search system for a 3.5k node site.
Where I'm stuck is implementing paging. I can see that the "Skip" method is supposed to skip to a point in the search results, but it's just not working.
Lets say I have the following...
var searchResults = ExamineManager.Instance.SearchProviderCollection["SiteIndex"].Search(queryText, 100, true);
_totalResults = searchResults.TotalItemCount;
Then I would presume the Skip method should limit the results like this...
searchResults.Skip(15);
But although it compiles correctly, it makes no difference to the results set that is returned. Am I missing something fundamental here?
In the old umbSearch system I would have done this...
We're using version 50650 from source. I've created a work-around for the solution by setting up a counter and increasing it for each result as they're listed out. It works very well. It only adds the result to the screen if it's result number falls inside a range of numbers for that particular page.
The results in debugger don't show duplicates. TotalItemCount remains the same regardless of what I apply with Step.
Do you have an example of it running?
I've also made a simple snap-in panel for the Developer section of umbraco for testing the Examine system. You're welcome to a copy when I've polished it. I'm also trying to extend Examine with PDFBox to enable PDF indexing - wish me luck :)
This one took me a while to figure out how to use for paging. Finally found this example from Slace's dddMelbourne demo in case anyone else is struggling with it:
Umbraco Examine and paging
Hi all,
I'm implementing an examine search system on umbraco 4.0.3 and so far it's really great. I have a fast and stable front end search system for a 3.5k node site.
Where I'm stuck is implementing paging. I can see that the "Skip" method is supposed to skip to a point in the search results, but it's just not working.
Lets say I have the following...
var searchResults = ExamineManager.Instance.SearchProviderCollection["SiteIndex"].Search(queryText, 100, true);
_totalResults = searchResults.TotalItemCount;
Then I would presume the Skip method should limit the results like this...
searchResults.Skip(15);
But although it compiles correctly, it makes no difference to the results set that is returned. Am I missing something fundamental here?
In the old umbSearch system I would have done this...
for (int i = pageStart; i < pageEnd; i++)
{
Document doc = hits.Doc(i);
etc...
Any ideas?
Thanks
Neil
Which version of Examine are you using? The current builds in the repository works fine with the Skip method (we've got a unit test which ensures it).
If you inspect the results in the debugger do the results appear to be duplicates?
Hi,
We're using version 50650 from source. I've created a work-around for the solution by setting up a counter and increasing it for each result as they're listed out. It works very well. It only adds the result to the screen if it's result number falls inside a range of numbers for that particular page.
The results in debugger don't show duplicates. TotalItemCount remains the same regardless of what I apply with Step.
Do you have an example of it running?
I've also made a simple snap-in panel for the Developer section of umbraco for testing the Examine system. You're welcome to a copy when I've polished it. I'm also trying to extend Examine with PDFBox to enable PDF indexing - wish me luck :)
n
This file has a unit test for paging:http://examine.codeplex.com/SourceControl/changeset/view/51946#1078835
Also, we're working on adding PDF indexing OOTB, target is codegarden 10 release for that.
Thanks Slace - I'll check it out. n
This one took me a while to figure out how to use for paging. Finally found this example from Slace's dddMelbourne demo in case anyone else is struggling with it:
Have a feeling Neil was running Skip without assigning the return value - that's what got me anyway.
Note on the above - You may wish to multiply pageNumber by 'results per page'.
is working on a reply...