SharePoint 2013 Search Using BCS

Introduction

This post will help you in the configuration of external searches in SharePoint 2013 using the BCS, where data is stored on the SQL server.

Prerequisite

Assuming that the following steps have already been completed and  are in place for further search configuration,

  1. Creation of database, table, and view (optional).
  2. There should be one generic account/user-id having read/write access on the database for access.
  3. Database server should be accessible from the local server where SharePoint is installed, with port opening if required.
  4. Service account having administrator rights on SharePoint Central Administrator to perform search configuration.
  5. SharePoint Designer installed on the server.
  6. Create Site-Collection where you want to create External Content Type and configure the Search Centre.

Steps to be performed to configure external search on SharePoint 2013,

  1. Create and configure the Secure Store Service(SSS).
  2. Create External Content Type(ECT) in SharePoint Designer.
  3. Create and configure Business Data Connectivity (BDC) Service.
  4. Create a Search Service Application and run a full crawl.
  5. Create a Search Centre and start the search.

Step 1 - Create and configure Secure Store Service(SSS)

To create SSS,

  1. Go-to Central Admin page>> Application Management>> Manage Service Applications.
  2. Click ‘New’ on the top left in ribbon panel and click on Secure Store Service.
  3. On new form, fill the required detail and click ‘Ok’ to create new SSS application.
  4. Now click on newly created SSS application and click on ‘Generate New Key’ on top ribbon panel.
  5. On key generation page, enter the Pass Phrase in text-box and enter the same string in Confirm Pass Phrase textbox.
  6. The passphrase you entered is in encrypted form, so make a note of it to recall in future.
  7. Click ‘Ok’ to submit the form.
  8. Now the next step is to create Target Application in SSS. The target application is used to store the credential in an encrypted format and it is used on behalf of an authorized user to make any request.
  9. Click ‘New’ on the top left to create a new Target application.
  10. In Target Application ID type string, this should be unique.
  11. Enter Display Name and Contact Email
  12. Click Next
  13. Click Next

    Add all users who have access to manage the target application settings. Click Ok to close the wizard for Target application creation.
  14. Next step is to set credentials of a target application.
  15. Point to Target application and select ‘Set Credential’ on a menu bar.
  16. Enter the credential and click ‘Ok’ to close the window.
  17. Once you have set the credentials for the target application, it is ready to be used by a SharePoint Server service.

Step 2 - Create External Content Type(ECT) in SharePoint Designer

  1. Open Site Collection in SharePoint designer.
  2. Click on External Content Type on left navigation bar,



  3. Click on External Content Type on a top ribbon bar



  4. Make the changes if required in Name and Display Name and click on the bottom to set connection with an external system for data retrieval.



  5. Click on ‘Add Connection’ to start connection wizard.



  6. Select Data Source Type to ‘SQL Server’ to connect within external SQL database.
  7. In the next window add connection property.

    a) Database Server: <IP\ Database server name>
    b) Database Name: <database name, which you want to connect with>
    c) Select the option <Connect with Impersonated Windows Identity>. Once you select it, a field Secure Store Application ID will be enabled.
    d) Since we have not configured the Secure store service yet, so you can leave it blank for now and it can be edited later. If you have configured it, then add application ID here.
     
  8. Once you click ‘Ok’ to complete this step, it will pop-up for authentication with user\ service account for which you have permission on SQL Server.
  9. If it authenticates, then it will expand the database on the same window with all tables to select.
  10. Right click on the table which you want to read from the database and click on ‘New Read Item Operation’ to initiate the wizard.
  11. No need to change anything (Optionally you can change the Display Name and fields name) click Next and Finish to complete the wizard.
  12. In the same way, Right click on the same table and click on ‘New Read List Operation’ and compete for the wizard.
  13. Now we are done with external content type and moving to configure the BDC in the next step.

Step 3 - Create and configure Business Data Connectivity (BDC) Service

  1. Open Central Administrator(CA) page and go-to>> Application Management>> Manage Service Application.
  2. Click on New>> Business Data Connectivity Service to create new BDC service.

    Enter the name and application pool rest all leave with default values. Press ‘Ok’ button to create BDC.
  3. Now click on new created BDC>> click on ‘Configure’ in top ribbon bar to start the configuration.
  4. On the configuration page, enter the site collection where you have created the external content type.
  5. Now select the BDC to create in the last step and click on ‘Create an Upgrade Profile Page’. It will take a few seconds to configure it. Once it is created you will get a confirmation message like below.

    Click ‘ok’ to close the confirmation message.

  6. Now select the created BDC and set the metadata store permission.
  7. Now select the ‘Set Object Permission’. Add admin user in a window and grant all permissions.
  8. Here we are done with BDC configuration. Now moving to configure the Search Service Application to start a search.

Step 4 - Create Search Service Application and run full crawl:

  1. Open Central Admin Page>> Application management>> Manage Service Applications.
  2. Click on Search Service Application.
  3. Create Content Source by clicking in the left navigation panel.
  4. Click New Content Source to create new.
  5. Fill the required details.

      

  6. Once you have created the Search Service Application, click on it you will get the below options



  7. Start the Full Crawl from here.
  8. While crawling, you may check the crawl status from Crawl Log available in the left navigation panel.
  9. Once it is completed, it will show the status as Ideal.
  10. Now you are done with content indexing, the next step is to setup search center.

Step 5 - Create Search Centre and start the search:

  1. Go-to Central Admin>> Application management>> Create Site Collection.
  2. Select Enterprise tab and select Enterprise Search Center template to create search center site.
  3. Open the site collection and Start searching.