We recently experienced an issue where by the Search results web part was not returning all results matching a specific keyword. A search below for the keyword “Car” was returning a single result and stripping out the other valid result of “Booking a Car”.
The first impression was it could be related to content not being crawled or unpublished content, however after performing a separate search for the missing item this wasn’t the case.
Searching by “Car”
Searching by “Booking” shows the crawled result
Search results are somewhat of a difficult thing to troubleshoot and debug. There are a few useful tools and processes to debug search. Because it’s often difficult to understand the raw data being returned when the Search Results SharePoint page is being hit, one of the first options to try it to hit the Search API Url directly while passing in the query string parameter for the Querytext.
For example, in this case we hitting the Search API with the query text for car http:///_api/search/query?querytext=’car’ this was still not returning our “Booking a Car” result.
And hitting the Search API Url http:///_api/search/query?querytext=’booking’ was returning the “Booking a Car” result.
From this we could deduce that the items were being correctly crawled but for some reason not returned as a matching search result.
The next step was to debug using the
SharePoint 2013 Search Query Tool. This allowed for easy filtering of the search results and to examine the managed properties all of which looked correct.
After toggling the different search options finally the missing results appeared when the “Trim Duplicates” option was selected.
So it appears that SharePoint will exclude items that appear to be similar, even though they are not duplicates and the content and the title is different. Therefore my results for “Booking a Car” were being stripped out of the search results.
By default the “Trim Duplicates” is selected in the SharePoint Results web part. So, the solution is to turn off the trim duplicates option so that all results can be displayed.
This can be done by opening the Search Results web part properties and select the Change Query option.
Settings tab select the option
Don’t remove duplicates
Setting this option will now resolve our missing search results issue.
SharePoint may classify items as duplicates even though they have a different title and or content. Therefore, if all the content has been successfully crawled and is still not appearing in the search results as expected, it’s worth checking if they are being stripped out by the default “Trim Duplicates” option.
Copyright , Connected Systems