This is a live project issue that just came across today, so thought of sharing with everyone!!
If we have a search based application in SharePoint 2013, we can retrieve search based results by either using a Search Results web part or a Content by Search web part.
If we configure both the web parts to have same query and result source, we should be receiving same results set and count.
However, Content by Search web part returns all results as expected, but search results web part was only returning few of the results. It surely is not a problem of crawl as data is present on the site and is being displayed using the other web part.
So what could be the issue?
Conclusion & Solution:
In the earlier versions of the Search Result Web Parts, the user had an option to “Trim Duplicates” which is no longer present in the SharePoint 2013 Search Result Web Part’s properties.
There is a way to set the Trim Duplicates property to false. Sharing the steps below:
- Export the Search Results Web Part from your page.
- Open the .webpart file in your favorite editor.
- Search for “Trim Duplicates”, you will find it as part of the DataProviderJSON property.
- Set the Trim Duplicates property to False.
- Upload the web part.
- Add the web part to your page.
SharePoint excludes the content that it thinks is similar. Even though the pages have a unique name and the content might not be the same, if it has some content that is similar, then search will collapse them in the result set.
Once the Trim duplicates option is set to false, you will get the results that you would expect and the result set from a Content By Search web part will match the result set from a Search Result web part