How to Create a Result Source for a BCS Entity in SharePoint Search

 

 

 

 

I was working at a client that was configuring Business Connectivity Services to bring data from an ERP into SharePoint. Of course, the main benefit of bringing it to SharePoint was being able to Search information using the powerful SharePoint 2016 Search Engine. Let’s understand BCS Entity in SharePoint Search.

As you see in the following screenshot, I had 4 External Content Types from which I wanted to bring information in SharePoint. This guide assumes your profile pages for your External Content Types were already created!




First of all I created a new Content Source, setup all the options and run my full Crawl, I was able to search the data in SharePoint! Great!

However, the benefit of SharePoint Search is that you can heavily customize the search in order to bring results that really matter to the user. So, in my Enterprise Search Center, I wanted to add tabs that would only show me results from Projects or Clients. So, I created a new Search Page by clicking on the “Add Page” link in the Search Center and naming it “ClientResults”.




I then went into Site Settings > Search Settings and added a new “link”. I pointed it to “/search/Pages/ClientResults.aspx

So Now, I did the same for “Projects” As well, so now when I go into my Search Center and click the arrow, I got the “Projects” and “Clients” choices!




But, whenever I Search, it doesn’t filter anything! It’s basically the same as “Everything”. We got to go change this! I will show the screenshots from the point of a SharePoint Administrator, however you can do this even if you don’t have access to the Central Administration! If you are a Power User, you can follow the tutorial from Site Settings > Search. We will use the “Schema” and “Result Sources” option.

Back to Central Administration > Service Applications
> Search Service Applications , on the bottom left, you will click on the “Search Schema“. And then Create a New Managed Property

Here are the Details I gave it:




Now, in the Mappings to crawled properties part, click on “Add a Mapping




In the “Business Data” Category, choose the “EntityName” crawled property and select OK.

Now, just click on the OK button and the managed property will be created!

Now that we got our managed property, we will need to do a full crawl of both the BCS and the SharePoint Content Sources! This will make sure that the data is crawled, as well as the search schema is updated!




After the full crawl is done, we will go in the Search Service Application > Result Sources and then click New Result Source.

After you fill the initial information, launch the “Query Builder

In the Query Builder, we will focus on the “Property Filter” part. First of all, click on the “Select Property” dropdown, and choose to “Show all managed properties”




Afterwards, reclick on the dropdown, select the BCSEntityName managed property we just created. The operation must be “Equals“. And then you will choose “Manual Value“. In the textbox right under, insert your database name, in my case it’s “client“. And then click on “Add property Filter“.

We will then click on the “Test Query” button. If everything is ok, you will see a bunch of your records and they are pointing to the good URL of your Profile Page!




Once that works , click on Ok to close the Query Builder, and then OK again to save your new Result Source!

Now, all we have to do is modify the Search Page to show us the right stuff! Navigate to your Search Center, Search for something random and go to the “Clients” Tab. Then, click on the settings wheel and click on “Edit Page”

Then, Edit the Search Results WebPart.




Click the “Change query” button.

In the Select a Query dropdown, choose the ClientBCS option! You can then customize it further in the Refiners & Sorting options, however we won’t go there in this tutorial. Click OK.




Afterwards, click OK on the “Edit WebPart” window.

Afterwards, check in the page and publish it! Now when you search in Clients, you should only find Client Names and nothing else! You are done!




Subscribe to daily updates!

Be Connected…

Satyendra

 

 

 

 

THREE QUERIES is SharePoint, front-end, back end web technologies and project management resource that helps developers, artchitect and managers at all levels to improve their performance. We provide an important knowledge base for those involved in managing, architecture and developing projects of all kinds. With weekly exclusive updates, we keep you in touch with the latest SharePoint, front-end, back end web technologies and project management thinking.

WE ARE CONNECTED ~ Follow us on social media to get regular updates and opinion on what's happening in the world of SharePoint, front-end, back end web technologies and project management. If you like this article, please share it and follow us at Facebook, Twitter, Instagram, Pinterest and LinkedIn

,

About Satyendra Mishra

Microsoft certified, motivated, energetic and accomplished SharePoint Consultant and Architect with 13+ years of work experience in Management, Architecture, Analytics, Development and Maintenance. I have been fortunate to be a part of over 20+ Web/Mobile/Software SharePoint and .Net projects delivery with various companies across different industry sectors. This has provided me a valuable insight and experience especially in successful implementation of technology solutions. Having very strong System Architecture, Technological, Management & Analytical Skills, Knowledge of Office 365, SharePoint, .Net, JavaScript, React, Angular, Azure, SQL. In 2016, he decided to start sharing the knowledge back to society in the form for content writing and blogging. LinkedIn : https://www.linkedin.com/in/satyendram/
View all posts by Satyendra Mishra →

4 thoughts on “How to Create a Result Source for a BCS Entity in SharePoint Search

  1. Very nice post. I just stumbled upon your blog and wanted
    to say that I’ve truly enjoyed surfing around your blog posts.
    After all I’ll be subscribing to your feed and I hope you write again very soon!

  2. Hey There. I found your blog using msn. This is an extremely well written article.
    I will make sure to bookmark it and return to read more of your useful
    information. Thanks for the post. I will certainly return.

Leave a Reply

Your email address will not be published. Required fields are marked *