The important thing here is we need to select the ows_contenttype crawled property as crawled property:
Also we need to make sure to check the Query Property while creating this managed property:
Now once this is done we need to do a full crawl so that we can do query on this managed property.
I have created my managed metadata with the name contenttypeproperty. Also lets asssume my content type name is democontenttype. Now we can do a search like
test contenttypeproperty:democontenttype
With this query the search will only return the items having the content type as democontenttype.
On the similar lines if we just need to return the documents in the search results we can change the query to:
test contenttypeproperty:document
With this query it will only be showing the documents in the search resutls core web part.
1 comment:
Hey there, thanks for demonstrating this. I am trying to implement this on some custom content types I created. The content types I have created have spaces in the names e.g. "my content type"
I can't seem to get results for this even though I have crawled the site and have content based on my content type in libraries appearing with the regular FAST all sites scope. Documemt content type returns results also. Do you know if you can you have spaces in your content type name?
Post a Comment