Friday, 6 July 2012

How to search External data using BCS




I have created External Content Type using Bussiness Data Connectivity Template from visual studio in my previous Post.Please refer this post.


Now i want show how to configure the search service to index that data and show results in a way that is useful to the end user.


To display search result items we need to setup profile pages.


Profile pages are used to show the detailed information about an external data record. The search service will link its results to the appropriate profile page. If you do not set up a profile page, then the search results will contain a useless link.




how to Create profile page please refer this post.


After creating profile page we need to set this profile page to the external list.


i. Go to central administration --> manage service applications-->bussiness data connectivity services.


ii. Select external content type and click on Configure and specify Host SharePoint site URL.


iii. Click on Create/upgrate from the ribbon.




Now am showing to how to configure the search service to use this ECT while crawling and indexing. The search service uses Content Sources to identify and control the content it needs to search. You will also need to set the account to use for the crawl operation. This account should be the same as the one you used to set permissions in the Business Data Connectivity 


service and it must have read access to the AdventureWorks database.


1. Go to Central Administration, Click on "Manage Service applications".


2. Click on "Search service application" from the list of services.


3. in the left panel, click Content Sources under Crawling.


4. Click on "New Content Source".


5. Specify Name of the Content Source, select "Line of Business Data" as Content source type, select external content type, and check Start full crawl of this content source. Click on  "OK".


6. In the left panel, click on Scopes which is under "Queries and Results".


7. Click on New Scope.


8. Specify Scope name and click on "OK".


9. in the list fo scope click on Add Rules to the newly added scope.


10. Select Content source radio button in Scope rule type and select newly added content source type from dropdown in content source. click on "OK".


newly added scope will be available for search after 15 mins.



11. Now go to your site, click on "site actions --> site settings".


12. Click on Search scopes which is under site collection administration.


13. Click on Display groups.


14. Click on "Search Dropdown".


15. mark checkbox for the newly added scope and set default scope.


16. Click on Advanced search.


17. Mark checkbox for the newly added scope.


here am showing external data ..




18. Now go to home page , enter search keyword in search control and press enter.


19. it will display result based on search keyword.

20. when you click on search result link it will show detailed information for that link in profile page.






Thats it..


Your suggestions and comments are welcome.

No comments:

Post a Comment