Now a day I am
working on SharePoint 2013 Search and found a common issue reported by many of
users i.e. Result count is inconsistent, see screenshot
The result count is different on each page while use pagination on search result page.
Solution:
Detailed information for Display templates on MSDN
The result count is different on each page while use pagination on search result page.
Solution:
SharePoint 2013 introduces a new technique for presenting
search results: Display Templates. Search result is coming via “Display template”;
this is a property of Search Result web part. In 2013 the new rendering
techniques have several distinct advantages.
- Display
templates are HTML and JavaScript rather than XSL
- Display
templates are configured for the Site and Site Collection rather than for
a Web part
- Display
templates are applied with rules and logic
- Display
templates are applied to individual result items, not the entire result
set
- Display Templates are used for Results of all kinds, search results, content by search results, and refiners
- And many more….
Detailed information for Display templates on MSDN
On each post back, search API’s are
called by OOB search results pagination controls and SharePoint returns
different search counts for same query. Now to standardize the search results
count on each search page, client side caching can be used to store the search
results of the first page and use the same result count for the remaining
pages. This is supported in all HTML5 supported browsers.
Use the cache to maintain the total
result count via change the Default Template, follow below steps to
change
1- Go To Site
Actions - > Site Settings - > Master Pages and Page Layouts - >
Display Templates - > Search
2- Checkout the
Control_SearchResults.html file
3- Upload /
replace Control_SearchResults.html file by attached file
4- Check-in /
Publish this html file and approve it
Now check
the search result and it is working correctly.




Comments
Post a Comment