SP 2010: How to search for a Content Type in a KeywordQuery?
-
10-12-2019 - |
Question
I want to search all of my Sites for a special Content Type with a Keyword Query. Any suggestions?
Solution
You will need to create a custom Managed Property in your Search Service Application that maps to the crawled property ows_ContentType.
Refer here and here for some help with that. (You can ignore the more advanced instructions on how to then create a refinement filter based on that, unless you want a refinement filter...) Be sure to run a full crawl after setting up the mapping.
Then you can use a property restriction keyword query for that managed property. For instance, if you named your managed property "ContentTypeName", you could use the property restriction keyword query:
ContentTypeName:"my special content type"
Licensed under: CC-BY-SA with attribution
Not affiliated with sharepoint.stackexchange