3

This is the desired scenario:

User searches for something and if that something comes from a particular list, swap out the Search Result title(link), with the list item's Url field.

If the search finds results from any other list, remove it from the results.

Is this possible? Thanks.

  • You mean you want to show results only from one list? – Amal Hashim Dec 3 '14 at 17:49
  • No, I mean I want to show everything that is NOT a list item (documents, etc), but if it comes from a particular list then add the results together with everything else and modify the main link in the display. – azium Dec 3 '14 at 17:51
3

You can use following query to get the result

path:"https://siteurl"  (ListID:{CC6FB9E2-92CE-444E-85C7-2E126DFF9ED0} OR contentclass<>SPListItem OR)

The above query will give you all results which are not of type SPListItem. If you observe there is an OR condition where we are including search results from a single list. So in your case you should change the GUID to the guid of your list.

Before you modify DisplayTemplate, you should include the Managed Property for Url using mso:ManagedPropertyMapping

http://blogs.technet.com/b/sharepoint_quick_reads/archive/2013/08/01/sharepoint-2013-customize-display-template-for-content-by-search-web-part-cswp-part-1.aspx

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.