So the other day I wrote about an error received when your security is not setup properly when configuring search for external data using Business Connectivity Services. I thought today would be a good day to show you how to setup SharePoint search to crawl external content with BCS. Setting up search isn’t actually too hard once the ECT is there. What people initially forget though is setting up the profile page. This is what tells SharePoint how to display the data to you. If you don’t setup profiles here is what things look like:
We can see from the link details that it is coming from the BDC (Business Data Connectivity). That’s the service in SharePoint that houses BCS. Clicking on the link just takes us back to the search center. This is because SharePoint doesn’t know how to display the data to us.
Setup Profile Page Host
The first thing we need to do is setup the profile page host. This is a site that will host the individual pages for each ECT’s profile page. If you do not do this first, when you attempt to create the profile page you will receive the error: “Unable to create profile page until the host site is setup. Contact your administrator for assistance.”
You can setup a different host for each ECT you create, but I suggest against that. Try to keep everything together. In my case because the profile pages are used mainly for search, I am going to put them into a sub site in my search center.
To setup the profile page host perform the following steps:
- Launch Central Administration
- Click on Manage Service Applications
- Click on the link for your Business Data Connectivity service application
- Place a check mark beside your ECT and click configure
- Next ensure there is a check mark in “Enable Profile Page Creation…”
- Type in the URL of the site you wish to house the profile pages
- Click Ok.
You will not receive an update message. The window will simply close.
Create ECT Profile Page
Creating the profile page is really easy now. Simply place a check mark beside the ECT and click on Create/Upgrade in the ribbon. Note: you can also do this in SharePoint Designer, but I am already in Central Admin so I will just do it here.
SharePoint will try to open a dialog box, but the page is designed to work within a full page screen so simply click on the link provided in the error dialog page:
The page will explain that it will either create the profile page if it doesn’t exist or it will overwrite the current if an old one exists already:
Once you click OK, you will get the SharePoint “Working On It” Message and then a confirmation screen.
Now that the profile page exists we can create the connection between search and the external data using BCS.
Grant Search Access to ECT
So if you reviewed the issue I documented in my previous post you need to ensure your crawl account has access to the ECT before setting up the crawl. To do this:
- Open Central Admin and click on Manage service applications under Application Management
- Click on the Business Data Connectivity service application.
- Select the ECT you wish to crawl and click Set Object Permissions
- Add the SharePoint Search crawl account
- Grant it Execute permissions.
Configure Search to Crawl Your External Data
So now our ECT is all setup and ready to be crawled. We need to now create a new crawl source and point it at our ECT. The steps are pretty straightforward:
- Access Search Administration
- Click on Content Sources
- Click on New Content Source
- Give the new source a name.
- Under Content Source Type select Line of Business Data
- Ensure the BDC service your ECT exists under is selected in External Data Source
- Click on Crawl selected external data source
- Place a check mark beside you ECT
- Set your crawl schedules and Priority
- Click OK
Once this is complete run a full crawl on the newly created content source.
When the crawl is complete you will now be able to search for content in you external system:
That’s all there is to using SharePoint to crawl your external data sources.
Thanks for reading!!
Is it possible to crawl the entire SQL database(Include all current tables & future tables) using BCS?, since i can see we need to select the tables by creating external content types every time when any new tables created in Database.
Appreciate your inputs.
Good question. Technically you can, though to be honest I am not sure why you would want to. The idea behind BCS is to bring in data that you need to accomplish a task. If that is your use case than sure bring everything in, but the more data you bring in, the more data SharePoint has to crawl to build the data. You will also have to manually create all your ECTs for the data and then create the external lists. On top of that, you are now going to be using SharePoint search to crawl a LOT of data (I assume you want to do that based on the post you asked the question from). That’s going to significantly increase your indexing time and the size of your index (depending on the amount of data in your database).
So basically what I am saying is that, while technically possible you probably shouldn’t unless you have a real need to do so and are cognizant of the pitfalls you could run into.