Forum Discussion
John Aage Andersen
Sep 08, 2016Iron Contributor
Can Search Result Web Part be used to show items from a specific list?
We have a list of customers. The "Title" column contains the customer name. The list is based on a site content type "Customer". A Search Result Web Part has been added on a page and the query ha...
- Sep 08, 2016
Mikael Svenson
Sep 18, 2016Steel Contributor
As stated by other using path: can limit you to just one particular list, but you will get the forms as well. To only return items you can do something like:
path:http://server/site/yourlist contentclass:sts_listitem
If like you do, have the content type, then you can get all items regardless of the list with the secret:
spcontenttype:mycontenttype
Using contenttype does not work as it contains garbage info beside the ct name, which is why you use SPContentType in the filter.
Combine this with path, and you get that content type from a list with more than one. And it's more correct to use = instead of : if you know the exact name, but usually they work just the same as long as you don't have more ct's starting with the same name.
As easy as that, and feel free to get my book as Dean_Gross said :)