Answered by:
How to initialize a search based on a specific content type?

Question
-
Hello,
how can I specify a search based on content types? Example:
I have a content type called "mobile phones" with the columns model and mobile owner. When I click the button "search mobiles" I want to see the fields model and mobile owner as input field for my specific search.
How can I generate such a search mask?
Thank you very much indeed for helping me!
Friday, December 3, 2010 12:32 PM
Answers
-
That's quite easy actually, just use the ContentType keyword. If you want to show those columns in your search results, you will need to customize the CoreResultsWebPart to add those columns.
Corey Roth blog: www.dotnetmafia.com twitter: @coreyroth- Proposed as answer by Michal Pisarek MVP Friday, December 3, 2010 4:33 PM
- Marked as answer by Lily Wu Friday, December 10, 2010 9:05 AM
Friday, December 3, 2010 3:10 PM -
Hi,
There are 2 parts in your query.
1. Configure content type fields in metadata property mappings.
If you want users to search for the entire CT, then Go to metadata property mapping in CA, then search for ContentType & edit it. Now check 'Allow this property to be used in scopes'. Once you do this, you can go and configure scope in site collection.
http://sjoere.blogspot.com/2007/04/use-content-type-for-search-scope.html this is a good article for the same...If you want to allow users to search for particular columns in CT, then you can define new property mapping in CA and map the crawled property from CT. After this you can create scope in the site collection for this prop mapping.
2. Display content types is search results.
You will have to add a search core results web part. Now modify the WP and add the column name (managed property mapping) in display properties.Now you have to change the XSL to display the columns in results.
Hope this helps. If you have any queries, please let us know, will provide necessary links for the same...
Vighnesh Bendre
http://markviky.blogspot.com- Marked as answer by Lily Wu Friday, December 10, 2010 9:05 AM
Saturday, December 4, 2010 7:58 AM
All replies
-
That's quite easy actually, just use the ContentType keyword. If you want to show those columns in your search results, you will need to customize the CoreResultsWebPart to add those columns.
Corey Roth blog: www.dotnetmafia.com twitter: @coreyroth- Proposed as answer by Michal Pisarek MVP Friday, December 3, 2010 4:33 PM
- Marked as answer by Lily Wu Friday, December 10, 2010 9:05 AM
Friday, December 3, 2010 3:10 PM -
Hi,
There are 2 parts in your query.
1. Configure content type fields in metadata property mappings.
If you want users to search for the entire CT, then Go to metadata property mapping in CA, then search for ContentType & edit it. Now check 'Allow this property to be used in scopes'. Once you do this, you can go and configure scope in site collection.
http://sjoere.blogspot.com/2007/04/use-content-type-for-search-scope.html this is a good article for the same...If you want to allow users to search for particular columns in CT, then you can define new property mapping in CA and map the crawled property from CT. After this you can create scope in the site collection for this prop mapping.
2. Display content types is search results.
You will have to add a search core results web part. Now modify the WP and add the column name (managed property mapping) in display properties.Now you have to change the XSL to display the columns in results.
Hope this helps. If you have any queries, please let us know, will provide necessary links for the same...
Vighnesh Bendre
http://markviky.blogspot.com- Marked as answer by Lily Wu Friday, December 10, 2010 9:05 AM
Saturday, December 4, 2010 7:58 AM